M W p l 16400 unknown /dev/dsk/c1t1d0s7 #
3. 解决方法1(修改system文件)
3.1. 进入ok模式
在维护模式输入init 0进入ok模式
# init 0
# svc.startd: The system is coming down. Please wait. svc.startd: 81 system services are now being stopped. svc.startd: The system is down. syncing file systems... done Program terminated ok ok
3.2. 从光盘引导进入单用户模式
把盘放入光驱,boot cdrom –s从光盘引导进入单用户模式
ok boot cdrom -s
Sun Ultra 45 Workstation, No Keyboard
Copyright 2005 Sun Microsystems, Inc. All rights reserved. OpenBoot 4.21.2, 4096 MB memory installed, Serial #68148048. Ethernet address 0:14:4f:f:db:50, Host ID: 840fdb50.
Rebooting with command: boot cdrom -s
Boot device: /pci@1e,600000/pci@0/pci@1/pci@0/ide@1f/cdrom@0,0:f File and args: -s SunOS Release 5.10 Version Generic_147440-01 64-bit
Copyright (c) 1983, 2011, Oracle and/or its affiliates. All rights reserved. WARNING: i2c_0 failed to add interrupt.
WARNING: i2c_0 operating in POLL MODE only
WARNING: i2c_1 failed to add interrupt.
WARNING: i2c_1 operating in POLL MODE only
WARNING: i2c_0 failed to add interrupt
WARNING: Failed to open device(/pci@1f,700000:devctl), rv(19)
WARNING: ppm_init_cb: ppm domain domain_pciegfx will be offline. Booting to milestone \Configuring devices.
Using RPC Bootparams for network configuration information. Attempting to configure interface ce3... Skipped interface ce3
Attempting to configure interface ce2... Skipped interface ce2
Attempting to configure interface ce1... Skipped interface ce1
Attempting to configure interface ce0... Configured interface ce0
Attempting to configure interface bge1... Skipped interface bge1
Attempting to configure interface bge0... Skipped interface bge0
Requesting System Maintenance Mode SINGLE USER MODE #
3.3. 修改/etc/system文件
在format中查看硬盘,找到系统根目录所在分区,并把该分区挂载给/a。
# format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
0. c1t0d0
format> p
partition> p
Current partition table (original):
Total disk cylinders available: 65533 + 2 (reserved cylinders)
Part Tag Flag Cylinders Size Blocks
0 root wm 4685 - 21080 34.18GB (16396/0/0) 71683312 1 swap wu 0 - 4684 9.77GB (4685/0/0) 20482820 2 backup wm 0 - 65532 136.62GB (65533/0/0) 286510276 3 home wm 21081 - 28107 14.65GB (7027/0/0) 30722044 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 28108 - 28113 12.81MB (6/0/0) 26232
partition> # #
# mount /dev/dsk/c1t0d0s0 /a //把c1t0d0s0分区mount到/a目录
有时会提示需要fsck先检测磁盘的文件系统,如果文件系统损坏则无法mount #
# TERM=vt100;export TERM; //修改当前环境变量,用户vi编辑 # cd /a/etc //进入/a/etc/目录,不要直接vi /etc/system #cp system system.bak //备份system文件
# vi system //编辑/a/etc/system文件
* Begin MDD root info (do not edit) rootdev:/pseudo/md@0:0,100,blk * End MDD root info (do not edit)
set md:mirrored_root_flag=1 //最后加入这一行,用户在metadb 仅一半有效时
候仍能启动系统
3.4. Umount目录/a
编辑好/a/etc/system文件后,取消mount的/a目录,不mount可能会出现挂载问题;
# cd / //回到根目录, # umount /a //umount 目录/a
3.5. 重启系统并查看系统状态
重启系统,并查看系统状态。
# init 6
syncing file systems... done Program terminated
Sun Ultra 45 Workstation, No Keyboard
Copyright 2005 Sun Microsystems, Inc. All rights reserved. OpenBoot 4.21.2, 4096 MB memory installed, Serial #68148048. Ethernet address 0:14:4f:f:db:50, Host ID: 840fdb50.
Rebooting with command: boot
Boot device: /pci@1e,600000/pci@0/pci@9/pci@0/scsi@1/disk@0,0 File and args: SunOS Release 5.10 Version Generic_147147-26 64-bit
Copyright (c) 1983, 2013, Oracle and/or its affiliates. All rights reserved. Hostname: test-01
test-01 console login: root Password:
Last login: Mon Mar 24 11:54:36 on console
Mar 24 12:19:21 test-01 login: ROOT LOGIN /dev/console
Oracle Corporation SunOS 5.10 Generic Patch January 2005 # # # bash
bash-3.2# df -h
Filesystem size used avail capacity Mounted on /dev/md/dsk/d100 34G 4.7G 29G 15% / /devices 0K 0K 0K 0% /devices
ctfs 0K 0K 0K 0% /system/contract proc 0K 0K 0K 0% /proc mnttab 0K 0K 0K 0% /etc/mnttab swap 13G 1.7M 13G 1% /etc/svc/volatile objfs 0K 0K 0K 0% /system/object sharefs 0K 0K 0K 0% /etc/dfs/sharetab /platform/sun4u-us3/lib/libc_psr/libc_psr_hwcap1.so.1 34G
4.7G
29G
/platform/sun4u-us3/lib/libc_psr.so.1
/platform/sun4u-us3/lib/sparcv9/libc_psr/libc_psr_hwcap1.so.1
15%
34G 4.7G 29G 15%
/platform/sun4u-us3/lib/sparcv9/libc_psr.so.1
fd 0K 0K 0K 0% /dev/fd swap 13G 40K 13G 1% /tmp swap 13G 40K 13G 1% /var/run /dev/md/dsk/d130 14G 15M 14G 1% /export/home /vol/dev/dsk/c0t0d0/sol_10_811_sparc
2.1G 2.1G 0K 100% /cdrom/sol_10_811_sparc bash-3.2# bash-3.2# bash-3.2# metadb
flags first blk block count
a m p luo 16 8192 /dev/dsk/c1t0d0s7 a p luo 8208 8192 /dev/dsk/c1t0d0s7 a p luo 16400 8192 /dev/dsk/c1t0d0s7 M W p l 16 unknown /dev/dsk/c1t1d0s7 M W p l 8208 unknown /dev/dsk/c1t1d0s7 M W p l 16400 unknown /dev/dsk/c1t1d0s7 bash-3.2# metastat d130: Mirror
Submirror 0: d131 State: Okay Submirror 1: d132
State: Needs maintenance Pass: 1
Read option: roundrobin (default) Write option: parallel (default) Size: 30722044 blocks (14 GB)
d131: Submirror of d130 State: Okay
Size: 30722044 blocks (14 GB) Stripe 0:
Device Start Block Dbase State Reloc Hot Spare c1t0d0s3 0 No Okay Yes
d132: Submirror of d130 State: Needs maintenance
Invoke: metareplace d130 c1t1d0s3
Device Start Block Dbase State Reloc Hot Spare c1t1d0s3 0 No Maintenance Yes