We have dozens of Ubuntu nodes where I have to resize the hard disk drive to different sizes. Currently I’m doing all of the following steps manually:
- Increase the size of each node’s virtual hard disk in VMware vCenter.
- Change the configuration of the DVD drive, mount a GParted ISO, boot from BIOS, and change the boot order.
- Boot into GParted, manually increase
- Stop the VM, disable the DVD drive, and start the VM.
lvextend -r /dev/ubuntu/root /dev/sda5to extend the LVM and resize the partition to its maximum possible size.
- Optional: Check with
df -hif everything’s OK.
I would love to automate this process, in a best case to provide a list of node names and corresponding sizes and let the tool do its job. In the case where there is no automated solution available I would love to hear about micro-optimizing every of these steps to make my tedious job easier.
We’re already automatically provisioning our nodes with Chef, and a VM template with a hard disk size of 16 GB.
Any smart ideas?