跳过导航链接 | |
退出打印视图 | |
Oracle Solaris 管理:常见任务 Oracle Solaris 11 Information Library (简体中文) |
bootadm 命令可处理引导归档文件更新和验证的细节。在系统正常关机过程中,关机过程会将引导归档文件的内容与根文件系统进行比较。如果系统具有更新(如驱动程序或配置文件),则引导归档文件将重建为包括这些更改,以便在重新引导后,引导归档文件和根文件系统可以同步。
x86 引导归档文件中的文件位于 /platform/i86pc/amd64/boot_archive 目录中。
SPARC 引导归档文件中的文件位于 /platform 目录中。
要使用 bootadm list-archive 命令列出引导归档文件的内容,请执行以下命令:
# bootadm list-archive
只要更新了引导归档文件中的任何文件,就必须重建该归档文件。为使修改生效,必须在重新引导系统之前重建归档文件。
如果 boot-archive 服务处于禁用状态,则在重新引导系统时可能不会自动恢复引导归档文件。因此,引导归档文件可能无法保持同步或被损坏,从而阻止系统进行引导。
要确定 boot-archive 服务是否正在运行,请使用 svcs 命令,如下所示:
$ svcs boot-archive STATE STIME FMRI online Mar_31 svc:/system/boot-archive:default
要启用或禁用 boot-archive 服务,请键入:
# svcadm enable | disable system/boot-archive
要检验 boot-archive 服务的状态,请键入:
# svcs boot-archive
如果该服务正在运行,则输出会显示服务处于联机状态。
在引导系统过程中,如果显示类似以下内容的警告消息,请按照相应的步骤操作:
WARNING: Automatic update of the boot archive failed. Update the archives using 'bootadm update-archive' command and then reboot the system from the same device that was previously booted.
以下过程介绍如何使用 bootadm 命令手动更新过时的引导归档文件。
注 - 也可以使用相同的过程手动更新引导归档文件。
# bootadm update-archive
注 - 要更新备用根上的引导归档文件,请键入以下命令:
# bootadm update-archive -R /a
指定要应用于 update-archive 子命令的备用 root 路径。
# reboot
x86 平台上的引导归档文件恢复是通过快速重新引导功能自动完成的。但是,在引导系统过程中,如果显示类似以下内容的警告:
WARNING: Reboot required. The system has updated the cache of files (boot archive) that is used during the early boot sequence. To avoid booting and running the system with the previously out-of-sync version of these files, reboot the system from the same device that was previously booted.
然后系统进入系统维护模式。结果是,引导归档文件的自动更新将失败。要更正此问题,请执行以下过程中的步骤。
# reboot
# svccfg -s svc:/system/boot-config:default setprop config/auto-reboot-safe = true
# svccfg -s svc:/system/boot-config:default listprop |grep config/auto-reboot-safe config/auto-reboot-safe boolean true