Sun Cluster 系统管理指南(适用于 Solaris OS)

Procedure如何恢复 Solstice DiskSuite 元设备或 Solaris Volume Manager 卷上的根 (/) 文件系统

使用此过程可在执行备份后恢复 Solstice DiskSuite 元设备或 Solaris Volume Manager 卷上的根 (/) 文件系统。比如在根磁盘损坏后更换新磁盘时,就可以执行此过程。不应引导正在恢复的节点。执行恢复过程之前,请确保群集正在无故障运行。


注 –

由于新磁盘的分区格式必须与故障磁盘的分区格式相同,所以在开始此过程之前,请先确定分区方案,然后再根据需要重新创建文件系统。


此过程提供了 Sun Cluster 命令的长格式。此外,大多数命令还有简短格式。这些命令除了名称长短的不同以外,其功能都是相同的。有关命令及其简短格式的列表,请参见附录 A,Sun Cluster 面向对象的命令

  1. 在对磁盘集具有访问权限的节点(正在恢复的节点)上,成为超级用户或使用一个提供 solaris.cluster.modifiy RBAC 授权的角色。

    使用要恢复的节点以外的其他节点。

  2. 将正在恢复的节点的主机名从所有磁盘集中删除。


    # metaset -s setname -f -d -h nodelist
    
    -s setname

    指定元集名称。

    -f

    从磁盘集中删除最后一个主机。

    -d

    从元集中删除。

    -h nodelist

    指定要从元集中删除的节点的名称。

  3. 替换要恢复其根 (/) 文件系统的那个节点上的故障磁盘。

    请参阅服务器所附带的文档,以了解磁盘替换过程。

  4. 引导正在恢复的节点。

    • 如果使用 Solaris OS CD,请注意以下内容:

      • SPARC:键入以下内容:


        ok boot cdrom -s
        
      • x86: 将 CD 放入系统的 CD 驱动器,并通过关机随后将系统关闭再打开来引导系统。在 "Current Boot Parameters" 屏幕上,键入 bi


                             <<< Current Boot Parameters >>>
        Boot path: /pci@0,0/pci8086,2545@3/pci8086,1460@1d/pci8086,341a@
        7,1/sd@0,0:a
        Boot args:
        
        Type b [file-name] [boot-flags] <ENTER> to boot with options
        or   i <ENTER>                          to enter boot interpreter
        or   <ENTER>                            to boot with defaults
        
                         <<< timeout in 5 seconds >>>
        Select (b)oot or (i)nterpreter: b -s
        
    • 如果使用 Solaris JumpStartTM 服务器,请注意以下内容:

      • SPARC:键入以下内容:


        ok boot net -s
        
      • x86: 将 CD 放入系统的 CD 驱动器,并通过关机随后将系统关闭再打开来引导系统。在 "Current Boot Parameters" 屏幕上,键入 bi


                             <<< Current Boot Parameters >>>
        Boot path: /pci@0,0/pci8086,2545@3/pci8086,1460@1d/pci8086,341a@
        7,1/sd@0,0:a
        Boot args:
        
        Type b [file-name] [boot-flags] <ENTER> to boot with options
        or   i <ENTER>                          to enter boot interpreter
        or   <ENTER>                            to boot with defaults
        
                         <<< timeout in 5 seconds >>>
        Select (b)oot or (i)nterpreter: b -s
        
  5. 使用 format 命令在根磁盘上创建所有分区和交换空间。

    重建故障磁盘上的原分区方案。

  6. 使用 newfs 命令创建根 (/) 文件系统和其他文件系统(根据需要)。

    重建故障磁盘上的原文件系统。


    注 –

    请确保创建 /global/.devices/node@nodeid 文件系统。


  7. 在临时安装点上安装根 (/) 文件系统。


    # mount device temp-mountpoint
    
  8. 使用以下命令来恢复根 (/) 文件系统。


    # cd temp-mountpoint
    # ufsrestore rvf dump-device
    # rm restoresymtable
    
  9. 在新磁盘上安装新的根块。


    # /usr/sbin/installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk 
    raw-disk-device
    
  10. 删除 /temp-mountpoint/etc/system 文件中有关 MDD 根信息的那些行。


    * Begin MDD root info (do not edit)
    forceload: misc/md_trans
    forceload: misc/md_raid
    forceload: misc/md_mirror
    forceload: misc/md_hotspares
    forceload: misc/md_stripe
    forceload: drv/pcipsy
    forceload: drv/glm
    forceload: drv/sd
    rootdev:/pseudo/md@0:0,10,blk
    * End MDD root info (do not edit)
  11. 编辑 /temp-mountpoint/etc/vfstab 文件,将 Solstice DiskSuite 元设备或 Solaris Volume Manager 卷的根条目更改为作为元设备或卷的一部分的根磁盘上的各文件系统的相应的正常片。


    Example: 
    Change from—
    /dev/md/dsk/d10   /dev/md/rdsk/d10    /      ufs   1     no       -
    
    Change to—
    /dev/dsk/c0t0d0s0 /dev/rdsk/c0t0d0s0  /      ufs   1     no       -
  12. 卸载临时文件系统并检查原始磁盘设备。


    # cd /
    # umount temp-mountpoint
    # fsck raw-disk-device
    
  13. 在多用户模式下重新引导节点。


    # reboot
    
  14. 替换磁盘 ID。


    # cldevice repair rootdisk
    
  15. 使用 metadb 命令重建状态数据库副本。


    # metadb -c copies -af raw-disk-device
    
    -c copies

    指定要创建的复本数。

    -af raw-disk-device

    在指定的原始磁盘设备上创建初始状态数据库复本。

  16. 从一个群集节点(非恢复的节点)上将恢复后的节点添加到所有磁盘集。


    phys-schost-2# metaset -s setname -a -h nodelist
    
    -a

    添加(创建)元集。

    根据 Solstice DiskSuite 文档,为根 (/) 设置元设备或卷/镜像。

    已将节点重新引导到群集模式下。群集已经就绪。


