Solaris 10 11/06 安装指南:Solaris Live Upgrade 和升级规划

使用 Solaris Live Upgrade 进行升级的示例(命令行界面)

在本示例中,将在运行 Solaris 9 发行版的系统上使用 lucreate 命令创建新的引导环境。通过使用 luupgrade 命令将此新引导环境升级到 Solaris 10 11/06 发行版。通过使用 luactivate 命令激活已升级的引导环境。此外,还提供了回退到初始引导环境的示例。

安装必需的修补程序

描述 

更多信息 


注意 – 注意 –

正确操作 Solaris Live Upgrade 要求为特定 OS 版本安装一组限定的修补程序修订版。安装或运行 Solaris Live Upgrade 之前,需要安装这些修补程序。



仅适用于 x86 –

从 Solaris 10 1/06 发行版开始,如果未安装该组修补程序,则 Solaris Live Upgrade 将会失败,而且您可能会看到以下错误消息。如果没有看到以下错误消息,可能是仍旧未安装所需的修补程序。在尝试安装 Solaris Live Upgrade 之前,应始终验证是否已安装了 Sunsolve 信息文档中列出的所有修补程序。


ERROR: Cannot find or is not 
executable: </sbin/biosdev>.
ERROR: One or more patches required by 
Live Upgrade has not been installed.

信息文档 72099 中列出的修补程序可能会随时更改。这些修补程序可能会修复 Solaris Live Upgrade 中的缺陷以及 Solaris Live Upgrade 所依赖的组件中的缺陷。如果在使用 Solaris Live Upgrade 的过程中遇到了任何困难,请检查并确保安装了最新的 Solaris Live Upgrade 修补程序。 

请访问 http://sunsolve.sun.com,以确保具有最近更新的修补程序列表。在 SunSolve Web 站点上搜索信息文档 72099。

如果正在运行 Solaris 8 或 Solaris 9 OS,您可能无法运行 Solaris Live Upgrade 安装程序。因为这些发行版中未包含运行 Java 2 运行时环境所需的修补程序集。对于建议用于运行 Solaris Live Upgrade 安装程序和安装软件包的 Java 2 运行时环境,必须拥有建议的修补程序簇。 

要安装 Solaris Live Upgrade 软件包,请使用 pkgadd 命令。或者,为 Java 2 运行时环境安装建议的修补程序簇。访问 http://sunsolve.sun.com 可以获得修补程序簇。

按照以下步骤安装必需的修补程序。

从 SunSolve Web 站点获取修补程序列表。


# patchadd /net/server/export/patches
# init 6

在活动的引导环境中安装 Solaris Live Upgrade


注 –

此过程假设系统正在运行卷管理器。有关使用卷管理器管理可移除介质的详细信息,请参阅《系统管理指南:设备和文件系统》


  1. 插入 Solaris Operating System DVD 或 Solaris Software - 2 CD。

  2. 遵循针对不同介质所使用的步骤。

    • 如果使用的是 Solaris Operating System DVD,请将目录更改为安装程序所在的目录,然后运行安装程序。

      • 对于基于 SPARC 的系统


        # cd /cdrom/cdrom0/s0/Solaris_10/Tools/Installers
        # ./liveupgrade20
        
      • 对于基于 x86 的系统


        # cd /cdrom/cdrom0/Solaris_10/Tools/Installers
        # ./liveupgrade20
        

      会显示 Solaris 安装程序 GUI。

    • 如果使用的是 Solaris Software - 2 CD,请运行该安装程序。


      % ./installer
      

      会显示 Solaris 安装程序 GUI。

  3. 从“安装”面板的“选择类型”中,单击“自定义”。

  4. 在“语言环境选择”面板上,单击要安装的语言。

  5. 选择要安装的软件。

    • 对于 DVD,请在“组件选择”面板上单击“下一步”,以安装软件包。

    • 对于 CD,请在“产品选择”面板上单击“Solaris Live Upgrade 的缺省安装”,然后单击其他产品选项以撤消选定此软件。

  6. 按照 Solaris 安装程序面板上的指示安装本软件。

创建引导环境

使用 -c 选项将源引导环境命名为 c0t4d0s0。仅在创建第一个引导环境时才需要命名源引导环境。有关使用 -c 选项进行命名的更多信息,请参见“首次创建引导环境”中步骤 2 的描述。

将新引导环境命名为 c0t15d0s0-A 选项将创建一个与引导环境名称相关联的说明。

将根 (/) 文件系统复制到新引导环境。同时,创建了一个新的交换片,而不是共享源引导环境的交换片。


# lucreate -A 'BE_description' -c /dev/dsk/c0t4d0s0 -m /:/dev/dsk/c0t15d0s0:ufs\
-m -:/dev/dsk/c0t15d0s1:swap -n /dev/dsk/c0t15d0s0

升级非活动的引导环境

将非活动的引导环境命名为 c0t15d0s0。从网络中获取用于升级的操作系统映像。


# luupgrade -n c0t15d0s0 -u -s /net/ins-svr/export/Solaris_10 \ 
combined.solaris_wos

检查引导环境是否可引导

lustatus 命令报告引导环境创建是否完成。lustatus 还显示引导环境是否可引导。


# lustatus
boot environment   Is        Active  Active     Can	    Copy
Name               Complete  Now	 OnReboot   Delete	 Status
------------------------------------------------------------------------
c0t4d0s0           yes       yes      yes      no      -
c0t15d0s0          yes       no       no       yes     -

