Category: General
Create Rescue CD, you may already have one created so just mount this in edit settings
- Download rescuecCD from [http://www.sysresccd.org
- Load into ISO
- Startup VM with ISO, in boot options, ensure to boot into BIOS, set CD as a primary boot device restart VM and you should see a command line
Resize partition table
- Enter or in 64-bit Redhat type rescue64 (for keymap)
- fdisk -l
- fdisk /dev/sda
- p (to print)
- d (to delete)
- 2 (choose the second one)
- n (to recreate)
- p (choose primary)
- 2 (choose the second one)
- enter (to except new size)
- enter (to accept last one)
- p (show new size)
- t (change type)
- 2 (choose the second one)
- 8e (to change partition type code)
- p (to print shows 83 changed to 8e)
- w (to commit changes)
Scan for new or changed disks
echo "- - -" > /sys/class/scsi_host/hostX/scan
Where X can be 0, 1, 2…
Resize physical volumne
- pvdisplay /dev/sda2 (show old size)
- pvresize /dev/sda2
- pvdisplay /dev/sda2 (to show new size)
Extend volume group
- vgdisplay (show free space available, check “Free PE / Size” for $FreePESize parameter below)
Register Volumes
- vgscan
- vgchange -ay (activate the lvm)
Extend Logical Volume
- lvextend -l +$FreePESize /dev/VolGroup00/LogVol00 (the 64 is the param above)
or - lvextend -l +$FreePESize /dev/VolGroup/lv_root (the 64 is the param above)
Resize File System
- resize2fs /dev/VolGroup00/LogVol00
or - resize2fs /dev/VolGroup/lv_root
Wait until this is finished.
Sync buffer to disk
- sync
Now, wait 2 minutes for a small increase, or 5 minutes for a large increase. - sync
Shutdown VM
- shutdown -h now
- wait for the machine to shutdown properly
- remove rescue cd from machine
- start machine as normal
If it fails when booting up, then run the fsck and click Y, then run this when OS starts from the command line:
resize2fs /dev/VolGroup00/LogVol00
Linux