Encapsulating and mirroring the root disk

VxVM lets you mirror the root volume and other areas needed for booting onto another disk. This makes it possible to recover from failure of your root disk by replacing it with one of its mirrors.

Use the fdisk or sfdisk commands to obtain a printout of the root disk partition table before you encapsulate the root disk. For more information, see the appropriate manual pages. You may need this information should you subsequently need to recreate the original root disk.

See the Storage Foundation and High Availability Solutions Troubleshooting Guide.

You can use the vxdiskadm command to encapsulate the root disk.

You can also use the vxencap command, as shown in this example where the root disk is sda:

# vxencap -c -g diskgroup rootdisk=sda

where diskgroup must be the name of the current boot disk group. If no boot disk group currently exists, one is created with the specified name. The name bootdg is reserved as an alias for the name of the boot disk group, and cannot be used. You must reboot the system for the changes to take effect.

Both the vxdiskadm and vxencap procedures for encapsulating the root disk also update the /etc/fstab file and the boot loader configuration file (/boot/grub/menu.lst or /etc/grub.conf (as appropriate for the platform) for GRUB or /etc/lilo.conf for LILO):

The contents of the original /etc/fstab and boot loader configuration files are saved in the files /etc/fstab.b4vxvm, /boot/grub/menu.lst.b4vxvm or /etc/grub.conf.b4vxvm for GRUB, and /etc/lilo.conf.b4vxvm for LILO.

Warning:

When modifying the /etc/fstab and the boot loader configuration files, take care not to corrupt the entries that have been added by VxVM. This can prevent your system from booting correctly.

To mirror the root disk onto another disk after encapsulation

  1. Choose a disk to use for the mirror that is at least as large as the existing root disk, whose geometry is seen by Linux to be the same as the existing root disk, and which is not already in use by VxVM or any other subsystem (such as a mounted partition or swap area). The disk should be visible to the Basic Input Output System (BIOS) and to the bootloader of the operating system.
  2. Select Mirror Volumes on a Disk from the vxdiskadm main menu to create a mirror of the root disk. (These automatically invoke the vxrootmir command if the mirroring operation is performed on the root disk.)

    The disk that is used for the root mirror must not be under Volume Manager control already.

  3. Alternatively, to mirror all file systems on the root disk, run the following command:
    # vxrootmir mirror_da_name
    			mirror_dm_name

    mirror_da_name is the disk access name of the disk that is to mirror the root disk, and mirror_dm_name is the disk media name that you want to assign to the mirror disk. The alternate root disk is configured to allow the system to be booted from it in the event that the primary root disk fails. For example, to mirror the root disk, sda, onto disk sdb, and give this the disk name rootmir, you would use the following command:

    # vxrootmir sdb rootmir

    The operations to set up the root disk mirror take some time to complete.

    The following is example output from the vxprint command after the root disk has been encapsulated and its mirror has been created (the TUTIL0 and PUTIL0 fields and the subdisk records are omitted for clarity):

    Disk group: rootdg
    
    TY NAME          ASSOC   KSTATE   LENGTH    PLOFFS   STATE ...
    dg rootdg        rootdg  -        -         -        - 
    
    dm rootdisk      sda     -        16450497  -        - 
    dm rootmir       sdb     -        16450497  -        - 
    
    v  rootvol       root    ENABLED  12337857  -        ACTIVE
    pl mirrootvol-01 rootvol ENABLED  12337857  -        ACTIVE
    pl rootvol-01    rootvol ENABLED  12337857  -        ACTIVE
    
    v  swapvol       swap    ENABLED  4112640   -        ACTIVE
    pl mirswapvol-01 swapvol ENABLED  4112640   -        ACTIVE
    pl swapvol-01    swapvol ENABLED  4112640   -        ACTIVE

More Information

Restrictions on using rootability with Linux

Encapsulating a disk