Sistina Logical Volume
Manager (LVM)
Advantage
- Increase/decrease logical volumes (partitions) without worrying about the
neiboring partitions
References
- Sistina Logical Volume
Manager (LVM)
- Logical
Volumes on Dell PowerEdge
- How To on LVM
Sample Scenarios
Create 1TB partition /data
pvscan
lvscan
- create a new logical volume (1048675M) from a physical volume:
lvcreate -L1048675 -nLogVolData VolGroup_ID_724 /dev/sda5
- make logical volume a file system
(reserve 1% for super user, default 5% is too big for this, still use default 4kb per inode):
mke2fs -j -m 1 /dev/VolGroup_ID_724/LogVolData
- remove a logical volume (not part of the sequence,
but in case you messed up)
lvremove /dev/VolGroup_ID_724/LogVolData
mkdir /data
mount /dev/VolGroup_ID_724/LogVolData /data
- make it mount at boot time, edit /etc/fstab
/dev/VolGroup_ID_724/LogVolData /data auto defaults 0 0
Extend /var partition on the fly (LVM2 and ext3 file system)
- Display Volume Group to see free space
vgdisplay
- Extend Logical Volume by 2G
lvextend -L+2G /dev/VolGroup_ID_724/LogVol7
- Resize file system to fill up the logical volume
ext2online /dev/VolGroup_ID_724/LogVol7