JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
System Administration Guide: Devices and File Systems
search filter icon
search icon

Document Information


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

Creating a format.dat Entry

How to Create a format.dat Entry

Automatically Configuring SCSI Disk Drives

How to Automatically Configure a SCSI Drive

Repairing a Defective Sector

How to Identify a Defective Sector by Using Surface Analysis

How to Repair a Defective Sector

Tips and Tricks for Managing Disks

Debugging format Sessions

Labeling Multiple Disks by Using the prtvtoc and fmthard Commands

12.  SPARC: Adding a Disk (Tasks)

13.  x86: Adding a Disk (Tasks)

14.  Configuring Oracle Solaris iSCSI Targets and Initiators (Tasks)

15.  The format Utility (Reference)

16.  Managing File Systems (Overview)

17.  Creating ZFS, UFS, TMPFS, and LOFS File Systems (Tasks)

18.  Mounting and Unmounting File Systems (Tasks)

19.  Using The CacheFS File System (Tasks)

20.  Configuring Additional Swap Space (Tasks)

21.  Checking UFS File System Consistency (Tasks)

22.  UFS File System (Reference)

23.  Backing Up and Restoring UFS File Systems (Overview)

24.  Backing Up UFS Files and File Systems (Tasks)

25.  Using UFS Snapshots (Tasks)

26.  Restoring UFS Files and File Systems (Tasks)

27.  UFS Backup and Restore Commands (Reference)

28.  Copying UFS Files and File Systems (Tasks)

29.  Managing Tape Drives (Tasks)


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:

How to Identify a Defective Sector by Using Surface Analysis

  1. Become superuser or assume an equivalent role.
  2. Unmount the file system in the slice that contains the defective sector.
    # umount /dev/dsk/device-name

    For more information, see mount(1M).

  3. Invoke the format utility.
    # format
  4. Select the affected disk.
    Specify disk (enter its number):1
    selecting c0t2d0:
    [disk formatted]
    Warning: Current Disk has mounted partitions.
  5. Select the analyze menu.
    format> analyze
  6. 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
  7. 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
            pass 1
    Block 12354  (18/4/18), Corrected media error (hard data ecc)
    Total of 1 defective blocks repaired.

How to Repair a Defective Sector

  1. Become superuser or assume an equivalent role.
  2. Invoke the format utility.
    # format
  3. Select the disk that contains the defective sector.
    Specify disk (enter its number): 1
    selecting c0t3d0
    [disk formatted]
  4. Select the repair command.
    format> repair
  5. 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.

    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.