Saturday, 28 December 2013

How extend and reduce the size in LVM partion in Red Hat Linux (part2)

Hello Friends I am Deepak Saini And Today we Are discus the LVM extending or reducing
Lets Start
If you are not know about the lvm them read from here

Some Instructions Before extending and reducing
1 We are only able to extend size from the only the volume group which is the parent of the logical volume only.We are not able to extending szie from other volume froup

2 And same in the reducing When we are reduce the size of the logical volume that size is extending in the volume group.

3 IN the case our volume group free space is compltely full then we are create a new partion and the again recall the process of PV or VG  then we are able to extend the spcae in our group


How we extend  a LVM partion 
0 we are umount the vg or lv from /mnt/myvg like this where you mount the volume
syntax :- umount <mounting path where you mount>


1 we are using the lvextand command to extand size in LV
syntax :- lvextand -L <size > <dev/mapper/<vg name -lv name >

Now we are going to merge or resize our partion
 syntax:- resize2fs /dev/mapper/<vg name-lv name > <size >
size is the size how much you extend

How to reduce the size of a LVM partion
1 We are umount the LV 1st
 syntax:- umount /mnt/<Dir name >
in this the dir name is the name where you mount the logical volume

2 then we are like defragment  the our partion
syntax:- e2fsck -f /dev/mapper/<vg name -lv name >

Now we are going to resize the partion
 syntax:- resize2fs /dev/mapper/vg name-lv name> <size>
Here  size is the size hiw you reduce

4 Then we are reduce the size of LV partion
syntax:- lvreduce -L <size > /dev/mapper/<vg name -lv name>

5 Then we are again defragment the data on lv partion again
syntax:- e2fsk -f /dev/mapper/<vg name -lv name>

6 Then we are remount the our LV partion
syntax:- mount /dev/mapper/<vg name - lv name> /mnt/<dir name>

 Thanks for reading And Sorry for My RIP english _/\_ Jai hind

0 comments:

Post a Comment