Issue:
Need to increase disk space in VM server disk.
Note: We have another document that does an XFS filesystem (FS). It also does the LV extension and the FS extension with the VM running, which means less time with the VM down.
Solution:
A. Increase the disk size in VM settings.
1. VM --> Edit Settings
2. Select Hard disk x on left, change Provisioned Size increasing to desired GBs.
Note: You cannot reduce this size, only increase it. Keep that in mind.
3. Save with OK.
B. Increase LVM size with GPARTD.
1. Set VM CD w/GPARTD disk (use currently release - old releases do NOT support LVMs).
CD icon --> Connect to ISO on local disk --> gparted-live-0.16.1-1-i486.iso
2. Reboot OS w/o using Reset.
$ sudo reboot
C. GPARTD
1. Take default selections of GPARTD boot-up.
2. Select the disk/drive in the upper right which you expanded in step #1 above.
3. Select the partition with the LVM to expand.
4. Click Deactivate to allow the LVM to be updated.
5. Click Resize button and drag all the way to right. Click Apply and apply the extension.
6. Click Activate to put the LVM back.
7. Click Apply
8. Close GPARTD. DO NOT REBOOT YET.
D. Extend the OS within the disk.
1. Click the Terminal icon at the top and switch to the root user or use sudo in the steps below
$ sudo su
2. Use lvextend to extend the OS/format to the new extent limit.
(get name of volume group by crawling the /dev/ folders - typical paths are /dev/servername/root and /dev/vg_servername/lv_root)
$ sudo lvextend -L +2G /dev/myserver/root
Note: myserver is typically the name of the server.
$ sudo df -h
Note: Get the name of the partition to expand (e.g. /dev/mapper/myserver-root)
$ sudo resize2fs /dev/mapper/myserver-root
Notes:
Update the name of the server and the partition size as applicable. Usually the size on the end is not needed unless you don't want to use all space.
You may be told you have to run e2fsck -f /dev/mapper/myserver-root first. If so, do it.
3. Confirm the new size w/df.
$ df
4. If successful, reboot to normal startup
$ sudo reboot
Note: Disconnect the CDROM when prompted during the GPART disk shutdown.
Newer versions of GPartD have expansion built-in.
previous page
|