Sun Microsystems, Inc.
spacerspacer
spacer www.sun.com docs.sun.com |
spacer
black dot
 
 
31.  Managing Disks (Overview) The format Utility Guidelines for Using the format Utility  Previous   Contents   Next 
   
 

Formatting a Disk

In most cases, disks are formatted by the manufacturer or reseller. So, they do not need to be reformatted when you install the drive. To determine if a disk is formatted, use the format utility. For more information, see "How to Determine if a Disk is Formatted".

If you determine that a disk is not formatted, use the format utility to format the disk.

When you format a disk, you accomplishes two steps:

  • The disk media is prepared for use

  • A list of disk defects based on a surface analysis is compiled


Caution - Formatting a disk is a destructive process because it overwrites data on the disk. For this reason, disks are usually formatted only by the manufacturer or reseller. If you think disk defects are the cause of recurring problems, you can use the format utility to do a surface analysis. However, be careful to use only the commands that do not destroy data. For details, see "How to Format a Disk".


A small percentage of total disk space that is available for data is used to store defect and formatting information. This percentage varies according to disk geometry, and decreases as the disk ages and develops more defects.

Formatting a disk might take anywhere from a few minutes to several hours, depending on the type and size of the disk.

About Disk Labels

A special area of every disk is set aside for storing information about the disk's controller, geometry, and slices. That information is called the disk's label. Another term that is used to described the disk label is the VTOC (Volume Table of Contents). To label a disk means to write slice information onto the disk. You usually label a disk after you change its slices.

If you fail to label a disk after you create slices, the slices will be unavailable because the operating system has no way of "knowing" about the slices.

Partition Table

An important part of the disk label is the partition table, which identifies a disk's slices, the slice boundaries (in cylinders), and the total size of the slices. You can display a disk's partition table by using the format utility. The following table describes partition table terminology.

Table 31-7 Partition Table Terminology

Partition Term

Value

Description

Number

0-7

Partition (or slice number). Valid numbers are 0-7.

Tag

0=UNASSIGNED 1=BOOT 2=ROOT 3=SWAP 4=USR 5=BACKUP 7=VAR 8=HOME

A numeric value that usually describes the file system mounted on this partition.

Flags

wm

The partition is writable and mountable.

 

wu rm

The partition is writable and unmountable. This is the default state of partitions that are dedicated for swap areas. (However, the mount command does not check the "not mountable" flag.)

 

rm

The partition is read only and mountable.

Partition flags and tags are assigned by convention and require no maintenance.

For more information on displaying the partition table, see "How to Display Disk Slice Information" or "How to Examine a Disk Label".

Displaying Partition Table Information

The following is an example of a partition table from a 1.05-Gbyte disk by using the format utility:

Total disk cylinders available: 2036 + 2 (reserved cylinders)

Part      Tag    Flag     Cylinders        Size            Blocks
  0       root    wm       0 -  300      148.15MB    (301/0/0)   303408
  1       swap    wu     301 -  524      110.25MB    (224/0/0)   225792
  2     backup    wm       0 - 2035     1002.09MB    (2036/0/0) 2052288
  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     525 - 2035      743.70MB    (1511/0/0) 1523088
  7 unassigned    wm       0               0         (0/0/0)          0

The partition table displayed by the format utility contains the following information:

Column Name

Description

Part

Partition (or slice number). See Table 31-7 for a description of this column.

Tag

Partition tag. See Table 31-7 for a description of this column.

Flags

Partition flag. See Table 31-7 for a description of this column.

Cylinders

The starting and ending cylinder number for the slice.

Size

The slice size in Mbytes.

Blocks

The total number of cylinders and the total number of sectors per slice in the far right column.

The following is an example of a disk label displayed by using the prtvtoc command.

# prtvtoc /dev/rdsk/c0t1d0s0
* /dev/rdsk/c0t1d0s0 partition map
*
* Dimensions:
*     512 bytes/sector
*      72 sectors/track
*      14 tracks/cylinder
*    1008 sectors/cylinder
*    2038 cylinders
*    2036 accessible cylinders
*
* Flags:
*   1: unmountable
*  10: read-only
*
*                          First     Sector    Last
* Partition  Tag  Flags    Sector     Count    Sector  Mount Directory
       0      2    00          0    303408    303407   /
       1      3    01     303408    225792    529199
       2      5    00          0   2052288   2052287
       6      4    00     529200   1523088   2052287   /usr

The prtvtoc command provides the following information:

Column Name

Description

Dimensions

This section describes the physical dimensions of the disk drive.

Flags

This section describes the flags listed in the partition table section. For a description of partition flags, see Table 31-7.

Partition (or Slice) Table

This section contains the following information:

Partition

Partition (or slice number). For a description of this column, see Table 31-7.

Tag

Partition tag. For a description of this column, see Table 31-7.

Flags

Partition flag. For a description of this column, see Table 31-7.

First Sector

The first sector of the slice.

Sector Count

The total number of sectors in the slice.

Last Sector

The last sector of the slice.

Mount Directory

The last mount point directory for the file system.

Dividing a Disk Into Slices

The format utility is most often used by system administrators to divide a disk into slices. The steps are as follows:

  • Determining which slices are needed

  • Determining the size of each slice

  • Using the format utility to divide the disk into slices

  • Labeling the disk with new slice information

  • Creating the file system for each slice

The easiest way to divide a disk into slices is to use the modify command from the partition menu of the format utility. The modify command allows you to create slices by specifying the size of each slice in Mbytes without having to keep track of the starting cylinder boundaries. The modify command also keeps tracks of any disk space that remains in the "free hog" slice.

 
 
 
  Previous   Contents   Next