NAME [Toc] [Back]
vgreduce - remove physical volumes from an LVM volume group
SYNOPSIS [Toc] [Back]
/usr/sbin/vgreduce [-A autobackup] vg_name pv_path ...
/usr/sbin/vgreduce [-A autobackup] [-l] vg_name pv_path
/usr/sbin/vgreduce [-A autobackup] [-f] vg_name
Remarks [Toc] [Back]
vgreduce cannot be performed if the volume group is activated in shared
DESCRIPTION [Toc] [Back]
The vgreduce command removes each physical volume specified by a
pv_path argument from volume group vg_name.
The vgreduce command with -f option removes all missing physical
volume from the volume group.
All but one physical volume can be removed. The last physical volume
must remain in the volume group so that the logical volume driver can
continue to operate. The last physical volume in the volume group can
be removed with the vgremove command (see vgremove(1M)).
Before executing vgreduce, remove all logical volumes residing on each
physical volume represented by a pv_path by executing lvremove (see
Any physical volume in the pv_path list that is also a member of a
physical volume group (as defined in /etc/lvmpvg) is also removed from
the physical volume group. If the physical volume happens to be the
last one in the physical volume group, the physical volume group is
also removed from the volume group.
When a physical volume in the pv_path list has multiple PV-links, the
physical volume is not removed from the volume group, until all the
links to the volume are removed. When a physical volume in the
pv_path list is the primary link (in use) to a physical volume,
removing the link forces LVM to switch to the alternate link to access
the physical volume. When the pv_path removed is an alternate link to
the device, only the link is removed; the volume group and physical
volume are otherwise unchanged.
Options and Arguments [Toc] [Back]
vgreduce recognizes the following options and arguments:
-A autobackup Set automatic backup for this invocation of this
command. autobackup can have one of the following
Hewlett-Packard Company - 1 - HP-UX 11i Version 2: August 2003
y Automatically back up configuration changes
made to the volume group. This is the
After this command executes, the vgcfgbackup
command (see vgcfgbackup(1M)) is executed for
the volume group.
n Do not back up configuration changes this
-f vg_name force reduction of missing physical volume(s) in a
given volume group. This option does not require
a physical volume (PV) to be supplied on the
command line. vgreduce obtains the name of each
physical volume (PV) belonging to the volume group
from the file /etc/lvmtab. It then reads the LVM
structures from each PV and compares these with
that held by the kernel to work out which PVs are
missing. PVs which are missing will be candidates
for removal. If all the physical extents on the
missing PV are free then it will be removed from
the volume group. Otherwise vgreduce will report
the physical to logical extent mapping. For
missing PVs, which have extents in use, you must
free up all the extents by using lvreduce(1M) or
lvremove(1M) and re-run vgreduce with the -f
option. This option is most commonly used when
the vgdisplay(1M) command shows "Cur PV" higher
than "Act PV" and all of the PVs belonging to the
volume group are attached. This option only works
on PVs and not on links.
-l pv_path This option removes the specified pv_path/s from
the lvmtab file. This task will only be performed
if the pv_path is currently marked as missing from
the volume group. This option was mainly designed
for the problem where the vgscan or the vgimport
command place too many links beyond the max limit
allowed in the lvmtab file. Currently the max
limit is 8 paths to a PV (7 alternates and one
primary). In this situation invoking the command
without the -f option will not resolve the
condition because the path is not attached to the
volume group. Similarly the condition would not
be overcome by invoking with the -f option as this
works on PVs rather than links.
pv_path The block device path name of a physical volume.
Hewlett-Packard Company - 2 - HP-UX 11i Version 2: August 2003
vg_name The path name of the volume group.
EXTERNAL INFLUENCES [Toc] [Back]
LANG determines the language in which messages are displayed.
If LANG is not specified or is null, it defaults to "C" (see lang(5)).
If any internationalization variable contains an invalid setting, all
internationalization variables default to "C" (see environ(5)).
EXAMPLES [Toc] [Back]
Remove physical volume /dev/dsk/c0t1d0 from volume group /dev/vg01:
vgreduce /dev/vg01 /dev/dsk/c0t1d0
Force reduction of missing PVs from volume group: vg01
vgreduce -f /dev/vg01
Removes the physical volume from the volume group when it is still in
the lvmtab file, but it is currently marked as missing from the volume
vgreduce -l /dev/vg01
The following messages will appear after missing PVS has been removed
PV with key 0 successfully deleted from vg /dev/vg01
Repair done, please do the following steps.....:
1. Save /etc/lvmtab to another file.
2. Remove /etc/lvmtab.
3. Use vgscan -v to recreate /etc/lvmtab.
4. NOW use vgcfgbackup(1M) to save the LVM setup.
SEE ALSO [Toc] [Back]
vgchange(1M), vgcreate(1M), vgdisplay(1M), vgextend(1M).
Hewlett-Packard Company - 3 - HP-UX 11i Version 2: August 2003 [ Back ]