Friday, January 4, 2013

Lvm creation in Redhat 6.3

Here we are going to create lvm for /dev/sdb (newly assigned partition)

# fdisk  /dev/sdb
Create physical partition as /dev/sdb1 from /dev/sdb/
Create Physical voilume:
# pvcreate /dev/sdb1
Create volume group and add the pv to VG :
# vgcreate /dev/mapper/vg_rsatest_disk2 /dev/sdb1
To display volume group information:
# vgdisplay
Create lvm using PE value :
# lvcreate -l 2434 /dev/mapper/vg_rsatest_disk2
Formatted the newly created lvm:
#mkfs.ext4 /dev/mapper/vg_rsatest_disk2-lvol0
Create new directory to mount lvm:
#mkdir -p  /data
Add the below line into /etc/fstab/
/dev/mapper/vg_rsatest_disk2-lvol0 /data         ext4    defaults        0 0
"lvol0"

No comments:

Post a Comment