Search This Blog

Tuesday, July 20, 2010

How to Extend LVM partition online?


One Logical Volume named lv1 is created under vg0. The Initial Size of that Logical Volume is
100MB. Now you required the size 500MB. Successfully make the size of that Logical Volume 500M
without losing any data. As well as size should be increased online.


Answer: In RHEL 4 LVM (Logical Volume Manager) is Version 2. The new feature added is online
extend. In previous version you should unmount the device.
1. Verify the size of Logical Volume: lvdisplay /dev/vg0/lv1
2. Verify the Size on mounted directory: df -h or df -h mounted directory name
3. Use : lvextend -L+400M /dev/vg0/lv1
4. ext2online -d /dev/vg0/lv1 to bring extended size online.
5. Again Verify using lvdisplay and df -h command.
Explanation: The Feature of LVM is dynamically resize the partition. If you resize data, it will not be
lost. LVM Concepts Multiple Physical Disks belongs to the physical group. Using multiple disks
belonging to physical group we can create on the Volume group. Under that Volume Group we can
create multiple Logical Volume and only these Logical Volumes we can use. As well as we can
increase and decrease the size of Logical Volume by using lvextend, lvresize etc.