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 System Administration Tasks: HP 9000 > Chapter 7 Mirroring Data Using LVM

Mirroring Tasks that Must Be Performed Using HP-UX Commands

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Index

Certain mirroring tasks cannot be performed by SAM. For the tasks described below, you will have to use the appropriate HP-UX commands.

Moving a Mirrored Logical Volume from One Disk to Another

Suppose you have a mirrored logical volume (/dev/vg01/lvol4). The mirror copy is on a disk you want to remove from the system (/dev/dsk/c7t0d0). There is room on another disk (/dev/dsk/c5t0d0) in the same volume group for the mirror copy.

You can move a logical volume's mirror copy from one disk to another by using pvmove(1M).

To move the copy, you issue the following command:

pvmove -n /dev/vg01/lvol4 /dev/dsk/c7t0d0 /dev/dsk/c5t0d0

Synchronizing a Mirrored Logical Volume

At times, the data in your mirrored copy or copies of a logical volume can become out of sync, or "stale". For example, this might happen if LVM cannot access a disk as a result of disk power failure. Under such circumstances, in order for each mirrored copy to re-establish identical data, synchronization must occur. Usually, synchronization occurs automatically, although there are times when it must be done manually.

Automatic Synchronization

If you activate a volume group that is not currently active, either automatically at boot time or later with the vgchange command, LVM automatically synchronizes the mirrored copies of all logical volumes, replacing data in physical extents marked as stale with data from non-stale extents. Otherwise, no automatic synchronization occurs and manual synchronization is necessary.

LVM also automatically synchronizes mirrored data in the following cases:

  • When a disk comes back online after experiencing a power failure.

  • When you extend a logical volume by increasing the number of mirror copies, the newly added physical extents will be synchronized.

Manual Synchronization

If you look at the status of a logical volume using lvdisplay -v, you can see if the logical volume contains any stale data. You can then identify which disk contains the stale physical extents. You manually synchronize the data in one or more logical volumes using either the lvsync command or all logical volumes in one or more volume groups using the the vgsync command. See lvdisplay(1M), vgsync(1M) , and lvsync(1M) for more information.

When Replacing a Disk

In the event you need to replace a non-functional mirrored disk, you should perform the following steps to ensure that the data on the replacement disk are both synchronized and valid:

  1. Run vgcfgbackup to save the volume group configuration information, if necessary. (See "Running vgcfgbackup" in Chapter 3 for more information.)

  2. Remove the disk from the volume group using vgreduce. (Optional)

  3. Physically disconnect the bad disk and connect the replacement.

  4. Run vgcfgrestore to restore LVM configuration information to the added disk.

  5. Run vgchange -a y to reactivate the volume group to which the disk belongs. Since the volume group is already currently active, no automatic synchronization occurs.

  6. Now run vgsync to manually synchronize all the extents in the volume group.

Consult the HP-UX Reference for additional information on any of the above commands.

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