SES by degreeadvantage.com

Saturday, March 8, 2008

LVM

Logical Volume manager

LVM is an extensible partitioning tool using which we can modify or resize any partition without changing our existing data.

/dev/hdax

Figure

/dev/hdax

In order to create LV ( logical volume) we need to create a partition.

#fdisk /dev/had

Press( m for Help): n

l : logical

p : Physical

Type ‘l’

First Cylinder : Press Enter

Last Cylinder (+sizeM or +sizeK) : +100M

Command : t : t for change the type

Partition no : x : x is the number of partititon

Type : 8e : 8e for LVM

Command : w

#partprobe

Now we create a Physical Volume (PV)

#pvcreate /dev/hda8

Display the PV Information

#pvdisplay

Now we create Volume group

#vgcreate Vg00 /dev/hda8

Display the Vg information

#vgdisplay

Finally we create a logical volume

#lvcreate –n lv00 –L+50M vg00

Where

-n : logical name

-L: size

Display the LV information

#lvdisplay

After creating the logical volume, we need to format

#mkfs.ext3 /dev/vg00/lv00

Finally we mount it on /lvm

#mkdir /lvm

#mount /dev/vg00/lv00 /lvm

Extending the size of LVM

#lvextend –L+50M /dev/vg00/lv00

After adding we need to run ext2online command in order to assign file system type to the added size

#ext2online /dev/vg00/lv00

Reducing the size of LVM

#lvreduce –L-20M /dev/vg00/lv00

If the size of the logical volume is full and we need more space to store data we need to create new partition , change its type to LVM by ‘8e’ then create the physical volume and add that with volume group (vg00)

#vgextend vg00 /dev/hda9

After that extend the size of logical volume

In order to delete the logical volume

#umount /lvm

#lvremove /dev/vg00/lv00

#vgremove vg00

#pvremove /dev/hda9

#pvremove /dev/hda8

Then finally using the fdisk remove hda8 and hda9

No comments:

 
Free Search Engine Submission thanks to: Create a Website