Saturday, July 21

How to Extend and Reduce Logical Volume


The biggest advantage of logical volume manager is that you can extend your logical volumes any time you are running out of the space. To increase the size of a logical volume by another 800 MB you can run this command:

1. How to Extend

# lvextend -L +800M/G <LV path>
The command above does not actually increase the physical size of volume, to do that you need to:
# resize2fs  <LV path>
The above method we use for online resizing and below is by unmounting.


#umount <mounting point>   eg: #umount /home
#lvextend –L +500M <LV path>        (+500M means incremental size)
#e2fsck –f <LV path>
#resize2fs <LV path>
#mount <LV path> <mounting point>
Or
 #mount –a (if already have entry in /etc/fstab)

2. How to Reduce

#umount <mounting point>   eg: #umount /home
#e2fsck –f <LV path>
#resize2fs <LV path> 400M (desired size of LV)
#lvextend –L 400M <LV path>
#mount <LV path> <mounting point>
Or
 #mount –a (if already have entry in /etc/fstab

No comments:

Post a Comment