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
linux manual tools
Viewed 3367 times since Fri, Sep 28, 2018
Fedora 32: Simple Local File-Sharing with Samba CIFS Linux
Viewed 9370 times since Sun, Dec 6, 2020
RHEL: Change system’s hostname
Viewed 4131 times since Sun, May 27, 2018
How setting the TZ environment variable avoids thousands of system calls
Viewed 10717 times since Mon, May 21, 2018
Linux Linux Network Statistics Tools / Commands
Viewed 9729 times since Mon, Sep 21, 2020
Improve security with polyinstantiation
Viewed 14030 times since Fri, May 15, 2020
A tcpdump Tutorial and Primer with Examples
Viewed 6183 times since Sun, Jun 17, 2018
10 Linux rsync Examples to Exclude Files/Directories
Viewed 11527 times since Wed, Oct 31, 2018
CentOS / RHEL : How to move a Volume Group from one system to another
Viewed 4310 times since Mon, Jan 28, 2019
logrotate How log rotation works with logrotate
Viewed 9556 times since Sun, Jan 12, 2020