1. create disk from hard drive
fdisk /dev/sdd
create two disk with 8e(logic volumn disk)
then their name will be sdd5 and sdd6
 
2. pvcreate /dev/sdd5
   vgcreate vg1 /dev/sdd5
  lvcreate -n lv -L +100M vg1
now there will be a new disk can be used under /dev/vg1/lv
but need to format it first
mke2fs -j /dev/vg1/lv
 
now edit /etc/fstab to mount it automatically
/dev/vg1/lv   /lv   ext3 defaults 0 0
mount -a
 
now use df -h to check it
umount /lv
 
3. now we are going to add another 100M to this disk
pvcreate /dev/sdd6
vgextend vg1 /dev/sdd6
lvextend -L +100M /dev/vg1/lv
resize2fs /dev/vg1/lv
e2fsck -f /dev/vg1/lv
resize2fs /dev/vg1/lv
 
mount -a
 
4. check
df -h
lvdisplay
 
 
Advertisements