Monday, December 28, 2020

Linux server expand disk size



Oracle Cloud - Linux server expand disk size

Extend your disk from the storage server 1st. in this case we are using Oracle Cloud so we have extended in OCI console
fdisk -l
[root@ebs121db1-mylocal-com ~]# fdisk -l
WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.

Disk /dev/sda: 50.0 GB, 50010783744 bytes, 97677312 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 1048576 bytes
Disk label type: gpt
Disk identifier: A21E6499-33C5-401E-9330-8331C0E94D2C


#         Start          End    Size  Type            Name
 1         2048       411647    200M  EFI System      EFI System Partition
 2       411648     17188863      8G  Linux swap
 3     17188864     97675263   38.4G  Microsoft basic

Disk /dev/sdb: 536.9 GB, 536870912000 bytes, 1048576000 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 1048576 bytes


You can see that disk is resized and it's visible in operating system level. next is we need to extend it.
resize2fs /dev/sdb

[root@ebs121db1-mylocal-com ~]# resize2fs /dev/sdb
resize2fs 1.45.4 (23-Sep-2019)
Filesystem at /dev/sdb is mounted on /u01; on-line resizing required
old_desc_blocks = 19, new_desc_blocks = 32
The filesystem on /dev/sdb is now 131072000 (4k) blocks long.

[root@ebs121db1-mylocal-com ~]# df -h /u01
Filesystem      Size  Used Avail Use% Mounted on
/dev/sdb        492G  260G  209G  56% /u01
[root@ebs121db1-mylocal-com ~]#


/u01 mount point size is changed.


apt-key warning when sudo apt update run

Issue: apt-key warning when sudo apt update run Update below file: cat /etc/apt/sources.list.d/download_docker_com_linux_ubuntu.list ...