Recover boot_archive with Solaris Volume Manager

October 13th, 2009 | by | solaris

Oct
13

After booting in failsafe mode, Solaris wan’t mount automaticly your root filesystem. Sun recommend to break the mirror and boot directly on one side of the mirror.

If found this method can cause more problems then solving the initial problem. For that reason, I found it easier to mount the meta directly.

Here is the steps you should perform:

  • Boot in failsafe mode if you are using a new-boot kernel: boot -F failsafe
  • Mount one side of the mirror in read-only: mount -o ro /dev/dsk/c0t0d0s0 /a
  • Copy the file /a/kernel/drv/md.conf to /kernel/drv/md.conf
  • Reload the kernel module: update_drv -f md
  • Initialize SVM: metainit -r
  • Re-sync the mirror if needed: metasync -r
  • fsck the meta if you want
  • Mount the meta: mount /dev/md/dsk/d0 /a
  • Update the boot archive: bootadm update-archive -R /a
  • Umount the root filesystem
  • Reboot

Here is an example session:

Executing last command: boot -F failsafe
Boot device: /pci@1f,0/pci@1/scsi@8/disk@1,0:a  File and args: -F failsafe
SunOS Release 5.10 Version Generic_141444-09 64-bit
Copyright 1983-2009 Sun Microsystems, Inc.  All rights reserved.
Use is subject to license terms.
Configuring devices.
Searching for installed OS instances...
/dev/dsk/c0t0d0s0 is under md control, skipping.
To manually recover the boot archive on a root mirror, please refer
to procedure written in this section of the Solaris Administration Guide.
        How to Manually Update the Boot Archive on a RAID-1 (Mirror) Volume
The section is located at URL :

http://docs.sun.com/app/docs/doc/817-1985/ghgnq?a=view

SUNW,eri0 : 100 Mbps full duplex link up
SUNW,eri1 : 100 Mbps full duplex link up
/dev/dsk/c0t1d0s0 is under md control, skipping.
To manually recover the boot archive on a root mirror, please refer
to procedure written in this section of the Solaris Administration Guide.
        How to Manually Update the Boot Archive on a RAID-1 (Mirror) Volume
The section is located at URL :

http://docs.sun.com/app/docs/doc/817-1985/ghgnq?a=view

No installed OS instance found.

Starting shell.
# mount -o ro /dev/dsk/c0t0d0s0 /a
# cp /a/kernel/drv/md.conf /kernel/drv/md.conf
# umount /a
# update_drv -f md
devfsadm: mkdir failed for /dev 0x1ed: Read-only file system
# metainit -r
# metastat -c
d5               m  2.8GB d25 (maint) d15 (maint)
    d25          s  2.8GB c0t1d0s5
    d15          s  2.8GB c0t0d0s5
d4               m  3.0GB d24 (maint) d14 (maint)
    d24          s  3.0GB c0t1d0s4
    d14          s  3.0GB c0t0d0s4
d1               m  2.0GB d21 (maint) d11 (maint)
    d21          s  2.0GB c0t1d0s1
    d11          s  2.0GB c0t0d0s1
d0               m  9.0GB d20 (maint) d10 (maint)
    d20          s  9.0GB c0t1d0s0
    d10          s  9.0GB c0t0d0s0
# metasync -r
# metastat -c
d5               m  2.8GB d25 d15
    d25          s  2.8GB c0t1d0s5
    d15          s  2.8GB c0t0d0s5
d4               m  3.0GB d24 d14
    d24          s  3.0GB c0t1d0s4
    d14          s  3.0GB c0t0d0s4
d1               m  2.0GB d21 d11
    d21          s  2.0GB c0t1d0s1
    d11          s  2.0GB c0t0d0s1
d0               m  9.0GB d20 d10
    d20          s  9.0GB c0t1d0s0
    d10          s  9.0GB c0t0d0s0
# fsck /dev/md/rdsk/d0
** /dev/md/rdsk/d0
** Last Mounted on /
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3a - Check Connectivity
** Phase 3b - Verify Shadows/ACLs
** Phase 4 - Check Reference Counts
** Phase 5 - Check Cylinder Groups
74831 files, 2955971 used, 6329329 free (3377 frags, 790744 blocks, 0.0% fragmentation)
# mount /dev/md/dsk/d0 /a
# bootadm update-archive -R /a
Creating boot_archive for /a
updating /a/platform/sun4u/boot_archive
15+0 records in
15+0 records out
# umount /a
# init 6

The system is being restarted.
# syncing file systems... done
rebooting...

Authored by

12 Responses to “Recover boot_archive with Solaris Volume Manager”

Show / Hide Comments
  1. [...] recover this problem you can check my post about recover Solaris under [...]

  2. dav says:

    At least our Solaris is rebooting with a simple kernel file which takes no consideration of the multiple last patchs sessions since it has been intalled ? The level of the kernel running now is equal to the kernel from the base update solaris installation and it is not representative to the patch level we would to reach.

  3. gdoucet says:

    If you mean LiveUpgrade, you need to make sure you boot on the right disk device.
    If no device is after the “boot” command, OBP will take the variable boot-device as the boot device.

    Make sure you specify the right boot device when booting if you don’t want to use the default one. For example:

    boot disk1 -F failsafe

    or

    boot /pci@1f,0/pci@1/scsi@8/disk@1,0:a -F failsafe
  4. dav says:

    After the boot archive recovering is complete i mean our kernel system drivers is now to the same level than it was after the systeme has been installed. ( it s not representative with patching between the install day et the recovering complete procedure ) :) hope i m explaining correctly this time

  5. Dave says:

    you are a LEGEND !!! repeat LEGEND !!!!

  6. Richard says:

    Great post. The steps worked perfectly. You saved my ass!

  7. Andy says:

    Detailed step by step instruction that really work. Thank you

  8. I have seen wonderful websites and I have seen not so wonderful sites. This website is very informationrmative in many ways and certainloy ranks in the former category. Really appreciate the info your providing use avid scaners!

  9. hanif says:

    The system is being restarted.
    syncing file systems… done
    rebooting…
    Resetting…

    SPARC Enterprise T5120, No Keyboard
    Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
    OpenBoot 4.30.8.a, 16256 MB memory available, Serial #94776688.
    Ethernet address 0:21:28:a6:2d:70, Host ID: 85a62d70.

    Boot device: disk File and args:

    Can’t open kernel/sparcv9/unix

    Warning: Fcode sequence resulted in a net stack depth change of 1
    Evaluating:

    Evaluating:
    The file just loaded does not appear to be executable.

  10. hanif says:

    The system is being restarted.
    syncing file systems… done
    rebooting…
    Resetting…

    SPARC Enterprise T5120, No Keyboard
    Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
    OpenBoot 4.30.8.a, 16256 MB memory available, Serial #94776688.
    Ethernet address 0:21:28:a6:2d:70, Host ID: 85a62d70.

    Boot device: disk File and args:

    Can’t open kernel/sparcv9/unix

    Warning: Fcode sequence resulted in a net stack depth change of 1
    Evaluating:

    Evaluating:
    The file just loaded does not appear to be executable.

    mine not working

  11. gdoucet says:

    Hum.. It not loading the kernel, so it is not a the point it is loading the boot archive.

    Looks you are booting on the wrong disk that Solaris is not install are you are booting on a bad disk. If you have a mirror disk, try booting on the other disk.

Leave a Comment