LVM

From Noah.org
Revision as of 16:43, 14 May 2007 by Root (talk | contribs)
Jump to navigationJump to search

See also LVM Howto

You can resize ext2/ext3 and ReiserFS filesystems while online (while mounted).

Remember:

   a Volume Group is the equivalent of a physical device. 

It can be made up of a collection of drives. You can add or remove drives from a VolGroup. Note that this isn't strictly correct. Parts of a drive can be part of different VolGroups.

   a Logical Volume is the quivalent of a partition. 

Logical Volumes are mapped to a device in /dev. A LogVol is what you actually mount to a mount point.

  • pvdisplay -- display attributes of a physical volume.

Use this to figure out how much physical space is available.

  • vgscan -- to identify your volume groups by name.

example: VolGroup00

  • lvscan -- to identify your logical volumes by name.

example: LogVol00 LogVol01 LogVol02 LogVol03 LogVol04

  • df -- to see which device names are mapped to which Logical Volumes.

The device name is what mount/umount/ext2online care about.

  • ext2online -- this resizes an online ext2 or ext3 filesystem.

You do not have to umount it. If you don't have ext2online then your Linux is old. You will have to umount the device first; use ext2resize; then mount the device again.

extend an ext3 partition to be 100GB

Say that you have some unallocated space that you want to give to /var. Say that /var is mounted on device /dev/mapper/VolGroup00-LogVol04:

lvextend -L100GB /dev/VolGroup00/LogVol04
ext2online /dev/mapper/VolGroup00-LogVol04