Monday, August 29, 2011

Booting from an alternate boot disk

Booting from an alternate boot disk 

If the root disk is encapsulated and mirrored, you can use one of its mirrors to boot the system if the primary boot disk fails.

On a Sun SPARCR system, booting from an alternate boot disk requires EEPROM settings to be changed.
See The boot process on SPARC systems
On a Sun x64 system, the alternate boot disk can be added to the GRUB boot menu, or the bootpath can be redefined in the EEPROM without changing the GRUB configuration.
See The boot process on 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.
To change the EEPROM bootpath on an x64 system
  1. If the system will not boot from the primary root disk, and a suitable alternate root disk mirror is not shown in the GRUB menu, 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. The system should now be bootable from the new device that is defined by bootpath. Perform a reconfiguration reboot:
    # reboot -- -rv

 

No comments:

Post a Comment