LVM: Reduce an existing Volume Group by removing one of its disks
Article Number: 178 | Rating: Unrated | Last Updated: Sat, Jun 2, 2018 10:36 PM
LVM: Reduce an existing Volume Group by removing one of its disks
# Tested on RHEL 5, 6 & 7
VG=testvg # Check disks owned by volume group vgdisplay -v $VG | grep "PV Name" PV Name /dev/sde1 PV Name /dev/sde2 PV Name /dev/sde3 PV Name /dev/sde4 <--- # Remove desired disk from VG (Verify first disk is not in use) DISK=/dev/sde4 pvdisplay $DISK | egrep "Total|Free" Total PE 129 <--- Total Physical Extents Free PE 129 <--- Free Physical Extents # Disk is not being used (no PE in use) so we can remove it from volume group vgreduce $VG $DISK # Check vgdisplay -v $VG | grep "PV Name" PV Name /dev/sde1 PV Name /dev/sde2 PV Name /dev/sde3 # We can remove ALL empty (no physical extents in use) disks from VG by running 'vgreduce' # command with '-a' option: vgreduce -a $VG |