Friday, January 21, 2011

Creating Filesystem for New Guest OS using LVM

To initialise a disk inside LVM
root@linux:~# pvcreate /dev/sda1
  Physical volume "/dev/sda1" successfully created


To add initialised disk to volume group :
root@linux:~# vgcreate xen /dev/sda1


To scan physical voulumes under LVM :
root@Linux:~# pvscan


To scan all Volume Groups under LVM:
root@Linux:~# vgscan


Now  to create a Logical Volume under Volume Group :
root@Linux:~# lvcreate -L2048 -nlinux-xen xen
  Logical volume "linux-xen" created



To scan all Logical Volumes :
root@Linux:~# lvscan
  ACTIVE '/dev/xen/linux-xen' [2,00 GB] inherit



Now create a File system
root@Linux:~# mkfs.ext3 /dev/xen/linux-xen



Now Mount :
root@Linux:~# mount
/dev/xen/linux-xen /mnt/data1/

Check for filesytem in df command
root@Linux:~# df | grep data1
     2,0G 68M 1,9G 4% /mnt/data1



No comments:

Post a Comment