Adding a Disk and Extending a Logical Volume

From Peter Pap's Technowiki
Revision as of 03:22, 22 January 2015 by Ppapa (talk | contribs)

Jump to: navigation, search

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 eash host adapter

 # echo "- - -" > /sys/class/scsi_host/host0/scan
 # echo "- - -" > /sys/class/scsi_host/host1/scan
 # echo "- - -" > /sys/class/scsi_host/host2/scan

3.