- 论坛徽章:
- 0
|
原文章http://docs.sun.com/db/doc/802-4215/6i82c9l08?l=zh&a=view
因为DISKSUITE 能够对根、SWAP、/USER做镜像,当你启动系统、或者硬件、操作错误,就会出现问题。在这里我们将解决这些潜在的问题。
启动问题的提前信息:
当元设备驱动因为错误离线时,应卸载硬盘的所有文件系统。因为每一个磁盘分区都是独立的,多个文件系统可能会挂载一个单独的磁盘上。如果元磁盘驱动出现故障,那么这个磁盘上的其他分区可能不久就会出错。直接挂载在磁盘分区的文件系统不能处理元磁盘的错误,让这样的文件系统挂载着会导致系统彻底毁坏、数据丢失。
当子镜像离线时尽量减少运行。在同步和在线备份时,开始镜像的全保护操作。
一. 怎样从不正确的/etc/vfstab条目中恢复
1. 怎样从不正确的/etc/vfstab条目中恢复(命令行)
如果你在/etc/vfstab文件中又不正确的条目,如:当镜像根/时,文件系统开始会正确的启动,然后出错。为了修复这种情况,你需要载单用户模式下编辑/etc/vfstab文件。
从/etc/vfstab文件修复的方法是:
l 启动系统到单用户模式。Boot –s
l 运行fsck,修复镜像得元设备。Fsck /dev/md/rdsk/d0
l 以堵写方式重新挂载文件系统
l 选择:对于根(/)镜像,运行metaroot命令
l 根据文件系统的元设备验证/etc/vfstab文件是否正确
l reboot
2. 举例:恢复根镜像
在下面的例子中,根镜像,d0。在/etc/vfstab中根条目回复到系统的原始分区,但是/etc/system仍然显示从镜像d0启动。可能的原因是metaroot命令没有维持/etc/system与/etc/vfstab,或者旧的/etc/vfstab被拷贝。如下图:
#device device mount FS fsck mount mount #to mount to fsck point type pass at boot options # /dev/dsk/c0t3d0s0 /dev/rdsk/c0t3d0s0 / ufs 1 no -- /dev/dsk/c0t3d0s1 -- -- swap -- no -- /dev/dsk/c0t3d0s6 /dev/rdsk/c0t3d0s6 /usr ufs 2 no -- # /proc -- /proc proc -- no -- fd -- /dev/fd fd -- no -- swap -- /tmp tmpfs-- yes --
由于这个原因,系统自动得启动进入单用户模式。
ok boot ... SunOS Release 5.5 Version Generic [UNIX(R) System V Release 4.0] Copyright (c) 1983-1995, Sun Microsystems, Inc. configuring network interfaces: le0. Hostname: antero mount: /dev/dsk/c0t3d0s0 is not this fstype. setmnt: Cannot open /etc/mnttab for writing INIT: Cannot create /var/adm/utmp or /var/adm/utmpx INIT: failed write of utmpx entry:" " INIT: failed write of utmpx entry:" " INIT: SINGLE USER MODE Type Ctrl-d to proceed with normal startup, (or give root password for system maintenance): <root-password>;
根据这点,root与/usr被只读挂起。
3. 运行fsck修复root镜像
fsck /dev/md/rdsk/d0
# fsck /dev/md/rdsk/d0
** /dev/md/rdsk/d0
** Currently Mounted on /
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3 - Check Connectivity
** Phase 4 - Check Reference Counts
** Phase 5 - Check Cyl groups
2274 files, 11815 used, 10302 free (158 frags, 1268 blocks,
0.7% fragmentation)
4. 然后已读写模式从新挂载root,编辑/etc/vfstab文件
# mount -o rw,remount /dev/md/dsk/d0 /
mount: warning: cannot lock temp file </etc/.mnt.lock>;
5. 运行metaroot
/usr/opt/SUNWmd/metaroot d0
6. 验证/etc/vfstab包含正确的元设备。
#device device mount FS fsck mount mount #to mount to fsck point type pass at boot options # /dev/md/dsk/d0 /dev/md/rdsk/d0 / ufs 1 no -- /dev/dsk/c0t3d0s1 -- -- swap -- no -- /dev/dsk/c0t3d0s6 /dev/rdsk/c0t3d0s6 /usr ufs 2 no -- # /proc -- /proc proc -- no -- fd -- /dev/fd fd -- no -- swap -- /tmp tmpfs-- yes --
7. Reboot.
二. 怎样从数据库复制不完全的情况下恢复
如果由于某些原因如驱动故障等数据库复制出错,系统不能重启。在disksiute中,数据库状态陈旧。通过一下方法恢复:
l 删除错误的数据库复制,重启。/////这个地方翻译不理想。Deleting the stale state database replicas and rebooting
l 修复出错的磁盘
l 增加恢复数据库复制状态////// Adding back the state database replica(s)
举例:
在下面的例子中,磁盘种有两个复制出现错误。着导致系统只有两个好的复制,并且系统不能重启。
启动机器确定那个数据库复制出现了问题。
ok boot ... Hostname: demo metainit: demo: stale databases Insufficient metadevice database replicas located. Use metadb to delete databases which are broken. Ignore any "Read-only file system" error messages. Reboot the system when finished to reload the metadevice database. After reboot, repair any broken database replicas which were deleted. Type Ctrl-d to proceed with normal startup, (or give root password for system maintenance): <root-password>; Entering System Maintenance Mode SunOS Release 5.5 Version Generic [UNIX(R) System V Release 4.0]
2. 用metadb命令查找元设备数据库状态,看那个复制的数据库出现了问题。
# /usr/opt/SUNWmd/metadb -i flags first blk block count a m p lu 16 1034 /dev/dsk/c0t3d0s3 a p l 1050 1034 /dev/dsk/c0t3d0s3 M p unknown unknown /dev/dsk/c1t2d0s3 M p unknown unknown /dev/dsk/c1t2d0s3 ...
系统不能发现在分区/dev/dsk/c1t2d0s3的数据库复制。Metadb命令标志了复制数据库得主块有问题。
3. 用metadb –d 删除在出错磁盘上的数据库复制品。因为root分区是只读的,可以忽略mddb.cf的出错消息。
# /usr/opt/SUNWmd/metadb -d -f c1t2d0s3 metadb: demo: /etc/opt/SUNWmd/mddb.cf.new: Read-only file system
4. 验证数据库复制品是否被删除。
# /usr/opt/SUNWmd/metadb -i flags first blk block count a m p lu 16 1034 /dev/dsk/c0t3d0s3 a p l 1050 1034 /dev/dsk/c0t3d0s3
5. Reboot.
6. 准备好备用的磁盘,关机,代替出错的磁盘,重启。用format命令根据原来的分区队心磁盘分区。
# halt ... boot ... # format /dev/rdsk/c1t2d0s0 ...
7. 用metadb命令增加数据库复制品。确定数据库状态是否正确。
# /usr/opt/SUNWmd/metadb -a -c 2 c1t2d0s3
# /usr/opt/SUNWmd/metadb flags first blk block count a m p luo 16 1034 dev/dsk/c0t3d0s3 a p luo 1050 1034 dev/dsk/c0t3d0s3 a u 16 1034 dev/dsk/c1t2d0s3 a u 1050 1034 dev/dsk/c1t2d0s3
用metadb –c 2 参数命令增加2个数据库复制品在同样的分区上。
希望对大家有所帮助!!!!! |
|