Previous Table of Contents Next

Adding Defect List, Format, Partition, and Label Disk (format)

Follow these steps to put a defect list on a new disk, format, partition, and label it:

CAUTION! You must format the disk after you add the defect list. Any data on the disk will be destroyed by formatting. If the disk is not new, be sure the data is backed up before you proceed. See Chapter 4, "Administering File Systems," for complete information on how to back up and restore file systems.
1.  Become superuser.
2.  Type format and press Return. A list of available disks is displayed:
    Ø. cØtØdØ at scsibusØ slave 24
    sdØ: <SUNØ2Ø7 cyl 1254 alt 2 hd 9 sec 36>
3.  Type the number of the new disk from the list that is displayed. The Format menu and the format> prompt are displayed.
4.  Type defect and press Return.
5.  Type primary and press Return. The original defect list is added to the disk:
   defect> primary
   Extracting primary defect list . . . Extraction complete.
   Current Defect List updated, 
   total of 3Ø defects.
6.  Type quit and press Return. The format> prompt is displayed.
7.  Type format and press Return. The disk begins formatting. Formatting takes about 10 minutes for a 107-Mbyte disk, longer for bigger disks.
8.  When the format > prompt is redisplayed, type partition and press Return.
9.  Re-create the partitions to match the partitions on the defective disk.
10.  Type label and press Return. The disk is labeled.
11.  Type quit and press Return. The Format menu and format> prompt are redisplayed.
12.  Type quit and press Return. The shell prompt is redisplayed:
oak% su
# format
Searching for disks...done

        Ø. sdØ at espØ slave 24
           sdØ: <SUNØ2Ø7 cyl 1254 alt 2 hd 9 sec 36>
        1. sd2 at espØ slave 16
           sd2: <SUNØ2Ø7 cyl 1254 alt 2 hd 9 sec 36>
Specify disk (enter its number): 1
selecting cØtØdØ
[disk formatted]
        disk       - select a disk
        type       - select (define) a disk type
        partition  - select (define) a partition table
        current    - describe the current disk
        format     - format and analyze the disk
        repair     - repair a defective sector
        label      - write label to the disk
        analyze    - surface analysis
        defect     - defect list management
        backup     - search for backup labels
        verify     - read and display labels
        save       - save new disk/partition definitions
        inquiry    - show vendor, product and revision
        volname    - set 8-character volume name
format > defect
defect > primary
Extracting primary defect list . . . Extraction complete.
Current Defect List updated, total of 3Ø defects.
defect > quit
format > format
format> partition
        Ø      - change 'Ø' partition
        1      - change '1' partition
        2      - change '2' partition
        3      - change '3' partition
        4      - change '4' partition
        5      - change '5' partition
        6      - change '6' partition
        7      - change '7' partition
        select - select a predefined table
        modify - modify a predefined partition table
        name   - name the current table
        print  - display the current table
        label  - write partition map and label to the disk
partition> <partition the disk>
partition> label
partition> quit
format > quit

Remaking the File Systems (Newfs)

A disk must be formatted, partitioned, and labeled before you can create ufs file systems on it. If you are re-creating an existing ufs file system, unmount the file system before following these steps:

1.  Become superuser.
2.  Type newfs /dev/rdsk/cntndnsn and press Return. You are asked if you want to proceed.

CAUTION! Be sure you have specified the correct device name for the partition before performing the next step. If you specify the wrong partition, you will erase its contents when the new file system is created.
3.  Type y to confirm. The newfs command uses optimized default values to create the file system.

This example creates a file system on /dev/rdsk/c0t3d0s7:

oak% su
# newfs /dev/rdsk/cØt3dØs7
newfs: construct a new file system /dev/rdsk/cØt3dØs7 (y/n)? y
/dev/rdsk/cØt3dØs7:     163944 sectors in 5Ø6 cylinders of 9 tracks,
        36 sectors 83.9MB in 32 cyl groups (16 c/g, 2.65MB/g, 1216 i/g)
super-block backups (for fsck -b #) at:
 32, 5264, 1Ø496, 15728, 2Ø96Ø, 26192, 31424, 36656, 41888,
 4712Ø, 52352, 57584, 62816, 68Ø48, 7328Ø, 78512, 82976, 882Ø8,
 9344Ø, 98672, 1Ø39Ø4, 1Ø9136, 114368, 1196ØØ, 124832, 13ØØ64, 135296,
 14Ø528, 14576Ø, 15Ø992, 156224, 161456,

Mounting the File System on a Temporary Mount Point (mount)

Type mount /dev/dsk /cntndnsn /mnt and press Return. The file system is mounted on the /mnt temporary mount point. To mount the disk, specify the block device directory (/dev/dsk), not the raw device directory.

Previous Table of Contents Next