Friday, May 14, 2010

Create LVM Logical Volume Manager using fdisk pvcreate vgcreate Linux-rhcl5 command

Create 3 partitions for implementing LVM using fdisk command.
First go the hard disk
#fdisk /dev/hda
Press n to create the 3 new partitions each of 100Mb in size.
Press p to see the print partition table.
Press t to change the partition id of all the three partitions created by you to 8e (Linux LVM).
8e represent as the Linux LVM Files system. So create LVM.
Press wq to save and exit from fdisk utility in linux.
Use fdisk -l to list the partition table.
Create LVM using Pvcreate command
# pvcreate /dev/hda6 /dev/hda7 /dev/hda8
# pvdisplay
#vgcreate /dev/vg0 /dev/hda6 /dev/hda7 /dev/hda8
#vgdisplay vg
#lvcreate -L +10M -n lv0 /dev/vg0
-L is used to define Logical Volume size.
-n is used to define the name.
By using mkfs command create ext3 file system
#mkfs.ext3 /dev/vg0/lv0
#lvdisplay /dev/vg0/lv0
#mkdir disk
#mount /dev/vg0/lv0 /mnt
#df -h disk
Extend Volume
#lvextend -L +10M /dev/vg0/lv0
#ext2online /dev/vg0/lv0
#df -h disk
#umount disk
#vgchange -an /dev/vg0 (optional) -a control the availability of the logical volume in the volume group for input and output.
video
#lvremove /dev/vgo/lvo
Press y to continue
#lvdisplay
#vgremove /dev/vg0
#vgdisplay
#pvremove /dev/hda6 /dev/hda7 /dev/hda8
#pvdisplay
Successfully created Logical Volume Manager
See the step by step Video for creating LVM using fdisk pvcreate vgcreate 
LVM Reduce Extended

0 comments:

Flag counter

free counters