Solaris Tips: Repairing the Boot Archive (ZT)

http://www.seedsofgenius.net/solaris/solaris-tips-repairing-the-boot-archive

注意以下是系统盘非镜像情况下的操作,如果系统盘有镜像,需要先拆除镜像再按以下操作。

The Solaris boot archive, introduced in Solaris 10 10/08 (update 6) on SPARC (it’s in the X86 version since the 1/06 release), is similar to the initrd in Linux. It is “a collection of core kernel modules and configuration files packed in either UFS or ISOFS format.”

The boot archive is managed by two services:

svc:/system/boot-archive:default
svc:/system/boot-archive-update:default

The first checks, during boot, the contents of the boot archive against the files in the root filesystem. If there are any inconsistencies, the service drops to maintenance mode, preventing a full boot. While this can often be ignored, it may be necessary to re-create the boot archive from scratch (see below).

The second service updates the boot archive during a graceful shutdown or reboot, ensuring it is consistent with the equivalent files in the root filesystem for the next boot. A sudden or non-graceful shutdown is likely to leave the boot archive out of sync, resulting in the boot-archive service dropping to maintenance mode on the next boot.

If the contents of the boot archive do not match the files on the root filesystem, the following warning is displayed:

WARNING: The following files in / differ from the boot archive:

…along with a list of culprit files. If the list is empty, there may be some other problem, but in most cases, the archive simply needs to be updated. You can try ignoring the issue with the command # svcadm  clear boot-archive and on next shutdown the archive will be updated automatically, but the best way to deal with this issue is to recreate the boot archive while booted from alternate media; either from Failsafe mode, cd/dvd media, or a network image in single user mode.

ok boot -F failsafe
ok boot cdrom -s
ok boot net -s

1) Mount the root filesystem if it is not mounted already

# mount /dev/dsk/c0t0d0s0 /a

2) Remove the old archive (important, since simply updating the archive may not be sufficient for successful boot)

# rm -f /a/platform/`uname -i`/boot_archive

3) Finally, recreate it

# /usr/sbin/bootadm -R /a update-archive

4) Reboot

# init 6

posted @ 2013-08-05 10:04  生命的力量在于不顺从  阅读(441)  评论(0编辑  收藏  举报