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
logrotate - rotates, compresses, and mails system logs.
Viewed 1658 times since Fri, Nov 30, 2018
How To Create a Linux Swap File
Viewed 2359 times since Fri, Jun 8, 2018
LVM: Mount LVM Partition(s) in Rescue Mode
Viewed 4712 times since Sat, Jun 2, 2018
Index » Community Contributions » System encryption using LUKS and GPG encrypted keys for arch linux
Viewed 3031 times since Fri, Jul 13, 2018
18 Quick ‘lsof’ command examples for Linux Geeks
Viewed 11440 times since Sun, Jun 30, 2019
Inxi: Find System And Hardware Information On Linux
Viewed 2197 times since Sat, Jun 2, 2018
Installing and Configuring stunnel on CentOS 6
Viewed 4003 times since Fri, Sep 28, 2018
RHEL: XFS basic operations
Viewed 15875 times since Sat, Jun 2, 2018
linux ssh How to Hide the OpenSSH Version Details when Telnet to Port 22
Viewed 4626 times since Wed, Apr 22, 2020
RHEL: How to rebuild and/or patch a RPM package
Viewed 8533 times since Sat, Jun 2, 2018