激活非活动的引导环境

通过 luactivate 命令使 c0t15d0s0 成为可引导的引导环境。然后重新引导系统,c0t15d0s0 即会成为活动的引导环境。c0t4d0s0 引导环境现在处于非活动状态。


# luactivate c0t15d0s0
# init 6

(可选)回退到源引导环境

以下回退过程取决于新引导环境的激活情况:


示例 9–1 SPARC: 在忽略引导环境创建成功的情况下回退

在本示例中,虽然新引导环境已经被成功激活了,但初始引导环境 c0t4d0s0 被重新恢复为活动的引导环境。设备名称为 first_disk


# /sbin/luactivate first_disk 
# init 6


示例 9–2 SPARC: 从失败的引导环境激活中回退

在本示例中,新引导环境是不可引导的。您必须返回到 OK 提示符,然后在单用户模式下从初始引导环境 c0t4d0s0 中引导。


OK boot net -s
# /sbin/luactivate first_disk
Do you want to fallback to activate boot environment c0t4d0s0 
(yes or no)? yes
# init 6

初始引导环境 c0t4d0s0 成为活动的引导环境。



示例 9–3 SPARC: 使用 DVD、CD 或网络安装映像回退到初始引导环境

在本示例中,新引导环境是不可引导的。您无法从初始引导环境中引导,因此必须使用介质或网络安装映像。设备为 /dev/dsk/c0t4d0s0。初始引导环境 c0t4d0s0 成为活动的引导环境。


OK boot net -s
# fsck /dev/dsk/c0t4d0s0
# mount /dev/dsk/c0t4d0s0 /mnt 
# /mnt/sbin/luactivate
Do you want to fallback to activate boot environment c0t4d0s0 
(yes or no)? yes
# umount /mnt 
# init 6


示例 9–4 x86: 通过使用 GRUB 菜单回退到初始引导环境

从 Solaris 10 1/06 发行版开始,以下示例介绍了通过使用 GRUB 菜单回退的步骤。

在本示例中,正确显示了 GRUB 菜单,但是新引导环境不可引导。要启用回退,在单用户模式中引导初始引导环境。

  1. 成为超级用户或承担等效角色。

  2. 要显示 GRUB 菜单,请重新引导系统。


    # init 6
    

    此时将显示 GRUB 菜单。


    GNU GRUB version 0.95 (616K lower / 4127168K upper memory)
    +-------------------------------------------------------------------+
    |Solaris                                                            |
    |Solaris failsafe                                                   |
    |second_disk                                                        |
    |second_disk failsafe                                               |
    +-------------------------------------------------------------------+
    Use the ^ and v 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.
  3. 从 GRUB 菜单中选择初始引导环境。必须已使用 GRUB 软件创建了该引导环境。在 Solaris 10 1/06 发行版之前创建的引导环境不属于 GRUB 引导环境。如果您没有可引导的 GRUB 引导环境,则跳至示例 9–5

  4. 通过键入以下内容来编辑 GRUB 菜单:e

  5. 通过使用方向键选择 kernel /boot/multiboot 并键入 e,将显示 grub 编辑菜单。


    grub edit>kernel /boot/multiboot
  6. 通过键入 -s 引导至单用户模式。


    grub edit>kernel /boot/multiboot -s
    
  7. 引导并挂载该引导环境。然后将其激活。


# b
# fsck /dev/dsk/c0t4d0s0
# mount /dev/dsk/c0t4d0s0 /mnt 
# /mnt/sbin/luactivate
Do you want to fallback to activate boot environment c0t4d0s0
(yes or no)? yes
# umount /mnt
# init 6


示例 9–5 x86: 通过使用 DVD 或 CD 回退到具有 GRUB 菜单的初始引导环境

从 Solaris 10 1/06 发行版开始,以下示例介绍了通过使用 DVD 或 CD 回退的步骤。

在本示例中,新引导环境是不可引导的。另外,也不显示 GRUB 菜单。要启用回退,在单用户模式中引导初始引导环境。

  1. 插入 Solaris Operating System for x86 Platforms DVD 或 Solaris Software for x86 Platforms - 1 CD。

  2. 成为超级用户或承担等效角色。

  3. 从 DVD 或 CD 引导。


    # init 6
    

    此时将显示 GRUB 菜单。


    GNU GRUB version 0.95 (616K lower / 4127168K upper memory)
    +-------------------------------------------------------------------+
    |Solaris                                                            |
    |Solaris failsafe                                                   |
    +-------------------------------------------------------------------+
    Use the ^ and v 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.
  4. 通过键入以下内容来编辑 GRUB 菜单:e

  5. 通过使用方向键选择 kernel /boot/multiboot 并键入 e,将显示 grub 编辑菜单。


    grub edit>kernel /boot/multiboot
  6. 通过键入 -s 引导至单用户模式。


    grub edit>kernel /boot/multiboot -s
    
  7. 引导并挂载该引导环境。然后将其激活并重新引导。


Edit the GRUB menu by typing: e
Select the original boot environment by using the arrow keys.
grub edit>kernel /boot/multiboot -s
# b
# fsck /dev/dsk/c0t4d0s0
# mount /dev/dsk/c0t4d0s0 /mnt 
# /mnt/sbin/luactivate
Do you want to fallback to activate boot environment c0t4d0s0
(yes or no)? yes
# umount /mnt
# init 6