Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX Reference > V

vgscan(1M)

HP-UX 11i Version 3: February 2007
» 

Technical documentation

» Feedback
Content starts here

 » Table of Contents

 » Index

NAME

vgscan — scan physical volumes for LVM volume groups

SYNOPSIS

/usr/sbin/vgscan [-p] [-v] [-a | -B | -k | -N] [-f vg_names...]

DESCRIPTION

The vgscan command is used as follows:

1.

Recovering and recreating the /etc/lvmtab file when the file has been deleted or does not match the current physical volumes.

2.

Reporting device special file lists for unconfigured volume groups.

For recovery, vgscan will add entries for volume groups that are missing from /etc/lvmtab. The vgscan command recovers volume group information by using LVM data structures in kernel memory, and by probing all devices, searching for LVM disks. If one or more physical volumes in the volume group has more than 8 paths, the vgscan command will only include 8 paths per physical volume. Additional path(s) will not be added in the /etc/lvmtab file. The volume group device special file (/dev/vg_name/group) must be present for recovery to succeed. In addition, vgscan will recover a missing volume group only if it has been activated at least once since the last boot, and the Volume Group ID is unique (see the WARNINGS section).

Unconfigured volume groups are volume groups residing on attached storage that are missing from /etc/lvmtab, and have not been activated since the last boot. The vgscan command cannot recover the /etc/lvmtab entries for these volume groups. Instead, it will print out the physical volume device special files for these volume groups. Configure these volume groups using the vgimport command. See vgimport(1M).

The vgscan command will not update existing volume group entries in /etc/lvmtab unless the -f option is used. The -f option can be used to overwrite existing volume group entries in /etc/lvmtab. Otherwise, /etc/lvmtab should be moved before running vgscan, in order for the options to take full effect.

In HP-UX 11i Version 3, the Mass Storage Stack supports two naming conventions for the device special files used to identify devices (see intro(7) and lvm(7)). Devices are represented as follows:

  • Persistent device special files, (/dev/disk/disk3).

  • Legacy device special files, (/dev/dsk/c0t6d6).

LVM supports the use of both conventions within the same volume group.

The vgscan command provides several options for controlling the use of legacy and persistent DSFs (device special files) during the /etc/lvmtab recovery. By default, vgscan will populate /etc/lvmtab with legacy DSFs, including alternate paths. There is one exception:

  • For activated volume groups that are using persistent DSFs, vgscan will populate /etc/lvmtab using persistent DSFs for those physical volumes. The -N and -B options allow the user to override this default behavior.

Options and Arguments

vgscan recognizes the following options and arguments:

-a

Scan all paths of multipathed physical volumes. The -a option cannot be used in conjunction with the -k, -B, and -N options and when the legacy naming model is disabled with the rmsf -L command (see rmsf(1M)).

-B

Populate /etc/lvmtab using both persistent and legacy DSFs. Persistent DSFs will be added before legacy DSFs, so they will be used as the primary path. This option can be used to migrate a deactivated volume group using legacy DSFs to use both persistent and legacy DSFs. The -B option cannot be used in conjunction with the -a, -k, and -N options and when the legacy naming model is disabled with the rmsf -L command (see rmsf(1M)).

-f vg_names

For the specified volume groups, force vgscan to replace any existing entries in /etc/lvmtab with updated entries. If the volume groups are missing from /etc/lvmtab, they are added. The -f option provides the following functions:

(1) Update incorrect, existing entries for activated volume groups. For example, a volume group may have been imported with only a partial set of devices. Or, a boot volume group may have been activated with persistent DSFs, while the existing entry in /etc/lvmtab has legacy DSFs.

(2) Migrate a deactivated volume group using legacy DSFs to use persistent DSFs, or vice-versa.

(3) Add volume group entries to the /etc/lvmtab file in the order specified on the command line. For example, this option can be used to put the boot volume group first in the /etc/lvmtab file.

With the -f option, vgscan will not search for additional volume groups and will not report unconfigured volume groups.

-k

Skip the disk probe portion of vgscan, and retrieve volume group information only from LVM data structures in kernel memory. The disk probe portion can be a time consuming operation, so this option can be used for faster recovery of /etc/lvmtab. However, with this option, only volume groups currently activated are added to /etc/lvmtab. For deactivated volume groups, no information is added to /etc/lvmtab. The -k option cannot be used in conjunction with the -a, -B, and -N options.

-N

Populate /etc/lvmtab using persistent DSFs, with the following exception:

If there are volume groups activated that are using legacy DSFs, then vgscan will populate /etc/lvmtab using legacy DSFs for those physical volumes.

The -N option cannot be used in conjunction with the -a, -k, and -B options.

-p

