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
Learn how to align an SSD on Linux
Viewed 9230 times since Fri, May 15, 2020
Fake A Hollywood Hacker Screen in Linux Terminal linux FUN
Viewed 2285 times since Thu, Apr 18, 2019
Inxi – A Powerful Feature-Rich Commandline System Information Tool for Linux
Viewed 17651 times since Sat, Jun 2, 2018
Linux Add a Swap File – HowTo
Viewed 8817 times since Fri, Jun 8, 2018
20 Linux YUM (Yellowdog Updater, Modified) Commands for Package Management YUM
Viewed 9811 times since Thu, Oct 25, 2018
HowTo: Create CSR using OpenSSL Without Prompt (Non-Interactive)
Viewed 11546 times since Mon, Feb 18, 2019
stunnel Securing telnet connections with stunnel
Viewed 332 times since Sun, Dec 6, 2020
Installing and Configuring stunnel on CentOS 6
Viewed 1920 times since Fri, Sep 28, 2018
INSTALACJA MIB SNMP W SYSTEMIE CENTOS/RHEL 6
Viewed 10238 times since Fri, Nov 30, 2018
high swap space utilization in LINUX
Viewed 4878 times since Fri, Jul 13, 2018