引导和关闭 Oracle® Solaris 11.2 系统

退出打印视图

更新时间: 2014 年 7 月
 
 

如何以交互方式引导系统

如果由于原始文件损坏或系统未引导而需要在引导过程中指定备用内核或 /etc/system 文件,则以交互方式引导系统非常有用。使用以下过程以交互方式引导系统。

以下过程介绍了在仅有一个引导环境的系统的交互式引导过程中,如何指定备用 /etc/system 文件。或者,可以引导备用引导环境。

  1. 创建 /etc/systemboot/solaris/filelist.ramdisk 文件的备份副本,然后将 etc/system.bak 文件名添加到 /boot/solaris/filelist.ramdisk 文件。
    # cp /etc/system /etc/system.bak
    # cp /boot/solaris/filelist.ramdisk /boot/solaris/filelist.ramdisk.orig
    # echo "etc/system.bak" >> /boot/solaris/filelist.ramdisk
  2. 根据平台,执行以下操作之一:
    • 对于 SPARC 平台:
      1. 使系统进入 ok PROM 提示符下。
        # init 0
      2. 以交互方式引导系统。
        ok boot -a
    • 对于 x86 平台:
      1. 对系统执行标准重新引导。
        # reboot -p
      2. 显示 GRUB 菜单后,选择要以交互方式引导的引导项,然后键入 e 以编辑该项。
      3. $multiboot 行的末尾键入 –a
      4. 要退出 GRUB 编辑菜单并引导刚刚编辑的项,请按 Ctrl-X 组合键。如果您的系统具有 UEFI 固件且未使用串行控制台,则按 F10 键也会引导此项。
  3. 系统提示指定备用文件系统时,指定您创建的备份文件,然后按回车键。例如:
    Name of system file [etc/system]: /etc/system.bak

    在不提供任何信息的情况下按回车键将接受系统缺省设置。

  4. 在 Retire store 提示符下,按回车键或指定 /dev/null 绕过。

    注 - /etc/devices/retire_store 文件是故障管理体系结构 (Fault Management Architecture, FMA) 弃用的设备的后备存储。系统不再使用这些设备。如有必要,可以为 /etc/devices/retire_store 提供备用文件。但是,出于恢复的目的,指定 /dev/null 是引导系统(不考虑 /etc/devices/retire_store 文件的内容)的最佳选择。
  5. 引导系统后,更正 /etc/system 文件的问题。
  6. 重新引导系统。
    # reboot
示例 4-16  SPARC: 以交互方式引导系统

在以下示例中,接受了系统缺省值(显示在方括号 [] 中)。

# init 0
# svc.startd: The system is coming down.  Please wait.
svc.startd: 121 system services are now being stopped.
Apr 22 00:34:25 system-28 syslogd: going down on signal 15
svc.startd: Killing user processes.
umount: /home busy
Apr 22 06:34:37 The system is down.  Shutdown took 18 seconds.
syncing file systems... done
Program terminated
{11} ok boot -a

SC Alert: Host System has Reset

Sun Fire T200, No Keyboard
Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
OpenBoot 4.30.4.d, 16256 MB memory available, Serial #74139288.
Ethernet address 0:14:4f:6b:46:98, Host ID: 846b4698.

Boot device: /pci@780/pci@0/pci@9/scsi@0/disk@0,0:a  File and args: -a
Name of system file [/etc/system]:  /etc/system.bak
SunOS Release 5.11 Version 11.2 64-bit
Copyright (c) 1983, 2014, Oracle and/or its affiliates. All rights reserved.
Retire store [/etc/devices/retire_store] (/dev/null to bypass): Press Return


system-28 console login:
示例 4-17  x86: 以交互方式引导系统

在下面的示例中,以交互方式引导基于 x86 的系统。

root@system-04:~# reboot -p
Apr 23 15:37:04 system-04 reboot: initiated by user1 on /dev/consoleTerminated
system-04% syncing file systems... done
rebooting...
.
.
.LSI Corporation MPT SAS BIOS
MPTBIOS-6.26.00.00 (2008.10.14)
Copyright 2000-2008 LSI Corporation.

Initializing..|Press F2 to runS POPUP  (CTRL+P on Remote Keyboard)
Press F12 to boot from the network (CTRL+N on Remote Keyboard)
System Memory : 8.0 GB , Inc.
Auto-Detecting Pri Master..ATAPI CDROM                              0078
            Ultra DMA Mode-2 
GNU GRUB  version 1.99,5.11.0.175.1.0.0.14.0

 ****************************************************************************
 *Oracle Solaris 11.2                                                       *
 *                                                                          *
 *                                                                          *
 *                                                                          *
 *                                                                          *
 *                                                                          *
 *                                                                          *
 *                                                                          *
 *                                                                          *
 *                                                                          *
 *                                                                          *
 *                                                                          *
 *                                                                          *
 ****************************************************************************

      Use the * and * keys to select which entry is highlighted.
      Press enter to boot the selected OS, 'e' to edit the commands
      before booting or 'c' for a command-line.

 GNU GRUB  version 1.99,5.11.0.175.1.0.0.15.1

 +--------------------------------------------------------------------------+
 | setparams 'Oracle Solaris 11.2'                                          |
 |                                                                          |
 | insmod part_msdos                                                        |
 | insmod part_sunpc                                                        |
 | insmod part_gpt                                                          |
 | insmod zfs                                                               |
 | search --no-floppy --fs-uuid --set=root cd03199c4187a7d7                 |
 | zfs-bootfs /ROOT/s11u2/@/ zfs_bootfs                                     |
 | set kern=/platform/i86pc/kernel/amd64/unix                               |
 | echo -n "Loading ${root}/ROOT/s11u2/@$kern: "                            |
 | $multiboot /ROOT/s11u2/@/$kern $kern -B $zfs_bootfs -a                   |
 | set gfxpayload="1024x768x32;1024x768x16;800x600x16;640x480x16;640x480x1\ |
 +--------------------------------------------------------------------------+

      Minimum Emacs-like screen editing is supported. TAB lists
      completions. Press Ctrl-x or F10 to boot, Ctrl-c or F2 for
      a command-line or ESC to discard edits and return to the GRUB menu.

 Booting a command list

Loading hd0,msdos1,sunpc1/ROOT/s11u2/@/platform/i86pc/kernel/amd64/unix: 0
%...done.
Loading hd0,msdos1,sunpc1/ROOT/s11u2/@/platform/i86pc/amd64/boot_archive:
0%...
.
.
.
Name of system file [/etc/system]:  /etc/system.bak
SunOS Release 5.11 Version 11.s 64-bit
Copyright (c) 1983, 2014, Oracle and/or its affiliates. All rights reserved.: 0
Retire store [/etc/devices/retire_store] (/dev/null to bypass): Press Return 

NOTICE: kmem_io_2G arena created
Hostname: system-04

system-04 console login: