Repairing a disk block with format
In this example, Solaris Volume Manager placed a submirror in "needs maintenance" state after repeated block read failures.
Jan 22 06:42:03 host unix: WARNING: /sbus@1f,0/SUNW,fas@e,8800000/sd@1,0 (
sd16):
Jan 22 06:42:03 host unix: Error for Command: read
Error Level: Fatal
Jan 22 06:42:03 host unix: Requested Block: 201568
Error Block: 201571
Jan 22 06:42:03 host unix: Vendor: SEAGATE
Serial Number: 9826126112
Jan 22 06:42:03 host unix: Sense Key: Media Error
Jan 22 06:42:03 host unix: ASC: 0x16 (data sync mark error), ASCQ:
0x0, FRU: 0xd2
Jan 22 06:42:03 host unix: WARNING: md: d21: read error on /dev/dsk/c0t1d0s1
Jan 22 06:42:03 host unix: WARNING: md: d21: /dev/dsk/c0t1d0s1 needs maintenance
Since the slice is in "needs maintenance" state, no reads or writes are
occurring on the slice, so we can examine the slice and attempt to
repair the bad block(s).
First, run prtvtoc to determine the starting and ending blocks for the slice.
# prtvtoc /dev/rdsk/c0t1d0s2
...
*
First Sector Last
* Partition Tag
Flags Sector
Count Sector Mount Directory
0 2
00
0 103680 103679
1 3 01 103680 1049760 1153439
...
To examine the slice, run format, select the disk, and select analyze.
Type setup to modify analysis parameters. Since only slice 1 was flagged as having problems, we want to limit our analysis to this slice.
analyze> setup
Analyze entire disk[yes]? no
Enter starting block number[0, 0/0/0]: 103680
Enter ending block number[8380799, 3879/15/134]: 1153439
Loop continuously[no]?
Enter number of passes[2]:
Repair defective blocks[yes]?
Stop after first error[no]?
Use random bit patterns[no]?
Enter number of blocks per transfer[126, 0/0/126]: 1
Verify media after formatting[yes]?
Enable extended messages[no]?
Restore defect list[yes]?
Restore disk label[yes]?
Type read to perform a read-only test. If a bad block is found, format will attempt to repair it.
analyze> read
Ready to analyze (won't harm SunOS). This takes a long time,
but is interruptable with CTRL-C. Continue? y
pass 0
Medium error during read: block 201571 (0x31363) (93/5/16)
ASC: 0x16 ASCQ: 0x0
Repairing hard error on 201571 (93/5/16)...ok.
533/15/81
pass 1
533/15/81
Total of 1 defective blocks repaired.
The block that was listed in /var/adm/messages as having read errors was repaired. No other bad blocks were found, so I re-enabled the metadevice.
More information:
http://www.sun.com/bigadmin/content/submitted/recover_sector_disk.html
Back to brandonhutchinson.com.
Last modified: 2007/01/24