Saturday, 8 September 2018

LVM

LOGICAL VOLUME

LVM:- It is a tool for logical volume management which includes allocating disks,striping,mirroring and resizing logical volumes.

With LVM, a hard drive or set of hard drives is allocated to one or more physical volumes .LVM physical volumes can be placed on other block devices which might span two or more disks.

The physical volumes are combined into logical volumes with the exception of the /boot/partition. The /boot/ partition cannot read it.If the root (/) partition is on the logical volume, create a separate /boot/ partition which is not a part of the volume group.

Physical Volume:- A physical volume (PV) is another name for a regular physical disk partition that is used or will be used by LVM.

Volume Group:- Any number of physical volumes (PVs) on different disk drives can be added together into a volume group (VG).

Logical Volume:- Volume Groups must then be subdivided into logical volumes. Each logical volumes can be individually formatted as if it were a regular linux partition. A logical volume is therefore, like a virtual partition on your virtual disk drive.



#fdisk -l
#pvdisplay  (To see the physical volume)

First create the partition of individual disk then create physical volume.
Suppose you partitioned 30 GB from sdb1,sdc1,sdd1 then you can create physical volume.

# pvcreate /dev/sdb1 /dev/sdbc1 /dev/sdd1
pvcreated

#pvdisplay (It will display the pv created)

#vgcreate /dev/myvggroup /dev/sdb1 /dev/sdd1
vgcreated

#vgdisplay (It will display the vg created)

#lvcreate --name test1(Name of LV) --size 40G /dev/myvggroup

#lvdisplay (It will display the lv created)

#mkfs.ext4 /dev/myvggroup/test1

#mkdir /mylv (Make folder where you want to mount your LV)

#mount /dev/myvggroup/test1 /mylv

#cd /mylv/

#mkdir abcd
#touch 1 2 3 4


0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home