Difference between revisions of "LVM"

From Noah.org
Jump to navigationJump to search
m
Line 2: Line 2:
 
See also [http://www.tldp.org/HOWTO/LVM-HOWTO/ LVM Howto]
 
See also [http://www.tldp.org/HOWTO/LVM-HOWTO/ LVM Howto]
  
You can resize ext2/ext3 and ReiserFS filesystems while online (while mounted). I  prefer ReiserFS and trust it more; although, I can't say I ever had any trouble resizing an ext3 filesystem while online. ReiserFS had this feature from the beginning, plus it has other features that I like over ext3. Generally, if I am planning an LVM system from the beginning then I also plan to use ReiserFS. I only use ext3 when forced to.
+
You can resize ext2/ext3 and ReiserFS filesystems while online (while mounted).
  
 
Remember:  
 
Remember:  

Revision as of 12:30, 17 April 2007

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.

  • 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