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
Securing /tmp and shm partitions
Viewed 1157 times since Fri, May 15, 2020
Set Up SSH Tunneling on a Linux / Unix / BSD Server To Bypass NAT
Viewed 10205 times since Fri, May 15, 2020
SSH ProxyCommand example: Going through one host to reach another server
Viewed 10007 times since Tue, Aug 6, 2019
Watchdog script to keep an application running
Viewed 11759 times since Tue, Jul 31, 2018
LUKS List available methods of encryption for LUKS
Viewed 1011 times since Fri, Jul 13, 2018
Top 25 Best Linux Performance Monitoring and Debugging Tools
Viewed 4120 times since Sun, Sep 30, 2018
www.unixarena.com
Viewed 1133 times since Fri, Jul 27, 2018
How to encrypt a partition using LUKS?
Viewed 917 times since Fri, Jul 13, 2018
How to deal with dmesg timestamps
Viewed 1246 times since Wed, Oct 3, 2018
Tropienie pożeracza dysku
Viewed 1238 times since Thu, May 24, 2018