Logical volume Manager

1st we will create create partition called PV (Physical Volume)

IMP:– Patition type of this PV should be 8e (u can chage through fdisk than press t)

Now prepare new partition for LVM

#pvcreate /dev/hda10 /dev/hda11 /dev/hda12

Revert this last action for training purposes

#pvremove /dev/hda10 /dev/hda11 /dev/hda12

To see current state of PV


Now create Volume group (vg)

#vgcreate raman /dev/hda10 /dev/hda11 /dev/hda12

Behind the scenes, the LVM system allocates storage in equal-sized “chunks”, called extents. We can specify the particular extent size to use at volume group creation time. The size of an extent defaults to 4Mb, which is perfect for most uses.You can use the -s flag to change the size of the extent. The extent affects the minimum size of changes which can be made to a logical volume in the volume group, and the maximum size of logical and physical volumes in the volume group. A logical volume can contain at most 65534 extents, so the default extent size (4 MB) limits the volume to about 256 GB; a size of 1 TB would require extents of atleast 16 MB. So to accomodate a 1 TB size, the above command can be rewriten as :

# vgcreate -s 16M my_vol_grp /dev/hda1 /dev/hda2

To see current state of VG


Now create LV (logical volume)

#lvcreate -L 500M -n raman1 raman

(-L logical size, -n Logical vol name)

To see current state of VG



#mkfs.ext3 /dev/raman/raman1

#mount /dev/raman/raman1 /data

do not forget to append the corresponding line in the /etc/fstab

/dev/raman/raman1 /data ext3 defaults 0 0

For Extend LV

#lvextend -L 275M /dev/raman/raman1

#ext2online /dev/raman/raman1

#df -h (for check)

  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: