Basic LVM Commands

Since system_config_lvm was dropped from the repository for Fedora 19 and FC20, i needed some commands to extend my Logical volume.

fdisk -l    Shows the physical disk

pvdisplay   Show physical disk

vgdisplay    Show the volume groups

# vgremove fileserver     Remove the volume group fileserver:

lvdisplay     Show logical volumes

lvscan        Summary of logical volumes

vgremove   Drop a whole volume Group

create logical volumes share (40GB) in the volume group fileserver.

# lvcreate --name share --size 40G fileserver

rename our logical volume media into films:

# lvrename fileserver media films

We create the logical volume media

# lvcreate --name media --size 1G fileserver

Now let's enlarge media from 1GB to 1.5GB:

# lvextend -L1.5G /dev/fileserver/media

Unmount

# unmount /media

Check the filesystem for errors

e2fsck -f /dev/fileserver/media

Resize the filesystem to the size of the Logical volume

resize2fs /dev/fileserver/media

Mount

# mount /media

Shrink media to 1GB:

# lvreduce -L1G /dev/fileserver/media