Resize LVM

Various Linux Stuff
Post Reply
thockman
Site Admin
Posts: 104
Joined: Thu Dec 15, 2005 5:51 pm
Location: Kansas City
Contact:

Resize LVM

Post by thockman » Tue Jan 22, 2008 5:46 pm

Boot to the rescue cd
enter lvm
lvm> vgscan # Will show the name of the Volume Group
lvm> vgchange --available y VolGroup00 # Activates the VG and the LVs in it
lvm> lvscan # Should show the LVs as "ACTIVE"; the devices in /dev it mentions should now exist
lvm> exit # Quit, return to the prompt

5. Now resize the filesystem with this command (e.g., using device /dev/VolGoup00/LogVol00):

e2fsck -f /dev/VolGoup00/LogVol00 # fsck on the filesystem
resize2fs /dev/VolGoup00/LogVol00 nnG # resize the fs to nn GB; nn should be less than the current fs size
e2fsck -f /dev/VolGoup00/LogVol00 # Do another fsck on the filesystem; fix any errors which appear

6. Run lvm again and type:

lvm> lvreduce -LnnG /dev/VolGoup00/LogVol00 # Resize the LV to nn GB; nn should be the same as above
lvm> exit # Quit, return to the prompt

7. Finally, do another filesystem check:

e2fsck -f /dev/VolGoup00/LogVol00 # Do another fsck on the filesystem; fix any errors which appear

8. Remove the CD and reboot.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest