Tuesday, September 11, 2012

LV Creation RHEL

I just wanted to write some simple steps to create LVM on RHEL linux. trying to write steps by Steps creation. please do correct or add if found me wrong.

echo "- - -" >> /sys/class/scsi_host/host0/scan :- to detect the disk host0 can host1, host2 or so. the disk can be through scsi or fc. so class changes /sys/class/fc_host/host0/scan or so...

fdisk -l
vgs
vgscan
mounting of devices.
===========================

pvcreate /dev/sdb :- can be /dev/sdc or /dev/sdd or so
vgcreate myvg /dev/sdb :-  myvg is the name of your desired VG.
lvcreate -L -n my_lv /dev/sdb :- -L is to define the size, -n to define the name of Logical volume.
mke2fs /dev/sdb/myvg-my_lv :- it will resize the file system to mentioned size for writing on to it.
mkdir /mydata
mount /dev/myvg-my_lv /mydata :- mount the device on a mount point

put an entry in /etc/fstab so that server can find the LVs mounted after reboot too.


file system type if we are not able to find and we need to write the same in fstab entry then just after mounting the device temporarily. run command "df -hT" it will show the type of file system. 

No comments: