Previous  |  Next  >  
Product: Volume Manager Guides   
Manual: Volume Manager 4.1 Administrator's Guide   

Moving and Unrelocating Subdisks

When hot-relocation occurs, subdisks are relocated to spare disks and/or available free space within the disk group. The new subdisk locations may not provide the same performance or data layout that existed before hot-relocation took place. You can move the relocated subdisks (after hot-relocation is complete) to improve performance.

You can also move the relocated subdisks off the spare disks to keep the spare disk space free for future hot-relocation needs. Another reason for moving subdisks is to recreate the configuration that existed before hot-relocation occurred.

During hot-relocation, one of the electronic mail messages sent to root is shown in the following example:


To: root
Subject: Volume Manager failures on host teal
Attempting to relocate subdisk mydg02-03 from plex home-02.
Dev_offset 0 length 1164 dm_name mydg02 da_name c0t5d0.
The available plex home-01 will be used to recover the data.

This message has information about the subdisk before relocation and can be used to decide where to move the subdisk after relocation.

Here is an example message that shows the new location for the relocated subdisk:


To: root
Subject: Attempting VxVM relocation on host teal
Volume home Subdisk mydg02-03 relocated to mydg05-01,
but not yet recovered.

Before you move any relocated subdisks, fix or replace the disk that failed (as described in Removing and Replacing Disks). Once this is done, you can move a relocated subdisk back to the original disk as described in the following sections.


Caution  Caution    During subdisk move operations, RAID-5 volumes are not redundant.

Moving and Unrelocating Subdisks Using vxdiskadm

To move the hot-relocated subdisks back to the disk where they originally resided after the disk has been replaced following a failure, use the following procedure:

  1. Select menu item 14 (Unrelocate subdisks back to a disk) from the vxdiskadm main menu.
  2. This option prompts for the original disk media name first.

    Enter the disk media name where the hot-relocated subdisks originally resided at the following prompt:


      Enter the original disk name [<disk>,list,q,?]

    If there are no hot-relocated subdisks in the system, vxdiskadm displays Currently there are no hot-relocated disks, and asks you to press Return to continue.

  3. You are next asked if you want to move the subdisks to a destination disk other than the original disk.
    While unrelocating the subdisks, you can choose to move the
    subdisks to a different disk from the original disk.

      Unrelocate to a new disk [y,n,q,?] (default: n)
  4. If moving subdisks to their original offsets is not possible, you can choose to unrelocate the subdisks forcibly to the specified disk, but not necessarily to the same offsets.
    Use -f option to unrelocate the subdisks if moving to the exact
    offset fails? [y,n,q,?] (default: n)
  5. If you entered y at step 4 to unrelocate the subdisks forcibly, enter y or press Return at the following prompt to confirm the operation:
    Requested operation is to move all the subdisks which were
    hot-relocated from mydg10 back to mydg10 of disk group mydg.

      Continue with operation? [y,n,q,?] (default: y)

    A status message is displayed at the end of the operation.


      VxVM INFO V-5-2-954 Unrelocate to disk mydg10 is complete.

As an alternative to this procedure, use either the vxassist command or the vxunreloc command directly, as described in Moving and Unrelocating Subdisks Using vxassist and Moving and Unrelocating Subdisks Using vxunreloc.

Moving and Unrelocating Subdisks Using vxassist

You can use the vxassist command to move and unrelocate subdisks. For example, to move the relocated subdisks on mydg05 belonging to the volume home back to mydg02, enter the following command:


vxassist -g mydg move home !mydg05 mydg02

Here, !mydg05 specifies the current location of the subdisks, and mydg02 specifies where the subdisks should be relocated.

If the volume is enabled, subdisks within detached or disabled plexes, and detached log or RAID-5 subdisks, are moved without recovery of data.

If the volume is not enabled, subdisks within STALE or OFFLINE plexes, and stale log or RAID-5 subdisks, are moved without recovery. If there are other subdisks within a non-enabled volume that require moving, the relocation fails.

For enabled subdisks in enabled plexes within an enabled volume, data is moved to the new location, without loss of either availability or redundancy of the volume.

Moving and Unrelocating Subdisks Using vxunreloc

VxVM hot-relocation allows the system to automatically react to I/O failures on a redundant VxVM object at the subdisk level and then take necessary action to make the object available again. This mechanism detects I/O failures in a subdisk, relocates the subdisk, and recovers the plex associated with the subdisk. After the disk has been replaced, vxunreloc allows you to restore the system back to the configuration that existed before the disk failure. vxunreloc allows you to move the hot-relocated subdisks back onto a disk that was replaced due to a failure.

When vxunreloc is invoked, you must specify the disk media name where the hot-relocated subdisks originally resided. When vxunreloc moves the subdisks, it moves them to the original offsets. If you try to unrelocate to a disk that is smaller than the original disk that failed,vxunreloc does nothing except return an error.

vxunreloc provides an option to move the subdisks to a different disk from where they were originally relocated. It also provides an option to unrelocate subdisks to a different offset as long as the destination disk is large enough to accommodate all the subdisks.

If vxunreloc cannot replace the subdisks back to the same original offsets, a force option is available that allows you to move the subdisks to a specified disk without using the original offsets. Refer to the vxunreloc(1M) manual page for more information.

The examples in the following sections demonstrate the use of vxunreloc.

Moving Hot-Relocated Subdisks back to their Original Disk

Assume that mydg01 failed and all the subdisks were relocated. After mydg01 is replaced, vxunreloc can be used to move all the hot-relocated subdisks back to mydg01.


vxunreloc -g mydg mydg01 

Moving Hot-Relocated Subdisks to a Different Disk

The vxunreloc utility provides the -n option to move the subdisks to a different disk from where they were originally relocated.

Assume that mydg01 failed, and that all of the subdisks that resided on it were hot-relocated to other disks. vxunreloc provides an option to move the subdisks to a different disk from where they were originally relocated. After the disk is repaired, it is added back to the disk group using a different name, e.g, mydg05. If you want to move all the hot-relocated subdisks back to the new disk, the following command can be used:


vxunreloc -g mydg -n mydg05 mydg01

The destination disk should have at least as much storage capacity as was in use on the original disk. If there is not enough space, the unrelocate operation will fail and none of the subdisks will be moved.

Forcing Hot-Relocated Subdisks to Accept Different Offsets

By default, vxunreloc attempts to move hot-relocated subdisks to their original offsets. However, vxunreloc fails if any subdisks already occupy part or all of the area on the destination disk. In such a case, you have two choices:

  • Move the existing subdisks somewhere else, and then re-run vxunreloc.
  • Use the -f option provided by vxunreloc to move the subdisks to the destination disk, but leave it to vxunreloc to find the space on the disk. As long as the destination disk is large enough so that the region of the disk for storing subdisks can accommodate all subdisks, all the hot-relocated subdisks will be unrelocated without using the original offsets.

Assume that mydg01 failed and the subdisks were relocated and that you want to move the hot-relocated subdisks to mydg05 where some subdisks already reside. You can use the force option to move the hot-relocated subdisks to mydg05, but not to the exact offsets:


vxunreloc -g mydg -f -n mydg05 mydg01

Examining Which Subdisks Were Hot-Relocated from a Disk

If a subdisk was hot relocated more than once due to multiple disk failures, it can still be unrelocated back to its original location. For instance, if mydg01 failed and a subdisk named mydg01-01 was moved to mydg02, and then mydg02 experienced disk failure, all of the subdisks residing on it, including the one which was hot-relocated to it, will be moved again. When mydg02 was replaced, a vxunreloc operation for mydg02 will do nothing to the hot-relocated subdisk mydg01-01. However, a replacement of mydg01 followed by a vxunreloc operation, moves mydg01-01 back to mydg01 if vxunreloc is run immediately after the replacement.

After the disk that experienced the failure is fixed or replaced, vxunreloc can be used to move all the hot-relocated subdisks back to the disk. When a subdisk is hot-relocated, its original disk-media name and the offset into the disk, are saved in the configuration database. When a subdisk is moved back to the original disk or to a new disk using vxunreloc, the information is erased. The original disk-media name and the original offset are saved in the subdisk records. To print all of the subdisks that were hot-relocated from mydg01 in the mydg disk group, use the following command:


vxprint -g mydg -se 'sd_orig_dmname="mydg01"'

Restarting vxunreloc After Errors

vxunreloc moves subdisks in three phases:

  1. vxunreloc creates as many subdisks on the specified destination disk as there are subdisks to be unrelocated. The string UNRELOC is placed in the comment field of each subdisk record.

    Creating the subdisk is an all-or-nothing operation. If vxunreloc cannot create all the subdisks successfully, none are created, and vxunreloc exits.

  2. vxunreloc moves the data from each subdisk to the corresponding newly created subdisk on the destination disk.
  3. When all subdisk data moves have been completed successfully, vxunreloc sets the comment field to the null string for each subdisk on the destination disk whose comment field is currently set to UNRELOC.

The comment fields of all the subdisks on the destination disk remain marked as UNRELOC until phase 3 completes. If its execution is interrupted, vxunreloc can subsequently re-use subdisks that it created on the destination disk during a previous execution, but it does not use any data that was moved to the destination disk.

If a subdisk data move fails, vxunreloc displays an error message and exits. Determine the problem that caused the move to fail, and fix it before re-executing vxunreloc.

If the system goes down after the new subdisks are created on the destination disk, but before all the data has been moved, re-execute vxunreloc when the system has been rebooted.


Caution  Caution    Do not modify the string UNRELOC in the comment field of a subdisk record.
 ^ Return to Top Previous  |  Next  >  
Product: Volume Manager Guides  
Manual: Volume Manager 4.1 Administrator's Guide  
VERITAS Software Corporation
www.veritas.com