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

Procedure如何恢复已封装的根 (/) 文件系统 (Veritas Volume Manager(Veritas 卷管理器))

使用此过程可将封装的根 (/) 文件系统恢复到某个节点。不应引导正在恢复的节点。执行恢复过程之前,请确保群集正在无故障运行。


注 –

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


phys-schost# 提示符表示全局群集提示符。此操作过程适用于全局群集。

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

  1. 替换要恢复的根文件系统所在的节点的故障磁盘。

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

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

    • 如果使用的是 Solaris OS CD,请在 OpenBoot PROM ok 提示符下键入以下命令:


      ok boot cdrom -s
      
    • 如果使用的是 Solaris JumpStart 服务器,请在 OpenBoot PROM ok 提示符下键入以下命令:


      ok boot net -s
      
  3. 使用 format 命令在根磁盘上创建所有分区和交换空间。

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

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

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


    注 –

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


  5. 在临时挂载点上挂载根 (/) 文件系统。


    # mount device temp-mountpoint
    
  6. 从备份中恢复根 (/) 文件系统。


    # cd temp-mountpoint
    # ufsrestore rvf dump-device
    # rm restoresymtable
    
  7. 创建一个空的 install-db 文件。

    此文件会在下次重新引导节点时将其置于 VxVM 安装模式。


    # touch \
    /temp-mountpoint/etc/vx/reconfig.d/state.d/install-db
    
  8. / temp-mountpoint /etc/system 文件中删除以下条目。


    * rootdev:/pseudo/vxio@0:0
    * set vxio:vol_rootdev_is_volume=1
  9. 编辑 / temp-mountpoint /etc/vfstab 文件,用根磁盘的标准磁盘设备(例如 /dev/dsk/c0t0d0s0)替换所有的 VxVM 挂载点。


    Example: 
    Change from—
    /dev/vx/dsk/rootdg/rootvol /dev/vx/rdsk/rootdg/rootvol /      ufs   1     no -
    
    Change to—
    /dev/dsk/c0t0d0s0 /dev/rdsk/c0t0d0s0  / ufs   1     no       -
  10. 卸载临时文件系统并检查该文件系统。


    # cd /
    # umount temp-mountpoint
    # fsck raw-disk-device
    
  11. 在新磁盘上安装引导块。


    # /usr/sbin/installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk raw-disk-device
    
  12. 在多用户模式下重新引导节点。


    # reboot
    
  13. 使用 scdidadm(1M) 更新设备 ID。


    # cldevice repair /dev/rdsk/c0t0d0
    
  14. 运行 clvxvm 封装命令以封装磁盘并重新引导。

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

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


      # umount /global/.devices/node@nodeid
      
    • 为群集节点上的 rootdg 磁盘组重编从设备号。


      # vxdg reminor rootdg 100
      
  16. 关闭并以群集模式重新引导节点。


    # shutdown -g0 -i6 -y
    

示例 12–9 恢复已封装的根 (/) 文件系统 (Veritas Volume Manager(Veritas 卷管理器))

下面的示例说明了将封装的根 (/) 文件系统从磁带设备 /dev/rmt/0 恢复到节点 phys-schost-1 的过程。


[Replace the failed disk and boot the node:]

从 Solaris OS CD 引导节点。在 OpenBoot PROM ok 提示符下键入以下命令:


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/vx/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:]
# reboot
[Update the disk ID:]
# cldevice repair /dev/rdsk/c0t0d0
[Encapsulate the disk::]
# vxinstall
Choose to encapsulate the root disk.
[If a conflict  in minor number occurs, reminor the rootdg disk group:]
# umount /global/.devices/node@nodeid
# vxdg reminor rootdg 100
# shutdown -g0 -i6 -y

另请参见

有关如何镜像已封装的根磁盘的说明,请参见《Sun Cluster 软件安装指南(适用于 Solaris OS)》