Sun Cluster 3.0 U1 系统管理指南

8.3.5 如何恢复已封装的根 (/) 文件系统 (VERITAS Volume Manager)

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


注意:

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


  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
    

  7. 创建一个空的 install-db 文件。

    这会使节点在下次重新引导时进入 VxVM 安装模式。


    # touch /temp-mount-point/etc/vx/reconfig.d/state.d/install-db
    

  8. /temp-mount-point/etc/system 文件删除或注释调下列条目。


    * rootdev:/pseudo/vxio@0:0 * set vxio:vol_rootdev_is_volume=1

  9. 编辑 /temp-mount-point/etc/vfstab 文件并用根磁盘的标准磁盘设备替换所有的 VxVM 安装点,如 /dev/dsk/c0t0d0s0


    Example: 
    Change from-
    /dev/vx/dsk/rootdg/rootvol /dev/md/rdsk/rootdg/rootvol /      ufs   1     no -
    Change to-
    /dev/dsk/c0t0d0s0 /dev/rdsk/c0t0d0s0  / ufs   1     no       -

  10. 卸载临时文件系统并检查该文件系统。


    # cd /
    # umount temp-mount-point
    # fsck raw-disk-device
    

  11. 在新磁盘上安装引导块。


    # /usr/sbin/installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk raw-disk-device
    

  12. 以单用户模式重新引导节点。


    # reboot -- "-s"
    

  13. 使用 scdidadm (1M) 更新磁盘 ID。


    # scdidadm -R /dev/rdsk/c0t0d0
    

  14. 运行 vxinstall 以封装磁盘并重新引导。


    # vxinstall
    

  15. 如果与其它系统间存在次编号冲突,则卸载全局设备并为磁盘组重编次编号。

    • 卸载群集节点上的全局设备文件系统。


      # umount /global/.devices/node@nodeid
      

    • 为群集节点上的 rootdg 磁盘组重编次编号。


      # vxdg reminor rootdg 100
      

  16. 关闭节点,再以群集模式重新引导该节点。


    # shutdown -g0 -i6 -y
    

8.3.5.1 示例 - 恢复封装的根 (/) 文件系统 (VERITAS Volume Manager)

下面的示例展示从磁带设备 /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
[Create an empty install-db file:]
# touch /a/etc/vx/reconfig.d/state.d/install-db
[Edit /etc/system on the temporary file system and remove or comment out the following entries:]
	# rootdev:/pseudo/vxio@0:0
	# set vxio:vol_rootdev_is_volume=1
[Edit /etc/vfstab on the temporary file system:]
Example: 
Change from-
/dev/vx/dsk/rootdg/rootvol /dev/md/rdsk/rootdg/rootvol / ufs 1 no-
Change to-
/dev/dsk/c0t0d0s0 /dev/rdsk/c0t0d0s0  / ufs   1     no       -
[Unmount the temporary file system, then check the file system:]
# 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"
[Update the disk ID:]
# scdidadm -R /dev/rdsk/c0t0d0
[Run vxinstall:]
# vxinstall
Choose to encapsulate the root disk.
[If there is a conflict in minor number, reminor the rootdg disk group:]
# umount /global/.devices/node@nodeid
# vxdg reminor rootdg 100
# shutdown -g0 -i6 -y

8.3.5.2 从此处可转到何处

有关如何镜像已封装的根磁盘的说明,请参阅 《Sun Cluster 3.0 U1 安装指南》,恢复群集文件。