使用此过程来恢复在执行备份时元设备上的根 (/) 文件系统。 如果发生类似根磁盘被损坏后用新磁盘来替换的情况,就可以执行此过程。 不应引导正在恢复的节点。 在执行此恢复过程前确保群集正在无故障地运行。
由于新磁盘的分区必须与故障磁盘完全相同,所以在进行此过程前必须先确定分区方案,并相应地重建文件系统。
成为某个有权访问元集的群集节点(而不是所要恢复的那个节点)的超级用户。
从所有元集中删除要恢复的节点的主机名。
# metaset -s setname -f -d -h nodelist |
指定元集名称。
强制。
从元集中删除。
指定要从元集中删除的节点的名称。
替换要恢复其根 (/) 文件系统的那个节点上的故障磁盘。
请参阅服务器所附带的文档,以了解磁盘替换过程。
引导要恢复的节点。
如果使用 Solaris CD-ROM,请运行以下命令:
ok boot cdrom -s |
如果使用 JumpStart 服务器,请运行以下命令:
ok boot net -s |
使用 format(1M) 命令在根磁盘上创建所有的分区和交换。
重建故障磁盘上的原分区方案。
使用 newfs(1M) 命令,适当地创建根 (/) 文件系统和其他文件系统
重建故障磁盘上的原文件系统。
确保创建了 /global/.devices/node@nodeid 文件系统。
在临时安装点上安装根 (/) 文件系统。
# mount device temp-mountpoint |
使用以下命令来恢复根 (/) 文件系统。
# cd temp-mountpoint # ufsrestore rvf dump-device # rm restoresymtable |
在新磁盘上安装新的引导块。
# /usr/sbin/installboot /usr/platform/`uname -矛/lib/fs/ufs/bootblk raw-disk-device |
删除 /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) |
对于那些作为元设备组成部分的根磁盘,编辑 /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 - |
卸载临时文件系统并检查原始磁盘设备。
# cd / # umount temp-mountpoint # fsck raw-disk-device |
以单用户模式重新引导节点。
# reboot -- "-s" |
使用 scdidadm 命令替换磁盘 ID。
# scdidadm -R rootdisk |
使用 metadb(1M) 命令来重建状态数据库的副本。
# metadb -c copies -af raw-disk-device |
指定所要创建的副本数量。
在指定的原始磁盘设备上创建初始状态数据库副本。
以群集模式重新引导该节点。
从除所恢复的那个节点之外的任何一个群集节点,使用 metaset(1M) 命令将所恢复的那个节点添加到所有元集。
phys-schost-2# metaset -s setname -a -h nodelist |
添加(创建)元集。
参照 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 \ -矛/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 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 |