Document Information 
Preface 
1.  Managing Removable Media (Overview) 
2.  Managing Removable Media (Tasks) 
3.  Accessing Removable Media (Tasks) 
4.  Writing CDs and DVDs (Tasks) 
5.  Managing Devices (Overview/Tasks) 
6.  Dynamically Configuring Devices (Tasks) 
7.  Using USB Devices (Overview) 
8.  Using USB Devices (Tasks) 
9.  Using InfiniBand Devices (Overview/Tasks) 
10.  Managing Disks (Overview) 
11.  Administering Disks (Tasks) 
Administering Disks (Task Map) 
Identifying Disks on a System 
How to Identify the Disks on a System 
Formatting a Disk 
How to Determine if a Disk Is Formatted 
How to Format a Disk 
Displaying Disk Slices 
How to Display Disk Slice Information 
Creating and Examining a Disk Label 
How to Label a Disk 
How to Examine a Disk Label 
Recovering a Corrupted Disk Label 
How to Recover a Corrupted Disk Label 
Adding a Third-Party Disk 
How to Create a format.dat Entry 
Automatically Configuring SCSI Disk Drives 
How to Automatically Configure a SCSI Drive 
Tips and Tricks for Managing Disks 
12.  SPARC: Adding a Disk (Tasks) 
13.  x86: Adding a Disk (Tasks) 
14.  Configuring Solaris iSCSI Targets and Initiators (Tasks) 
15.  Configuring and Managing the Solaris Internet Storage Name Service (iSNS) 
16.  The format Utility (Reference) 
17.  Managing File Systems (Overview) 
18.  Creating UFS, TMPFS, and LOFS File Systems (Tasks) 
19.  Mounting and Unmounting File Systems (Tasks) 
20.  Using The CacheFS File System (Tasks) 
21.  Configuring Additional Swap Space (Tasks) 
22.  Checking UFS File System Consistency (Tasks) 
23.  UFS File System (Reference) 
24.  Backing Up and Restoring File Systems (Overview) 
25.  Backing Up Files and File Systems (Tasks) 
26.  Using UFS Snapshots (Tasks) 
27.  Restoring Files and File Systems (Tasks) 
28.  UFS Backup and Restore Commands (Reference) 
29.  Copying UFS Files and File Systems (Tasks) 
30.  Managing Tape Drives (Tasks) 
Index 
 | 
      
	       	 
             
Repairing a Defective Sector
If a disk on your system has a defective sector, you can
repair the disk by following procedures in this section. You might become aware
of defective sectors when you do the following: 
Run surface analysis on a disk For more information on the analysis feature of the format utility, see analyze Menu. The defective area reported while your system is running might not be accurate. Because the system does disk operations many sectors at a time, it is often hard to pinpoint exactly which sector caused a given error. To find the exact sector or sectors, use How to Identify a Defective Sector by Using Surface Analysis.  
Get multiple error messages from the disk driver concerning a particular portion of the disk while your system is running. Console messages that are related to disk errors appear similar to the following: WARNING: /io-unit@f,e0200000/sbi@0,0/QLGC,isp@1,10000/sd@3,0 (sd33):
    Error for command 'read' Error Level: Retryable
    Requested Block 126, Error Block: 179
    Sense Key: Media Error
    Vendor 'name':
    ASC = 0x11 (unrecovered read error), ASCQ = 0x0, FRU = 0x0This message indicates that block 179 might be defective. You would relocate the bad block by using the format utility's repair command. Or, you would use the analyze command with the repair option enabled.  
How to Identify a Defective Sector by Using Surface Analysis
- Become superuser or assume an equivalent role.
 
- Unmount the file system in the slice that contains the defective sector.
# umount /dev/dsk/device-name For more information, see mount(1M).  
- Invoke the format utility.
# format  
- Select the affected disk.
Specify disk (enter its number):1
selecting c0t2d0:
[disk formatted]
Warning: Current Disk has mounted partitions.  
- Select the analyze menu.
format> analyze  
- Set up the analysis parameters by typing setup at the analyze> prompt.
Use the parameters shown here: analyze> setup
Analyze entire disk [yes]? n
Enter starting block number [0, 0/0/0]: 12330
Enter ending block number [2052287, 2035/13/71]: 12360
Loop continuously [no]? y
Repair defective blocks [yes]? n
Stop after first error [no]? n
Use random bit patterns [no]? n
Enter number of blocks per transfer [126, 0/1/54]: 1
Verify media after formatting [yes]? y
Enable extended messages [no]? n
Restore defect list [yes]? y
Create defect label [yes]? y  
- Find the defect by using the read command.
analyze> read
Ready to analyze (won't harm SunOS). This takes a long time,
but is interruptible with Control-C. Continue? y
        pass 0
   2035/12/1825/7/24
        pass 1
Block 12354  (18/4/18), Corrected media error (hard data ecc)
   25/7/24
^C
Total of 1 defective blocks repaired.  
How to Repair a Defective Sector
- Become superuser or assume an equivalent role.
 
- Invoke the format utility.
# format  
- Select the disk that contains the defective sector.
Specify disk (enter its number): 1
selecting c0t3d0
[disk formatted]
format>   
- Select the repair command.
format> repair  
- Type the defective block number.
Enter absolute block number of defect: 12354
   Ready to repair defect, continue? y
   Repairing block 12354 (18/4/18)...ok.
format> If you are unsure of the format that is used to identify the
defective sector, see How to Identify a Defective Sector by Using Surface Analysis for more information.    
          
       |