Resize Filesystem, Logical Volume in Linux for Virtual Machine using ext4

Often when you have a Linux up and running you run out of space. I use VMware Fusion on my Macbook Pro 13 inch to do a lot of testing. To increase the diskspace you can follow the below simple steps

  1. Shutdown the VM and Increase the Diskspace
  2. Go to Disk Utility and the device /dev/sda will show the additional space as empty
  3. Right click and say create partition, once partition created it will have a device name eg:  /dev/sda3
  4. $ vgdisplay
  5. $ lvdisplay
  6. $ lvextend /dev/VolGroup/lv_root /dev/sda3
  7. The logical volume is extended now resize the filesystem to reflect the new change
  8. $ resize2fs /dev/VolGroup/lv_root
  9. $ df -h

    There is thus a new partition /dev/sda3 created and the logical volume is extended to include this partition. And finally the filesystem has been resized to reflect the disk size

Category: Linux

Tags:

Leave a Reply

Article by: Shadab Mohammad