As I mentioned in the recent Linux LVM post, there are two ways to prepare the physical volume (PV)
- the entire disk as a PV (not recommended)
 - or creating a partition on the disk and the partition as a PV.
 
The step to extend a LVM volume are different on these two configuration.
Extend a LVM when the entire disk as a PV
- Increase the VM’s hard disk size in vSphere Client  
- If there is a VM snapshot on the disk, its size cannot be changed. Remove all the snapshots first
 - After increasing the disk size, take a snapshot as the backup
 
 - Rescan the SCSI bus to verify the OS see the new space on the disk  
- ls /sys/class/scsi_host/
 - echo “- - -“ > /sys/class/scsci_host/<host_name>/scan
 - tail -f /var/log/message
 - or
 - ls /sys/class/scsi_disk/
 - each ‘1’ > /sys/class/scsi_disk/<0\:0\:0\:0>/device/rescan
 - tail -f /var/log/message
 - fdisk -l
 
 - Resize the PV
 - Verify the VG automatically sees the new space
 - Extend the LV
 - Resize the file system
 - Remove the VM snapshot once confirming the data intact
 
No comments:
Post a Comment