任务 |
有关说明,请转到... |
---|---|
对于 Solstice DiskSuite,按 Solaris 恢复过程以交互方式恢复文件 | |
对于 Solstice DiskSuite,恢复根 (/) 文件系统 | |
| |
对于 VERITAS Volume Manager,恢复一个未封装的根 (/) 文件系统 | |
对于 VERITAS Volume Manager,恢复一个封装的根 (/) 文件系统 |
按照此过程分别恢复一个或多个文件。在执行此恢复过程前确保群集正在无故障地运行。
成为您要恢复的群集节点的超级用户。
停止所有正在使用要恢复的文件的数据服务。
# scswitch -z -g resource-group -h "" |
使用 ufsrestore 命令来恢复这些文件。
按照此过程将根 (/) 文件系统恢复到一个新磁盘,比如在更换一个坏的根磁盘 后。不应引导正在恢复的节点。在执行此恢复过程前确保群集正在无故障地运行。
由于必须使用与故障磁盘相同的格式来给新的磁盘进行分区,所以在进行此过程前必须确定分区方案,并相应地重新创建文件系统。
成为要恢复的节点之外的一个有权访问元集的群集节点的超级用户。
从所有元集中删除要恢复的节点的主机名。
在元集中要删除的节点之外的节点上运行此命令。
# metaset -s setname -f -d -h nodelist |
指定磁盘集名称。
强制。
从磁盘集中删除。
指定要从磁盘集中删除的节点的名称。
在要在其上恢复根 (/) 文件系统的节点上更换故障磁盘。
请参考服务器附带的文档中的磁盘更换过程。
引导要恢复的节点。
如果使用 Solaris CD-ROM,请运行以下命令:
ok boot cdrom -s |
如果使用 JumpStartTM 服务器,请运行以下命令:
ok boot net -s |
使用 format (1M) 命令在根磁盘上创建所有的分区和交换。
重建故障磁盘上的原分区方案。
使用 newfs (1M) 命令,相应地创建根 (/) 文件系统和其它文件系统。
重建故障磁盘上的原文件系统。
确保创建 /global/.devices/node@nodeid 文件系统。
在一个临时安装点上安装根 (/) 文件系统。
# mount device temp-mount-point |
使用下面的命令来恢复根 (/) 文件系统。
# cd temp-mount-point # ufsrestore rvf dump-device # rm restoresymtable # cd / # umount temp-mount-point # fsck raw-disk-device |
此时文件系统已恢复。
在新磁盘上安装一个新引导块。
# /usr/sbin/installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk 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 |
创建并将主机添加到磁盘集中。
节点已引导到群集模式下, 群集已经就绪。
下面的示例展示从磁带设备 /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 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 # 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" [Replace the disk ID:] # scdidadm -R /dev/dsk/c0t0d0 [Recreate state database replicas:] # metadb -c 3 -af /dev/rdsk/c0t0d0s4 # reboot Press CTL-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 |
使用此过程来恢复执行备份时元设备上存在的根 (/) 文件系统。比如: 在根磁盘损坏后更换新磁盘时,就可以执行此过程, 不应引导正在恢复的节点。在执行此恢复过程前确保群集正在无故障地运行。
由于必须使用与故障磁盘相同的格式来给新的磁盘进行分区,所以在进行此过程前必须确定分区方案,并相应地重新创建文件系统。
成为要恢复的节点之外的一个有权访问元集的群集节点的超级用户。
从所有元集中删除要恢复的节点的主机名。
# 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-mount-point |
使用下面的命令来恢复根 (/) 文件系统。
# cd temp-mount-point # ufsrestore rvf dump-device # rm restoresymtable |
在新磁盘上安装一个新引导块。
# /usr/sbin/installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblkraw-disk-device |
在 /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) |
对于作为元设备的一部分的根磁盘上的每一个文件系统,编辑 /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-mount-point # 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 \ -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 |
按照此过程将一个未封装的根 (/) 文件系统恢复到一个节点, 不应引导正在恢复的节点, 在执行此恢复过程前确保群集正在无故障地运行。
由于必须使用与故障磁盘相同的格式来给新的磁盘进行分区,所以在进行此过程前必须确定分区方案,并相应地重新创建文件系统。
更换要在其上恢复根文件系统的节点上的故障磁盘。
请参考服务器附带的文档中的磁盘更换过程。
引导要恢复的节点。
如果使用 Solaris CD-ROM,请运行以下命令:
ok boot cdrom -s |
如果使用 JumpStart 服务器,请运行以下命令:
ok boot net -s |
使用 format (1M) 命令在根磁盘上创建所有的分区和交换。
重建故障磁盘上的原分区方案。
使用 newfs (1M) 命令,相应地创建根 (/) 文件系统和其它文件系统。
重建故障磁盘上的原文件系统。
确保创建 /global/.devices/node@nodeid 文件系统。
在一个临时安装点上安装根 (/) 文件系统。
# mount device temp-mount-point |
从备份中恢复根 (/) 文件系统,然后卸载并检查该文件系统。
# cd temp-mount-point # ufsrestore rvf dump-device # rm restoresymtable # cd / # umount temp-mount-point # fsck raw-disk-device |
此时文件系统已恢复。
在新磁盘上安装一个新引导块。
# /usr/sbin/installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk raw-disk-device |
将节点重新引导到单用户模式。
确定根磁盘组是否位于根磁盘上的一个单片上。
如果是,则创建并设置根磁盘组。
# vxdctl init # vxdg init rootdg # vxdctl add disk diskslice type=simple # vxdisk -f init diskslice type=simple # vxdg adddisk diskslice # vxdctl enable |
如果否,则继续执行步骤 10。
使用 scdidadm 命令更新磁盘 ID。
# scdidadm -R /dev/rdsk/disk-device |
按下 CTRL-d 可恢复多用户模式。
节点重新引导到群集模式, 群集已经就绪。
下面的示例展示从磁带设备 /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 |
按照此过程将一个已封装的根 (/) 文件系统恢复到一个节点, 不应引导正在恢复的节点, 在执行此恢复过程前确保群集正在无故障地运行。
由于必须使用与故障磁盘相同的格式来给新的磁盘进行分区,所以在进行此过程前必须确定分区方案,并相应地重新创建文件系统。
更换要在其上恢复根文件系统的节点上的故障磁盘。
请参考服务器附带的文档中的磁盘更换过程。
引导要恢复的节点。
如果使用 Solaris CD-ROM,请运行以下命令:
ok boot cdrom -s |
如果使用 JumpStart 服务器,请运行以下命令:
ok boot net -s |
使用 format (1M) 命令在根磁盘上创建所有的分区和交换。
重建故障磁盘上的原分区方案。
使用 newfs (1M) 命令,相应地创建根 (/) 文件系统和其它文件系统。
重建故障磁盘上的原文件系统。
确保创建 /global/.devices/node@nodeid 文件系统。
在一个临时安装点上安装根 (/) 文件系统。
# mount device temp-mount-point |
从备份中恢复根 (/) 文件系统。
# cd temp-mount-point # ufsrestore rvf dump-device # rm restoresymtable |
创建一个空的 install-db 文件。
这会使节点在下次重新引导时进入 VxVM 安装模式。
# touch /temp-mount-point/etc/vx/reconfig.d/state.d/install-db |
从 /temp-mount-point/etc/system 文件删除或注释调下列条目。
* rootdev:/pseudo/vxio@0:0 * set vxio:vol_rootdev_is_volume=1 |
编辑 /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 - |
卸载临时文件系统并检查该文件系统。
# cd / # umount temp-mount-point # fsck raw-disk-device |
在新磁盘上安装引导块。
# /usr/sbin/installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk raw-disk-device |
以单用户模式重新引导节点。
# reboot -- "-s" |
使用 scdidadm (1M) 更新磁盘 ID。
# scdidadm -R /dev/rdsk/c0t0d0 |
运行 vxinstall 以封装磁盘并重新引导。
# vxinstall |
如果与其它系统间存在次编号冲突,则卸载全局设备并为磁盘组重编次编号。
卸载群集节点上的全局设备文件系统。
# umount /global/.devices/node@nodeid |
为群集节点上的 rootdg 磁盘组重编次编号。
# vxdg reminor rootdg 100 |
关闭节点,再以群集模式重新引导该节点。
# shutdown -g0 -i6 -y |
下面的示例展示从磁带设备 /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 |
有关如何镜像已封装的根磁盘的说明,请参阅 《Sun Cluster 3.0 U1 安装指南》,恢复群集文件。