Removing Physical Volumes From A Volume Group - Red Hat ENTERPRISE LINUX 5 - LOGICAL VOLUME MANAGER ADMINISTRATION Manual

Hide thumbs Also See for ENTERPRISE LINUX 5 - LOGICAL VOLUME MANAGER ADMINISTRATION:
Table of Contents

Advertisement

You can define a filter in the lvm.conf file to restrict the scan to avoid specific devices. For
information on using filters to control which devices are scanned, see
Device Scans with
Filters".
The following example shows the output of a vgscan command.
# vgscan
Reading all physical volumes.
Found volume group "new_vg" using metadata type lvm2
Found volume group "officevg" using metadata type lvm2

4.3.6. Removing Physical Volumes from a Volume Group

To remove unused physical volumes from a volume group, use the vgreduce command. The
vgreduce command shrinks a volume group's capacity by removing one or more empty physical
volumes. This frees those physical volumes to be used in different volume groups or to be removed
from the system.
Before removing a physical volume from a volume group, you can make sure that the physical volume
is not used by any logical volumes by using the pvdisplay command.
# pvdisplay /dev/hda1
-- Physical volume ---
PV Name
VG Name
PV Size
PV#
PV Status
Allocatable
Cur LV
PE Size (KByte)
Total PE
Free PE
Allocated PE
PV UUID
If the physical volume is still being used you will have to migrate the data to another physical volume
using the pvmove command. Then use the vgreduce command to remove the physical volume:
The following command removes the physical volume /dev/hda1 from the volume group
my_volume_group.
# vgreduce my_volume_group /dev/hda1
Removing Physical Volumes from a Volume Group
This may take a while...
/dev/hda1
myvg
1.95 GB / NOT usable 4 MB [LVM: 122 KB]
1
available
yes (but full)
1
4096
499
0
499
Sd44tK-9IRw-SrMC-MOkn-76iP-iftz-OVSen7
Section 4.6, "Controlling LVM
27

Advertisement

Table of Contents
loading

Table of Contents