Sun Cluster 3.0 系统管理指南

8.3.3 如何恢复元设备 (Solstice DiskSuite) 上的 根 (/) 文件系统

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


注意:

由于必须使用失败的磁盘的格式来给新的磁盘进行分区,所以在进行此过程前必须识别 分区方案,并相应地重新创建文件系统。


  1. 在您要恢复的节点之外的、一个有权访问元集的群集 节点上的超级用户。

  2. 使用 metaset(1M) 命令来 从所有元集中移除要恢复的节点的主机名。


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

    指定元集名称。

    -f

    强制。

    -d

    从元集中删除。

    -h node

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

  3. 在要恢复其上的根 (/) 文件系统的节点上更换失败的磁盘。

    请参考服务器附带的文档中的磁盘更换过程。

  4. 引导要恢复的节点。

    • 如果使用 Solaris CD-ROM,请运行以下命令:


      ok boot cdrom -s
      
    • 如果使用一个 JumpStart 服务器,则运行以下命令:


      ok boot net -s
      
  5. 使用 format(1M) 命令在根磁盘上创建所有的分区和交换。

    重建失败的磁盘上的原分区方案。

  6. 使用 newfs(1M) 命令,相应地创建根 (/) 文件系统和其他文件系统

    重建失败的磁盘上的原文件系统。


    注意:

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


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


    # mount device temp-mount-point
    

  8. 使用下列名称来恢复根 (/) 文件系统。


    # cd  temp-mount-point
    # ufsrestore rvf dump-device
    # rm restoresymtable
    

  9. 在新磁盘上安装一个新引导块。


    # /usr/sbin/installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk raw-disk-device
    
  10. /temp-mount-point/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-mount-point/etc/vfstab 文件以将根项从元设备更改到对应的 一个正常片上。


    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       -
  12. 卸载临时文件系统并检查原始磁盘设备。


    # cd /
    # umount  temp-mount-point
    # fsck raw-disk-device
    
  13. 以单用户模式重新引导节点。


    # reboot -- "-s"
    
  14. 使用 scdidadm 命令更换磁盘 ID。


    # scdidadm -R rootdisk
    
  15. 使用 metadb(1M) 命令来重建状态数据库复制品。


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

    指定要创建的复制器的编号。

    -af raw-disk-device

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

  16. 以群集模式重新引导该节点。

    1. 启动重新引导。


      # reboot
      

      在此引导过程中,您将看到错误消息或警告消息,其结尾部分是以下指令:


      Type control-d to proceed with normal startup,
      (or give root password for system maintenance):
    2. 按下 CTRL-d 以引导到多用户模式下。

  17. 从已恢复的节点之外的一个群集节点,使用 metaset(1M) 命令来 将恢复的节点添加到所有的元集中。


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

    添加(创建)元集。

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

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

8.3.3.1 示例-恢复元设备 (Solstice DiskSuite) 上原有的根 (/) 文件系统

以下示例展示从磁带设备 /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 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:]
ok boot cdrom -s
[Use format and newfs to recreate 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-mount-point/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-mount-point/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 in single-user mode:]
# reboot -- "-s"
[Replace the disk ID:]
# scdidadm -R /dev/dsk/c0t0d0
[Recreate state database replicas:]
# metadb -c 3 -af /dev/rdsk/c0t0d0s4
# reboot
Type CTRL-d to boot into multiuser mode.
[Add the node back to the metaset:]
phys-schost-2# metaset -s schost-1 -a -h phys-schost-1