XX省移动一台SUN F280R硬盘故障,并且没有做Raid1镜像,导致其业务中断。 还好用户曾经做过系统全备,只需恢复备份就行.
更换硬盘后,由于F280R没有磁带机,从另一台服务器下一台DAT72外置磁带机,连接到F280R
#reboot -- -r 重启F280R,重新扫描设备
{0} ok probe-scsi-all
/pci@8,700000/scsi@3
Target 0
Unit 0 Removable Tape HP C7438A ZP5
#boot cdrom –s 进光盘单用户
# format 重新分区
Searching for disks...done
AVAILABLE DISK SELECTIONS:
0. c1t0d0 <SUN72G cyl 14087 alt 2 hd 24 sec 424>
/pci@8,600000/SUNW,qlc@4/fp@0,0/ssd@w21000004cf9b6ca5,0
Specify disk (enter its number): 0
partition> p
Current partition table (unnamed):
Total disk cylinders available: 14087 + 2 (reserved cylinders)
Part Tag Flag Cylinders Size Blocks
0 root wm 0 - 6182 30.00GB (6183/0/0) 62918208
1 swap wu 6183 - 7007 4.00GB (825/0/0) 8395200
2 backup wu 0 - 14086 68.35GB (14087/0/0) 143349312
3 unassigned wm 7008 - 13808 33.00GB (6801/0/0) 69206976
4 unassigned wm 0 0 (0/0/0) 0
5 unassigned wm 0 0 (0/0/0) 0
6 unassigned wm 0 0 (0/0/0) 0
7 unassigned wm 0 0 (0/0/0) 0
partition> l
Ready to label disk, continue? y
#newfs /dev/rdsk/c1t0d0s0 重新格式化文件系统
# newfs /dev/dsk/c1t0d0s3
# mt rewind 回滚
# mount /dev/dsk/c1t0d0s0 /a
# cd /a
# ls
lost+found
# cd /dev/rmt
# ls
0 0bn 0cb 0cn 0hb 0hn 0lb 0ln 0mb 0mn 0u 0ubn
0b 0c 0cbn 0h 0hbn 0l 0lbn 0m 0mbn 0n 0ub 0un
# cd /
# mt status
HP DAT-72 tape drive:
sense key(0x0)= No Additional Sense residual= 0 retries= 0
file no= 0 block no= 0
# cd /a
# ufsrestore rf /dev/rmt/0n 恢复s0分区
Warning: ./lost+found: File exists
# cd /a
# ls
Q3Conf devices nsmail software
RC_CLI etc opt tmp
Siemens export patch21180.tar usr
TT_DB hid2_64 platform var
backlog.txt home proc vncviewer
baktest.sh kernel q3log.tar.Z vol
bin lib q3stat11 xfn
cdrom lost+found q3stat2117
core mnt restoresymtable
dev net sbin
# cd /a
# rm restoresymtable
# cd /
# umount /a
#
# mt status
HP DAT-72 tape drive:
sense key(0x0)= No Additional Sense residual= 0 retries= 0
file no= 1 block no= 0
# cd /
# mount /dev/dsk/c1t0d0s3 /a
c# d /a
# ls
lost+found
# pwd
/a
# cd /a
#
# ufsrestore rf /dev/rmt/0n 恢复S3分区
Warning: ./lost+found: File exists
# #
#
# cd /a
# ls
Q3bak SUNWrtvc app restoresymtable
SUNWconn TT_DB lost+found spots-pmc
SUNWebnfs UTStcp q3_bakall.tar spots.tgz
SUNWits VRTLlm q3inst.tar
# cd /
# cd /a
# rm restoresymtable
# cd /
# umount /a
#
# fsck /dev/dsk/c1t0d0s3
** /dev/dsk/c1t0d0s3
** Last Mounted on /a
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3 - Check Connectivity
** Phase 4 - Check Reference Counts
** Phase 5 - Check Cyl groups
27340 files, 3019548 used, 31060905 free (4873 frags, 3882004 blocks, 0.0% fragmentation)
#
# cd /usr/platform/sun4u/lib/fs/ufs 安装启动块
# installboot ./bootblk /dev/rdsk/c1t0d0s0
# cd /
# umount /a
# sync;reboot 重启
Rebooting with command: boot
Boot device: /pci@8,600000/SUNW,qlc@4/fp@0,0/disk@0,0:a File and args:
SunOS Release 5.8 Version Generic_108528-29 64-bit
Copyright 1983-2003 Sun Microsystems, Inc. All rights reserved.
configuring IPv4 interfaces: hme0.
Hostname: WHQ3
/dev/dsk/c1t0d0s1: No such device or address
The / file system (/dev/rdsk/c1t0d0s0) is being checked.
Can't open /dev/rdsk/c1t0d0s0
/dev/rdsk/c1t0d0s0: CAN'T CHECK FILE SYSTEM.
/dev/rdsk/c1t0d0s0: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.
WARNING - Unable to repair the / filesystem. Run fsck
manually (fsck -F ufs /dev/rdsk/c1t0d0s0). Exit the shell when
done to continue the boot process.
Type control-d to proceed with normal startup,
(or give root password for system maintenance):
single-user privilege assigned to /dev/console.
Entering System Maintenance Mode
Jun 21 20:09:29 su: 'su root' succeeded for q3su on /dev/console
Sun Microsystems Inc. SunOS 5.8 Generic Patch February 2004
You have new mail.
# fsck -F ufs /dev/rdsk/c1t0d0s0
Can't open /dev/rdsk/c1t0d0s0
# format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
0. c1t1d0 <SUN72G cyl 14087 alt 2 hd 24 sec 424>
/pci@8,600000/SUNW,qlc@4/fp@0,0/ssd@w500000e01045b4b1,0
Specify disk (enter its number): ^D
重启发现无法正常进系统,format能看到c1t0d0硬盘,而fsck提示无法找到c1t0d0。
分析原因由于更换后硬盘,恢复的备份是原来的硬盘WWN号,所以提示找不到硬盘.应更新下WWN号
# mount /dev/dsk/c1t0d0s0 /a
# cd /a
# drvconfig -r /a -p /a/etc/path_to_inst
# cd /devices
# find . -print| cpio -pduVm /a/devices
..................................................
..................................................
..................................................
..................................................
..................................................
..................................................
.............................
0 blocks
# disks -r /a
# devlinks -r /a
# luxadm set_boot_dev /dev/dsk/c1t0d0s0
Do you want to change boot-device to the new setting? (y/n) y
#
#
# cd /
# umount /a
# fsck /dev/dsk/c1t0d0s0
** /dev/dsk/c1t0d0s0
** Last Mounted on /a
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3 - Check Connectivity
** Phase 4 - Check Reference Counts
** Phase 5 - Check Cyl groups
54292 files, 2317293 used, 28666393 free (7161 frags, 3582404 blocks, 0.0% fragmentation)
# sync;reboot
syncing file systems... done
rebooting...
Resetting ...
重启后正常