LVM: Reduce an existing Volume Group by removing one of its disks

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
0 (0)
Article Rating (No Votes)
Rate this article
Attachments
There are no attachments for this article.
Comments
There are no comments for this article. Be the first to post a comment.
Full Name
Email Address
Security Code Security Code
Related Articles RSS Feed
Kernel sysctl configuration file for Linux
Viewed 6586 times since Fri, Aug 3, 2018
How to create a Systemd service in Linux
Viewed 4135 times since Mon, Dec 7, 2020
UUIDs and Linux: Everything you ever need to know [Update]
Viewed 5881 times since Tue, Jul 17, 2018
How do I add ethtool settings to a network device permanently?
Viewed 7853 times since Mon, May 21, 2018
LVM: Mount LVM Partition(s) in Rescue Mode
Viewed 6435 times since Sat, Jun 2, 2018
How to encrypt a partition with DM-Crypt LUKS on Linux
Viewed 9182 times since Fri, Jul 13, 2018
LUKS List available methods of encryption for LUKS
Viewed 3816 times since Fri, Jul 13, 2018
Linux - How to monitor CPU usage
Viewed 7314 times since Fri, Jun 8, 2018
linux ssh Remotely Initiated Reverse SSH Tunnel
Viewed 4450 times since Wed, Apr 22, 2020
15 Linux Yum Command Examples – Install, Uninstall, Update Packages
Viewed 4694 times since Thu, Oct 25, 2018