Adding a Disk and Extending a Logical Volume
From Peter Pap's Technowiki
So you have a logical volume that has run out of space and you need to add more. Either it's a VM and you've added another disk file or it's a physical server and you've added another disk.
1. Check the current disk devices with the following commands:
# pvscan PV /dev/sdb1 VG data lvm2 [100.00 GiB / 0 free] PV /dev/sdc1 VG data lvm2 [100.00 GiB / 0 free] PV /dev/sda3 VG vg1 lvm2 [47.84 GiB / 17.59 GiB free] Total: 4 [247.83 GiB] / in use: 3 [247.83 GiB] / in no VG: 0 [0 ] # ls -al /dev/sd* brw-rw---- 1 root disk 8, 0 Jan 22 01:14 /dev/sda brw-rw---- 1 root disk 8, 1 Jan 22 01:14 /dev/sda1 brw-rw---- 1 root disk 8, 2 Jan 22 01:14 /dev/sda2 brw-rw---- 1 root disk 8, 3 Jan 22 01:14 /dev/sda3 brw-rw---- 1 root disk 8, 16 Jan 22 01:14 /dev/sdb brw-rw---- 1 root disk 8, 17 Jan 22 01:14 /dev/sdb1 brw-rw---- 1 root disk 8, 32 Jan 22 01:14 /dev/sdc brw-rw---- 1 root disk 8, 33 Jan 22 01:14 /dev/sdc1
2. Scan the scsi bus to find the new disk
List the host SCSI adapters
# ls /sys/class/scsi_host/ host0 host1 host2
Probe each host adapter
# echo "- - -" > /sys/class/scsi_host/host0/scan # echo "- - -" > /sys/class/scsi_host/host1/scan # echo "- - -" > /sys/class/scsi_host/host2/scan
3. Check to see if the new device is there
# pvscan PV /dev/sdb1 VG data lvm2 [100.00 GiB / 0 free] PV /dev/sdc1 VG data lvm2 [100.00 GiB / 0 free] PV /dev/sdd1 VG data lvm2 [100.00 GiB / 100.00 GiB free] PV /dev/sda3 VG vg1 lvm2 [47.84 GiB / 17.59 GiB free] Total: 4 [347.83 GiB] / in use: 4 [347.83 GiB] / in no VG: 0 [0 ]
# ls -al /dev/sd* brw-rw---- 1 root disk 8, 0 Jan 22 01:14 /dev/sda brw-rw---- 1 root disk 8, 1 Jan 22 01:14 /dev/sda1 brw-rw---- 1 root disk 8, 2 Jan 22 01:14 /dev/sda2 brw-rw---- 1 root disk 8, 3 Jan 22 01:14 /dev/sda3 brw-rw---- 1 root disk 8, 16 Jan 22 01:14 /dev/sdb brw-rw---- 1 root disk 8, 17 Jan 22 01:14 /dev/sdb1 brw-rw---- 1 root disk 8, 32 Jan 22 01:14 /dev/sdc brw-rw---- 1 root disk 8, 33 Jan 22 01:14 /dev/sdc1 brw-rw---- 1 root disk 8, 48 Jan 22 01:14 /dev/sdd