Extending root disk of Cloud Director appliance
Cloud Director 10.x appliance
Need to expand the root partition of a Cloud Director appliance.
SSH
into the Cloud Director applianceecho 1 > /sys/class/block/sda/device/rescan
root@cell [ ~ ]# fdisk -l
....
GPT PMBR size mismatch (83886079 != 94371839) will be corrected by write.
The backup GPT table is not on the end of the device. This problem will be corrected by write.
Disk /dev/sda: 45 GiB, 48318382080 bytes, 94371840 sectors << New disk size
root@cell [ /etc/yum.repos.d ]# tdnf install parted
Refreshing metadata for: 'VMware Photon Linux 3.0 (x86_64)'
Refreshing metadata for: 'VMware Photon Linux 3.0 (x86_64) Updates'
Refreshing metadata for: 'VMware Photon Extras 3.0 (x86_64)'
photon-extras 123 100%
Installing:
parted x86_64 3.2-9.ph3 photon-updates 1.12M 1170933
Total installed size: 1.12M 1170933
Is this ok [y/N]:
y
Downloading:
parted 423548 100%
Testing transaction
Running transaction
Installing/Updating: parted-3.2-9.ph3.x86_64
Complete!
root@cell [ /etc/yum.repos.d ]#
# parted /dev/sda
GNU Parted 3.2
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
print
Warning: Not all of the space available to /dev/sda appears to be used, you can
fix the GPT to use all of the space (an extra 10485760 blocks) or continue with
the current setting?
Fix/Ignore? Fix <<
Fix
Model: VMware Virtual disk (scsi)
Disk /dev/sda: 48.3GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 1049kB 3146kB 2097kB bios_grub
2 3146kB 137MB 134MB ext3
4 137MB 272MB 134MB linux-swap(v1)
3 272MB 42.9GB 42.7GB ext3
(parted) resizepart 3
resizepart 3
Warning: Partition /dev/sda3 is being used. Are you sure you want to continue?
(YES/no) yes
(42.9GB) 100%
(parted) quit
root@cell [ /etc/yum.repos.d ]# resize2fs /dev/sda3
resize2fs 1.45.5 (07-Jan-2020)
Filesystem at /dev/sda3 is mounted on /; on-line resizing required
old_desc_blocks = 5, new_desc_blocks = 6
The filesystem on /dev/sda3 is now 11730171 (4k) blocks long.
root@cell [ /etc/yum.repos.d ]# df -l /
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda3 45922128 13317084 30295188 31% /