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
CentOS / RHEL : How to move a Volume Group from one system to another
Viewed 3684 times since Mon, Jan 28, 2019
ZPOOL: Verify/change properties of a zpool
Viewed 2165 times since Sun, Jun 3, 2018
How To: Linux Hard Disk Encryption With LUKS [ cryptsetup Command ]
Viewed 7405 times since Fri, Jul 13, 2018
How to create a Systemd service in Linux
Viewed 3026 times since Mon, Dec 7, 2020
ZFS: Remove an existing zfs filesystem
Viewed 2194 times since Sun, Jun 3, 2018
Linux - How to get Memory information
Viewed 1997 times since Fri, Jun 8, 2018
Linux: how to monitor the nofile limit
Viewed 10754 times since Wed, Jul 25, 2018
How to sort IP addresses in Linux
Viewed 3684 times since Sun, May 20, 2018
How to disable SSH cipher/ MAC algorithms for Linux and Unix
Viewed 47158 times since Fri, Aug 21, 2020
Tips to Solve Linux & Unix Systems Hard Disk Problems
Viewed 4230 times since Fri, May 15, 2020