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
Jak wygenerować silne hasła jednorazowe w Linuksie?
Viewed 2973 times since Thu, May 24, 2018
Linux: how to monitor the nofile limit
Viewed 11673 times since Wed, Jul 25, 2018
RHCS: Install a two-node basic cluster
Viewed 11340 times since Sun, Jun 3, 2018
How to sort IP addresses in Linux
Viewed 4431 times since Sun, May 20, 2018
RHEL: Rename a network interface on RHEL 7
Viewed 11714 times since Sat, Jun 2, 2018
How do I add ethtool settings to a network device permanently?
Viewed 7600 times since Mon, May 21, 2018
List DNS records, nameservers of a domain from command line
Viewed 2636 times since Sun, Sep 30, 2018
Linux: Disks diagnostic using smartctl
Viewed 16031 times since Wed, Jul 25, 2018
How to automate SSH login with password? ssh autologin
Viewed 3512 times since Fri, Jun 8, 2018
SPRAWDZONA KONFIGURACJA RSYSLOG I LOGROTATE, JAKO ZEWNĘTRZNEGO SERWERA SYSLOG
Viewed 4647 times since Fri, Nov 30, 2018