Thursday, January 16, 2014

Logical Volume Management - Extending root file system online in Linux

Situation : 
On a Linux server, the root file system got full, as it was running some application which is prone to create large number of files. 

If Linux system Partitioning is LVM based then it is very easy. 

Few checks before will certainly help. 

Determine the Volume Group you want to extend and see if the mount point exists on the logical volume belongs to the VG you are extending.  

Steps : 
  • Create a Physical volume 
  • Add it to the Volume Group, aka, VG
  • Extend the logical volume
  • Re-size the file system online
Example : 
Physical volume creation 
            pvcreate /dev/sdb

Adding it to the Volume Group 
            vgextend vg_livedvd /dev/sdb

Extending the Logical volume 
            lvextend -L +30G  /dev/vg_livedvd/LogVol00

Re-size the file system online 
            resize2fs /dev/mapper/vg_livedvd-LogVol00


No comments:

Post a Comment