LVM (Logical Volume Manager) - LINUX

LVM (Logical Volume Manager) - LINUX

Image result for LVm linux
LVM (Logical Volume Manager)-
LVM is a tool for logical volume management which includes allocating disks, striping, mirroring and resizing logical volumes.
Lvmdiskscan —-for the scan disk or how many partition used in lvm or not
Also changed the type the partition 83 to 8e—for better use.
#pvcreate /dev/sdb /dev/sdc— Initialize the block devices
#pvs—    To check the physical volume
#vgcreate vg1 /dev/sdb1 /dev/sdc1—To create volume groupe
#lvcreate -L +1G -n lv1 vg1
#lvs 0r lvdisplay

lsblk — for the check lvm devices

Extending the Logical Volume size
Logical volumes can be increased on fly without unmounting the filesystem. Here we will see how to increase the linear filesystem and volume on Redhat Linux 6.

1.Check the volume group free space before proceeding to the volume expansion.
Extend the logical volume by 1G
#lvextend -L +1G /dev/vg1/lv1
#resize2fs /dev/vg1/lv1 —Increase the filesystem.
#df -Th –- to check the size

Reducing the Logical Volume size
Volumes can’t be reduced on the fly.To reduce the volume ,
  1. umount the filesystem
  2. Reduce the filesystem size
  3. Reduce the logical volume
  4. Mount the volume .

List he volume information.

unmount the filesystem
#umount /lvmdata
“resize2fs” required to check the filesystem consistency before reduce the FS.
#e2fsck -f /dev/vg1/lv1
Reduce the filesystem by 1G
#resize2fs /dev/vg1/lv1 1G
De-activate the volume.
#lvchange -an /dev/vg1/lv1
#lvreduce -L 1G /dev/vg1/lv1
Activate the volume and Mount it.
#lvchange -ay /dev/vg1/lv1
#mount -t ext4 /dev/vg1/lv1 /lvmdata
#df -h /lvmdata
Previous Post
Next Post
Related Posts