Jump to Navigation

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 :

# umount /home

------- Need to do e2fsck first.

# e2fsck -f /dev/VolGroup00/LogVOl05

------- If you want to make it to 2G space.

# resize2fs -p /dev/VolGroup00/LogVol05 2G
# lvreduce -L 2G /dev/VolGroup00/LogVol05

# e2fsck -f /dev/VolGroup00/LogVol05

# resize2fs -p /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

6. Remove logical volume

# lvs

# lvremove /dev/vg_oradev3/lv_home

5. pvdisplay, lvdisplay, vgdisplay, fdisk -l

 You can understand the status volume using these commands.

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

6. EMC Power Management

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

# powermt display dev=all



Main menu 2

Story | by Dr. Radut