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
PROCESSOR AND MEMORY INFORMATION
Viewed 5402 times since Sat, Jun 2, 2018
debian How to check Debian CVE status using python script
Viewed 3388 times since Sun, Sep 23, 2018
Modifying the inode count for an ext2/ext3/ext4 file system
Viewed 14604 times since Fri, Sep 18, 2020
What UUIDs can do for you
Viewed 1639 times since Tue, Jul 17, 2018
RHEL: Display swap/RAM size
Viewed 3079 times since Sat, Jun 2, 2018
Zabijanie wszystkich procesów użytkownika
Viewed 2494 times since Thu, May 24, 2018
Creating SWAP partition using FDISK & FALLOCATE commands
Viewed 3020 times since Thu, Jan 16, 2020
Linux Chage Command to Set Password Aging for User
Viewed 2195 times since Tue, Sep 11, 2018
How to stop and disable auditd on RHEL 7
Viewed 39106 times since Tue, Aug 6, 2019
RHEL: Back-up/Replicate a partition table
Viewed 3144 times since Sun, May 27, 2018