Symantec logo

Mirroring an encapsulated root disk

VxVM allows you to 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.

 To mirror your root disk onto another disk

  1. Choose a disk that is at least as large as the existing root disk.
  2. If the selected disk is not already under VxVM control, use the vxdiskadd or vxdiskadm command, or the Veritas Enterprise Administrator (VEA) to add it to the bootdg disk group. Ensure that you specify the sliced format for the disk.
  3. Select menu item 6 (Mirror Volumes on a Disk) from the vxdiskadm main menu, or use the VEA to create a mirror of the root disk. (These automatically invoke the vxrootmir command if the mirroring operation is performed on the root disk.)

    Alternatively, to mirror only those file systems on the root disk that are required to boot the system, run the following command:

    # /etc/vx/bin/vxrootmir altboot_disk

    where altboot_disk is the disk media name of the mirror for the root disk. vxrootmir creates a mirror for rootvol (the volume for the root file system on an alternate disk). The alternate root disk is configured to enable booting from it if the primary root disk fails.

Defining root disk mirrors as bootable

Having created a root disk mirror, you can make it available for booting. The procedure differs between SPARC and x64 systems.

 To define a root disk mirror as bootable on a SPARC system

  1. Check that the EEPROM variable use-nvramrc? is set to true.

    Enter the following command at the boot prompt:

    ok printenv use-nvramrc?

    If the system is up and running, enter the following command:

    # eeprom use-nvramrc?

    If set to true, this allows the use of alternate boot disks. If use-nvramrc? is set to false, the system fails to boot from a devalias and displays an error message such as the following:

    Rebooting with command: boot vx-mirdisk

    Boot device: /pci@1f,4000/scsi@3/disk@0,0 File and args:

    vx-mirdisk

    boot: cannot open vx-mirdisk

    Enter filename [vx-mirdisk]:

  2. Set the value of use-nvramrc? to true.

    At the ok boot prompt, enter:

    ok setenv use-nvramrc? true

    If the system is up and running, use the following command:

    # eeprom use-nvramrc?=true

  3. Define an alternate boot disk by entering the following command at the ok boot prompt:

    ok nvramrc=devalias vx-altboot_disk

    where altboot_disk is the device name of an alternate disk from which the system can be booted.

    Alternatively, if the system is already up and running, enter the following command to define an alternate boot disk:

    # eeprom nvramrc=devalias vx-altboot_disk

  4. Use the devalias command at the boot prompt to discover the alternate disks from which the system may be booted:

    ok devalias

    Suitable mirrors of the root disk are listed with names of the form vx-diskname.

  5. You should now be able to boot the system from an alternate boot disk, vx-altboot_disk, by entering the following command at the ok boot prompt:

    ok boot vx-altboot_disk

    If a selected disk contains a root mirror that is stale, vxconfigd displays an error stating that the mirror is unusable and lists any non-stale alternate bootable disks.

 To define a root disk mirror as bootable on an x64 system

  1. Boot the system into the failsafe OS from the GRUB boot menu or from the Solaris installation disc.
  2. Mount the root file system from the root disk mirror (this is usually on slice s0) on a suitable mount point, such as /a:

    # mount /dev/dsk/altboot_disk_root_slice /a

  3. List the device that corresponds to the root file system on the root disk mirror:

    # ls -l /dev/rdsk/altboot_disk_root_slice

    Make a note of the PROM path for the root disk mirror that is displayed, such as /pci@0,0/pci1022,7450@2/pci1000,3060@3/sd@3,0:a.

  4. Edit the boot environment configuration file, /a/boot/solaris/bootenv.rc, and change the line that defines the boot path so that it points to the PROM path of the root disk mirror, for example:

    bootpath=/pci@0,0/pci1022,7450@2/pci1000,3060@3/sd@3,0:a

  5. Update the EEPROM information:

    # bootadm update-archive -R /a

  6. Edit the GRUB configuration file, /boot/grub/menu.lst, and look for the entry for the primary root disk, for example:

    title Solaris 10 6/06 s10x_u2wos_09a X86 (primary)

    root (hd0,0,a)

    kernel /platform/i86pc/multiboot

    module /platform/i86pc/boot_archive

  7. Create a similar entry to allow the root disk mirror to be booted, for example:

    title Solaris 10 6/06 s10x_u2wos_09a X86 (alternate)

    root (hd1,0,a)

    kernel /platform/i86pc/multiboot

    module /platform/i86pc/boot_archive

  8. Copy the modified GRUB configuration file to the mounted root disk mirror:

    # cp /boot/grub/menu.lst /a/boot/grub/menu.lst

  9. On rebooting the system, the GRUB menu should allow you to boot from the the primary root disk or from a root disk mirror.

On x64 systems, the boot disk device is usually designated as hd0 by GRUB as it is the first disk to be discovered by the operating system. The alternate boot disk usually corresponds to hd1. If you change the boot order to boot from the alternate boot disk, the new boot disk becomes hd0, and the old boot disk becomes hd1.