096 - Logical Volume Management

The follwoing commands are simple Logical Volume Management in RedHat Linux.

1. Resize Logical Volume

  * Increase :

# lvextend -L +2G /dev/VolGroup00/LogVol04
# resize2fs /dev/VolGroup00/LogVol00

 * Decrease :

# lvreduce -L -2G /dev/VolGroup00/LogVol05
# umount /home
# /sbin/e2fsck -f /dev/VolGroup00/LogVol05

2. Increase Swap

# lvcreate -n LogVol06 --size 2G VolGroup00
# mkswap /dev/VolGroup00/LogVol06
# swapon /dev/VolGroup00/LogVol06

 * Edit /etc/fstab in order to mount it automatically at os boot-up.

  /dev/VolGroup00/LogVol06 swap                    swap    defaults        0 0

3. Create New Logical Volume

# lvcreate -n LogVol07 --size 220G VolGroup00
# mkfs.ext3 /dev/VolGroup00/LogVol07
# mount /dev/VolGroup00/LogVol07 /d01

 * Edit /etc/fstab in order to mount automatically at os boot-up.

  /dev/VolGroup00/LogVol07 /d01                    ext3    defaults        1 2

4. pvdisplay, lvdisplay, vgdisplay, fdisk -l

 You can understand the status volume using these commands.

 pvdisplay -- Phisical Volume
 lvdisplay -- Logical Volume
 vgdisplay -- Volume Group

5. EMC Power Management

 If you are using EMC SAN Disk Storage, the following command is useful.

# powermt display dev=all