System Administration Guide, Volume I

How to Recover a Corrupted Disk Label

  1. Boot the system to single-user mode. If necessary, boot the system from a local CD-ROM or the network in single-user mode to access the disk.

    See Chapter 8, Booting a SPARC System (Tasks) or Chapter 9, x86: Booting a System (Tasks) for information on booting the system.

  2. Use the format utility to relabel the disk.


    # format
    

    At this point, format attempts to automatically configure any unlabeled SCSI disk. If format is able to configure the unlabeled and corrupted disk, it will display:


    cwtxdy: configured with capacity of abcMB

    The format utility then displays the list of disks on the system.

  3. Enter the number of the disk that you need to recover from the list displayed on your screen.


    Specify disk (enter its number): 1
    
  4. Use the table below to determine how to label the disk.

    If the Disk was Successfully Configured ... 

    If the Disk was not Successfully Configured ... 

    Follow steps 5 and 6. Then go to step 12. 

    Follow steps 7-11. Then go to step 12. 

  5. Search for the backup label by using the verify command.


    format> verify
    Warning: Could not read primary label.
    Warning: Check the current partitioning and 'label' the disk or 
    use the 'backup' command.
    Backup label contents:
    Volume name = <        >
    ascii name  = <SUN0424 cyl 1151 alt 2 hd 9 sec 80>
    pcyl        = 2500
    ncyl        = 1151
    acyl        =    2
    nhead       =    9
    nsect       =   80
    Part     Tag    Flag    Cylinders      Size      Blocks
      0       root   wm      0 -   91   32.34MB   (92/0/0)   66240
      1       swap   wu     92 -  183   32.34MB   (92/0/0)   66240
      2     backup   wu      0 - 1150  404.65MB  (1151/0/0) 828720
      3 unassigned   wm      0              0      (0/0/0)       0
      4 unassigned   wm      0              0      (0/0/0)       0
      5 unassigned   wm      0              0      (0/0/0)       0
      6        usr   wm    184 - 1150   339.96MB  (967/0/0) 696240
      7 unassigned   wm      0              0      (0/0/0)       0
  6. If format was able to find a backup label and the backup label contents appear satisfactory, use the backup command to label the disk with the backup label.


    format> backup
    Disk has a primary label, still continue? y
     
    Searching for backup labels...found.
    Restoring primary label

    The disk label has been recovered. Go to step 12.

  7. If format was not able to automatically configure the disk, specify the disk type using the type command.


    format> type
    

    The format utility displays the Available Drives Type menu.

  8. Select 0 to automatically configure the disk, or select a disk type from the list of possible disk types.


    Specify disk type (enter its number)[8]: 8
    
  9. If the disk was successfully configured, reply with no when format asks if you want to label the disk.


    Disk not labeled.  Label it now?  no
    
  10. Use the verify command to search for backup labels.


    format> verify
    Warning: Could not read primary label.
    Warning: Check the current partitioning and 'label' the disk
    or use the 'backup' command.
    .
    .
    .
  11. If format was able to find a backup label and the backup label contents appear satisfactory, use the backup command to label the disk with the backup label.


    format> backup
    Disk has a primary label, still continue? y
     
    Searching for backup labels...found.
    Restoring primary label

    The disk label has been recovered.

  12. Exit the format utility by typing q.


    format> q
    
  13. Verify the file systems on the recovered disk by using the fsck command.

    See Chapter 31, Checking File System Integrity for information about using the fsck command.