Preview the actions that would be taken but do not update /etc/lvmtab. This option is best used in conjunction with the -v option. As with other options, if the legacy naming model has been disabled with the rmsf -L command (see rmsf(1M)), the -N option should also be used with the -p option.

-v

Print verbose messages.

EXTERNAL INFLUENCES

Environment Variables

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

1.

Append entries for volume groups missing from the /etc/lvmtab file. For deactivated volume groups, use legacy DSFs, and for activated volume groups, use the DSFs that were used to activate them. Report all physical volume legacy DSFs belonging to unconfigured volume groups. Do not modify existing volume group entries in /etc/lvmtab. Run vgscan without any options:

vgscan

2.

Recreate the /etc/lvmtab file for volume groups activated since the last boot. For deactivated volume groups, use legacy DSFs, and for activated volume groups, use the DSFs that were used to activate them. Report all physical volume legacy DSFs belonging to unconfigured volume groups.

mv /etc/lvmtab /etc/lvmtab.BCK vgscan

3.

Recreate the /etc/lvmtab file for volume groups activated since the last boot. For deactivated volume groups, use persistent DSFs, and for activated volume groups, use the DSFs that were used to activate them. Report all physical volume persistent DSFs belonging to unconfigured volume groups.

mv /etc/lvmtab /etc/lvmtab.BCK vgscan -N

4.

Recreate the /etc/lvmtab file for volume groups activated since the last boot. For activated and deactivated volume groups, use both persistent and legacy DSFs. Report all physical volume persistent and legacy DSFs belonging to unconfigured volume groups.

mv /etc/lvmtab /etc/lvmtab.BCK vgscan -B

5.

Recreate the /etc/lvmtab file for activated volume groups, using the DSFs that were used to activate them. For deactivated volume groups, no entries are added to /etc/lvmtab, and no physical volume DSFs are reported.

mv /etc/lvmtab /etc/lvmtab.BCK vgscan -k

6.

For the volume group /dev/vg01, overwrite the existing physical volume DSFs in /etc/lvmtab with the physical volume persistent DSFs found belonging to /dev/vg01 during a hardware probing of all devices.

vgscan -N -f /dev/vg01

7.

For the volume group /dev/vg01, overwrite the existing physical volume DSFs in /etc/lvmtab with the physical volume DSFs used in kernel memory. The volume group /dev/vg01 must be activated, or this command will fail.

vgscan -k -f /dev/vg01

8.

Recreate the /etc/lvmtab file with the volume groups /dev/vg00, /dev/vg01, and /dev/vg02. The volume group entries will be added to /etc/lvmtab in that order. For deactivated volume groups, use legacy DSFs, and for activated volume groups, use the DSFs that were used to activate them. Do not add any other volume groups.

mv /etc/lvmtab /etc/lvmtab.BCK vgscan -f /dev/vg00 /dev/vg01 /dev/vg02

To preview the vgscan output for any of the above examples, include the -p and -v options in the command lines.

WARNINGS

The -N option may become obsolete in future releases.

The -B option may become obsolete in future releases.

For deactivated volume groups, vgscan cannot recover volume groups that do not have a unique Volume Group ID, that is, when two or more volume groups share the same ID. If this scenario occurs, the vgchgid command must be used to assign a unique Volume Group ID for each volume group. See vgchgid(1M).

After running vgscan the number and order of physical volumes in the reconstructed /etc/lvmtab file could be different than what was configured previously (even if the -f option is used). The results could be as follows:

  • The designated primary and alternate paths may not be the same as was configured before.

  • Alternate paths will be added to the /etc/lvmtab file even though they weren't initially configured in the volume group.

  • The boot information may be incorrect, due to changed order of device special files in the new /etc/lvmtab file.

Rectify the above problems as follows:

  • Run vgchange -a [y|e] to activate all deactivated volume groups. For shared volume groups, invoke vgchange -x -a e to activate the shared volume group in exclusive mode.

  • Invoke vgreduce to remove any unwanted alternate paths which were added to the /etc/lvmtab file as a result of the vgscan invocation.

  • For boot volume groups only, invoke lvlnboot -R to correct the boot information on the physical volumes.

  • If the original primary path of a physical volume is now configured as an alternate, the order can be reversed by using vgreduce to remove the primary path and then invoking vgextend to add it back.

The vgscan command will also print the following warning messages to notify the user of the above problems:

  • *** LVMTAB has been created successfully.

  • *** Do the following to resync information on disk.

  • *** #1. vgchange -a y

  • *** #2. lvlnboot -R

No more than 8 paths to any Physical Volume will be added to the /etc/lvmtab file. All other paths will be omitted.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1983-2007 Hewlett-Packard Development Company, L.P.