示例 11–7 恢复 Solstice DiskSuite 元设备或 Solaris Volume Manager 卷上的根 (/) 文件系统

下面的示例展示了将根 (/) 文件系统从磁带设备 /dev/rmt/0 恢复到节点 phys-schost-1 的过程。从群集中的另一节点 phys-schost-2 运行 metaset 命令,以删除节点 phys-schost-1,稍后再将它重新添加到元集 schost-1 中。所有其他命令都是从 phys-schost-1 上运行的。系统在 /dev/rdsk/c0t0d0s0 上创建了一个新的引导块,在 /dev/rdsk/c0t0d0s4 上重新创建了三个状态数据库副本。


[Become superuser or assume a role that provides solaris.cluster.modify RBAC authorization on a cluster node with 
access to the metaset, other than the node to be restored.]
[Remove the node from the metaset:]
phys-schost-2# metaset -s schost-1 -f -d -h phys-schost-1
[Replace the failed disk and boot the node:]

从 Solaris OS CD 引导节点:


[Use format and newfs to re-create partitions and file systems
.]
[Mount the root file system on a temporary mount point:]
# mount /dev/dsk/c0t0d0s0 /a
[Restore the root file system:]
# cd /a
# ufsrestore rvf /dev/rmt/0
# rm restoresymtable
[Install a new boot block:]
# /usr/sbin/installboot /usr/platform/`uname \
-i`/lib/fs/ufs/bootblk /dev/rdsk/c0t0d0s0

[Remove the lines in / temp-mountpoint/etc/system file for MDD root information:
]
* Begin MDD root info (do not edit)
forceload: misc/md_trans
forceload: misc/md_raid
forceload: misc/md_mirror
forceload: misc/md_hotspares
forceload: misc/md_stripe
forceload: drv/pcipsy
forceload: drv/glm
forceload: drv/sd
rootdev:/pseudo/md@0:0,10,blk
* End MDD root info (do not edit)
[Edit the /temp-mountpoint/etc/vfstab file]
Example: 
Change from—
/dev/md/dsk/d10   /dev/md/rdsk/d10    /      ufs   1     no       -

Change to—
/dev/dsk/c0t0d0s0 /dev/rdsk/c0t0d0s0  /usr   ufs   1     no       -
[Unmount the temporary file system and check the raw disk device:]
# cd /
# umount /a
# fsck /dev/rdsk/c0t0d0s0
[Reboot:]
# reboot
[Replace the disk ID:]
# cldevice repair /dev/rdsk/c0t0d0
[Re-create state database replicas:]
# metadb -c 3 -af /dev/rdsk/c0t0d0s4
[Add the node back to the metaset:]
phys-schost-2# metaset -s schost-1 -a -h phys-schost-1