1 => Install package for LVM
#apt-get install lvm2
Or
#yum install lvm2
2 => Create physical partition
#pvcreate /dev/sdb1 /dev/sdb2
3 => Create volume Group
#vgcreate VG0 /dev/sdb1 or #vgcreate VG0 /dev/sdb1 /dev/sda3
#vgchange -a y VG0
4 => Create Logical Volumes
#lvcreate -l 100%FREE -n LV001 VG0 #mkfs.ext4 /dev/VG0/LV001
5 => Mount Partition Permanently
#vim /etc/fstab
/dev/VG0/LV001 /opt ext3 defaults 0 0
#Save file and run below command to check
#mount -a
TO add New harddisk or New Partation in LVM 1 => Check current size of LVM
#lvdisplay
2 => Check Current physical partition
#pvdisplay
3 => fdisk -l pvcreate /dev/sdd1 pvcreate /dev/sdc1 pvdisplay vgdisplay vgextend VG0 /dev/sdc1 vgdisplay vgextend VG0 /dev/sde1 vgdisplay lvdisplay lvextend -l +100%FREE /dev/mapper/VG0-LV001 resize2fs /dev/mapper/VG0-LV001 lvdisplay df -h
Resourceful material........
ReplyDelete