Pages

Showing posts with label lvm. Show all posts
Showing posts with label lvm. Show all posts

Tuesday, September 13, 2011

add disk to lvm


Suppose the Disk is /dev/sdb, the second scsi disk,

  fdisk /dev/sdb
  create as many partitions as you need using command n
  Label them with command t as 8e for making it Linux LVM
  Write and Exit with the command w.

Format the partitions you require using mkfs command

  mkfs -t ext3 -c /dev/sdb1

LVM commands

  pvcreate /dev/sdb1
  vgextend VolGroup00 /dev/sdb1
  lvextend -L 15G /dev/VolGroup00/LogVol00 ;for extending LogVol to 15GB
  lvextend -L+1G /dev/VolGroup00/LogVol00 ;for adding one more GB to Logical Volume LogVol01
  resize2fs /dev/VolGroup00/LogVol00 ;for resizing the Logical Volumes

To increase the storage capacity while keeping the server online, add the disk and then rescan scsi:  

echo "- - -" > /sys/class/scsi_host/host0/scan