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
20 Linux Command Tips and Tricks That Will Save You A Lot of Time linux
Viewed 4280 times since Thu, Apr 18, 2019
CentOS / RHEL : How to move a Volume Group from one system to another
Viewed 3014 times since Mon, Jan 28, 2019
Linux Proxy Server Settings – Set Proxy For Command Line
Viewed 2660 times since Mon, Feb 18, 2019
OCFS2 Cluster File System Setup Guide in Linux
Viewed 6616 times since Sat, Jun 2, 2018
tcpdump usage examples
Viewed 2045 times since Fri, Jul 27, 2018
20 Linux YUM (Yellowdog Updater, Modified) Commands for Package Management YUM
Viewed 10996 times since Thu, Oct 25, 2018
Need to set up yum repository for locally-mounted DVD on Red Hat Enterprise Linux 7
Viewed 2723 times since Mon, Oct 29, 2018
RHEL: Change system’s hostname
Viewed 3039 times since Sun, May 27, 2018
CentOS / RHEL : Configure yum automatic updates with yum-cron service
Viewed 3297 times since Fri, Oct 26, 2018
Linux RedHat How To Create An RPM Package
Viewed 2770 times since Sun, Jan 9, 2022