• Aucun résultat trouvé

Recovering an Ivmtab File - Using vgscan

Dans le document Solving HP-UX Problems (Page 187-191)

been destroyed or corrupted, the proper activation of volume groups and disks cannot occur.

Although it is sometimes hard to know when /etc/lvmtab has disappeared or has been corrupted, the following things might indicate that this has happened:

• Messages indicating that a volume group or disk that you know is present for matches between the volume group device files, the logical volume device files, and the disks.

Here are some important things to consider when you run vgscan:

• Run vgscan as soon as you realize the / etc/l vmtab has been damaged or scans the disks that it can read for LVM configuration information. This is not an absolutely critical item, unless the disks that are off line will be needed to establish a quorum in a volume group. If a disk is not online when you run vgscan, its information will not be included in the new lvmtab file.

When you return the disk to the volume group, the LVM commands that you use to do so will update /etc/lvmtab for you.

8-50 Logical Volume Manager (LVM) Problems

• Run vgscan with the -p and -v options first. The -p option allows you to preview how the new / etc/l vmtab file will be constructed, but does not create it. The -v option lets you view any message vgscan generates during the preview. Previewing what vgscan will do, allows you to look for missing disks or problems in your / dev directory before creating the lvmtab file.

Once you are confident that / etc/l vmtab will be built with the correct disks and volume groups, you can run vgscan without using the preview option, which will build the lvmtab file for you.

If vgscan finds disks that it cannot match with a volume group, or finds volume groups for which disks cannot be found, it instructs you to run vgimport to record the correct volume group and disk information in the /etc/lvmtab file. (See "Reconfiguring Disks in a Volume Group (Adjusting /etc/lvmtab)" for examples and a discussion about running vgimport.)

Logical Volume Manager (LVM) Problems 8-51

8

8

Reconfiguring Disks in a Volume Group (Adjusting /etc/lvmtab) There are occasions when you might need to:

• Move the disks in a volume group to different hardware locations on a system .

• Move entire volume groups of LVM disks from one system to another.

When you do either of the above tasks, the LVM configuration file,

/ etc/l vmtab, must change to reflect the new hardware locations and device files for the disks.

The file / etc/l vmtab maintains information about all LVM disks in the system on a volume group basis. You cannot edit this file directly, since it is not a text file. Instead, you can use the /etc/vgexport and the /etc/vgimport commands to reconfigure the volume groups and record the configuration changes in the /etc/lvmtab file.

Moving a Volume Group's Disks

The procedure for moving the disks in a volume group to different hardware locations or different systems is illustrated in the following example.

8·52 Logical Volume Manager (LVM) Problems

Importing and Exporting Volume Groups

Suppose you want to move the three disks in the volume group /dev/vg_planning to another Series 800 computer.

1. Make the volume group unavailable.

vgchange -a n /dev/vg_planning

2. Use vgexport(lM) to remove the volume group information from the

/ etc/l vmtab file. You can first preview the actions of vgexport with the -p option.

vgexport -p -v -m plan_map vg_planning

With the -m option, you can specify a map file to hold the information that is removed from the /etc/lvmtab file. This file is important because it contains the names of all logical volumes in the volume group.

Later, you can use the mapfile when you set up the volume group on the new system.

If the preview is satisfactory, run the command without -po vgexport -v -m plan_map vg_planning

When vgexport runs, it removes the device files for the disks in the volume group, removes the vg_planning information from the / etc/l vmtab file, and creates the mapfile plan_map.

Once the /etc/lvmtab file no longer has the vg_planning volume group configured, you can shut down the system, disconnect the disks, and reinstall the disks on the new system. Transfer the file plan_map to the / directory on the new system.

3. Add the disks to the new system.

Once you have the disks installed on the new system, note their new L U numbers so you can refer to the device files created for them. Suppose, for our example, the new L U numbers are 6, 7, and 8.

Logical Volume Manager (LVM) Problems 8-53

8

4. On the new system, create a new volume group directory and group file.

These steps are required for an imported volume group just as they are required for creating a new volume group (see "Creating a Volume Group"

earlier in this chapter).

cd /

mkdir dev/vg_planning cd dev/vg_planning

When you create the group file, specify a minor number that reflects the volume group number. (Volume group numbering starts at 0; the volume group number for the fifth volume group, for example, is 04.)

mknod /dev/vg_planning/group c 64 Ox040000

5. Now, issue the vgimport command. To preview, use the -p option.

vgimport -p -v -m plan-map /dev/vg_planning /dev/dsk/c6dOs2 /dev/dsk/c7dOs2 /dev/dsk/c8dOs2

To actually import the volume group, re-issue the command omitting the -p.

6. Finally, activate the newly imported volume group:

vgchange -a y /dev/vg_planning

Dans le document Solving HP-UX Problems (Page 187-191)