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
How to manage Linux password expiry with the chage command
Viewed 12177 times since Tue, Sep 11, 2018
How log rotation works with logrotate
Viewed 5906 times since Fri, Nov 30, 2018
How to configure an SSH proxy server with Squid
Viewed 4461 times since Sun, Dec 6, 2020
Linux ssh Hide OpenSSH Version Banner
Viewed 58466 times since Wed, Apr 22, 2020
20 Linux YUM (Yellowdog Updater, Modified) Commands for Package Management YUM
Viewed 12199 times since Thu, Oct 25, 2018
RHEL: Create a local RPM repository
Viewed 12529 times since Sun, May 27, 2018
Set Up SSH Tunneling on a Linux / Unix / BSD Server To Bypass NAT
Viewed 12229 times since Fri, May 15, 2020
Prosty skaner portów TCP w bash
Viewed 4065 times since Thu, May 24, 2018
How to convert RAW image to VDI and otherwise
Viewed 16157 times since Wed, Oct 3, 2018
YUM CRON RHEL7: Configure automatic updates.
Viewed 2717 times since Fri, Oct 26, 2018