Sun Cluster 3.0 系统管理指南

8.3.4 如何恢复未封装 的根 (/) 文件系统 (VERITAS 卷管理器)

按照此过程将一个未封装的根 (/) 文件系统恢复到一个节点。不应引导正在恢复的节点。在执行此恢复过程前确保群集无故障运行。


注意:

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


  1. 更换要在其上恢复根文件的节点上失败的磁盘。

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

  2. 引导要恢复的节点。

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


      ok boot cdrom -s
      

    • 如果正在使用一个 JumpStart 服务器,则运行以下命令:


      ok boot net -s
      

  3. 使用 format(1M) 命令在根磁盘上创建所有的分区和交换。

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

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

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


    注意:

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


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


    # mount device temp-mount-point
    
  6. 从备份中恢复根 (/) 文件系统,然后卸载并 检查文件系统。


    # cd temp-mount-point
    # ufsrestore rvf dump-device
    # rm restoresymtable
    # cd /
    # umount temp-mount-point
    # fsck raw-disk-device
    

    此时文件系统已恢复。

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


    # /usr/sbin/installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk raw-disk-device
    
  8. 将节点重新引导到单用户模式。

    1. 启动重新引导。


      # reboot -- "-s"

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


      Type control-d to proceed with normal startup,
      (or give root password for system maintenance):
    2. 输入超级用户口令。

  9. 确定根磁盘组是否位于根磁盘上的一个单片上。

    • 如果是,则创建并设置根磁盘组:


      # vxdctl init
      # vxdg init rootdg
      # vxdctl add disk diskslice type=simple
      # vxdisk -f init diskslice type=simple
      # vxdg adddisk diskslice
      # vxdctl enable
      
    • 如果否,则进行步骤 10

  10. 使用 scdidadm 命令更新磁盘 ID。


    # scdidadm -R /dev/rdsk/diskdevice
  11. 按下 CTRL-d 以恢复多用户模式。

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

8.3.4.1 示例-恢复未封装的根 (/) 文件系统 (VERITAS 卷管理器)

以下示例展示从磁带设备 /dev/rmt/0 恢复到 节点 phys-schost-1 的未封装的根 (/) 文件系统。


[Replace the failed disk and boot the node:]
ok boot cdrom -s
[Use format and newfs to 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
# cd /
# umount /a
# fsck /dev/rdsk/c0t0d0s0
[Install a new boot block:]
# /usr/sbin/installboot /usr/platform/`uname \
-i`/lib/fs/ufs/bootblk /dev/rdsk/c0t0d0s0
[Reboot in single-user mode:]
# reboot -- "-s"
[If the root disk group is on a single slice on the root disk, create the new root disk group:]
# vxdctl init
# vxdg init rootdg
# vxdctl add disk c0t0d0s4 type=simple
# vxdisk -f init c0t0d0s4 type=simple
# vxdg adddisk c0t0d0s4
# vxdctl enable
[Update the disk ID:]
# scdidadm -R /dev/rdsk/c0t0d0
[Press CTRL-d to resume in multiuser mode]