https://onitroad.com 更多教程

从网络启动

或者,我们可以从网络启动到单用户模式,如下所示:

{0} ok boot net:dhcp -v -s
-- lines omitted -
Hostname: some-name.company.com
Requesting System Maintenance Mode
SINGLE USER MODE
Enter user name for system maintenance (control-d to bypass): root
Enter root password (control-d to bypass): 
single-user privilege assigned to root on /dev/console.
Entering System Maintenance Mode
Jan 30 14:14:54 su: 'su root' succeeded for root on /dev/console
Oracle Corporation      SunOS 5.11      11.1    September 2012

将 LDoms 中的 iso 导出为伪 CDROM

  1. 在具有 LDoms 的系统上,我们可以将一个 iso 文件导出为虚拟 CDROM,用于访客 LDom,如下所示。
    在此示例中,ISO 镜像为 /export/images/sol-10-u8-ga-sparc-dvd.iso。
primary# ldm add-vdsdev /export/images/sol-10-u8-ga-sparc-dvd.iso dvd-iso@primary-vds0
primary# ldm stop-domain ldom1
  1. 将 ISO 镜像的虚拟磁盘添加到逻辑域。
primary# ldm add-vdisk s10-dvd dvd-iso@primary-vds0 ldom1
  1. 重新启动来宾域。
primary# ldm start-domain ldom1
  1. 连接到来宾域。
primary# telnet localhost 5000
  1. 验证作为虚拟磁盘的 ISO 镜像是否存在。
{0} ok show-disks
a) /virtual-devices@100/channel-devices@200/disk@1
b) /virtual-devices@100/channel-devices@200/disk@0
q) NO SELECTION
Enter Selection, q to quit: q
{0} ok devalias
dvd-iso                  /virtual-devices@100/channel-devices@200/disk@1
ldom1-root               /virtual-devices@100/channel-devices@200/disk@0
vnet0                    /virtual-devices@100/channel-devices@200/network@0
net                      /virtual-devices@100/channel-devices@200/network@0
disk                     /virtual-devices@100/channel-devices@200/disk@0
virtual-console          /virtual-devices/console@1
name                     aliases

在这个例子中,新添加的设备是 dvd-iso

  1. 从 ISO 镜像引导来宾域。
{0} ok boot dvd-iso -sv
Requesting System Maintenance Mode
SINGLE USER MODE
Enter user name for system maintenance (control-d to bypass): 
Enter user name for system maintenance (control-d to bypass): root
Enter root password (control-d to bypass):                                     ### when booting from ISO or DVD, the default root password for root is 'solaris'
single-user privilege assigned to root on /dev/console.
Entering System Maintenance Mode
Jan 22 11:53:14 su: 'su root' succeeded for root on /dev/console
Oracle Corporation    SunOS 5.11    11.3    September 2015
#
在 Solaris 11 中从备用设备引导时如何导入 Zpool 和挂载 BE

这篇文章展示了如何从备用设备或者媒体引导以更新或者修复 Solaris 11 实例。
从另一个可引导磁盘、安装 DVD 或者通过网络引导系统。
确保备用介质上的 Solaris 11 版本与磁盘上的 Solaris 11 版本匹配。
对于 SPARC:如果从安装介质或者网络上的安装服务器引导,请选择文本安装。
如果从安装服务器引导,请使用以下命令:

ok> boot net:dhcp

对于 x86:如果从安装介质或者网络上的安装服务器引导,请从 GRUB 菜单中选择此文本安装选项:

Oracle Solaris 11 11/11 Text Installer and command line
Select option 3 Shell from the following menu:
                1  Install Oracle Solaris
                2  Install Additional Drivers
                3  Shell
                4  Terminal type (currently sun-color)
                5  Reboot
Please enter a number [1]: 3
To return to the main menu, exit the shell

导入 ZFS 池

系统引导至单用户模式后,导入 ZFS 根池并查找现有引导环境。

  1. 检查可导入 zpools 的存在并获取它们的名称和 ID:
root:~# zpool import
  pool: rpool
    id: 5584562336228605571
 state: ONLINE
action: The pool can be imported using its name or numeric identifier.
config:
        rpool                      ONLINE
          c4t373185D25ECEB2ACd0s0  ONLINE
  1. 导入root zpool。
root:~# zpool import rpool
  1. 检查现有的 Solaris BE:
root:~# beadm list
be_find_current_be: failed to find current BE name
BE                     Active Mountpoint Space  Policy Created
--                     ------ ---------- -----  ------ ------
solaris                -      -          16.56M static 2014-07-29 13:38
solaris-1              R      -          4.22G  static 2014-07-30 09:54
solaris.pre-first-boot -      -          63.0K  static 2014-07-29 14:10
  1. 挂载最新的 BE。
root:~# mkdir /a
root:~# beadm mount solaris-1 /a
  1. 执行一些我们选择的操作。
    例如:更新引导存档。
root:~# bootadm update-archive -v -f -R /a
forced update of archive requested
cannot find: /a/etc/cluster/nodeid: No such file or directory
cannot find: /a/etc/mach: No such file or directory
updating /a/platform/sun4v/boot_archive
Successfully created /a/platform/sun4v/boot_archive
  1. 卸载 BE。
root:~# beadm umount solaris-1
  1. 重启系统。
root:~# reboot

我们还可以使用 SPARC OBP 中的引导选项“-L”检查是否可以选择引导不同的引导环境。
在 X86 系统上,GRUB 菜单提供了从不同引导环境引导的选项:

{0} ok boot -L
Boot device: /pci@400/pci@2/pci@0/pci@e/scsi@0/disk@w373185d25eceb2ac,0:a  File and args: -L
1 Oracle Solaris 11.1 SPARC
2 solaris.pre-first-boot
3 solaris-1
Select environment to boot: [ 1 - 3 ]: 3
To boot the selected entry, invoke:
boot [] -Z rpool/ROOT/solaris-1
Program terminated
{0} ok boot -Z rpool/ROOT/solaris-1
-- boot messages -
日期:2020-09-17 00:15:22 来源:oir作者:oir