How to add a 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/LogVol01 ;for extending LogVol to 15GB
   lvextend -L+1G /dev/VolGroup00/LogVol01 ;for adding one more GB to Logical Volume LogVol01
   lvextend -l +100%FREE /dev/VolGroup00/LogVol01

Next you shall need to resize the filesystem.

   resize2fs -l /dev/VolGroup00/LogVol01

Thats it finished Njoy  🙂 !

2 Replies to “How to add a disk to LVM”

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.