Sun Microsystems Logo
Products & Services
 
Support & Training
 
 

Previous Previous     Contents     Index     Next Next

When to Use the format Utility

Disk drives are partitioned and labeled by the Solaris installation program when you install the Solaris release. You can use the format utility to do the following:

  • Display slice information

  • Divide a disk into slices

  • Add a disk drive to an existing system

  • Format a disk drive

  • Label a disk

  • Repair a disk drive

  • Analyze a disk for errors

The main reason a system administrator uses the format utility is to divide a disk into disk slices. These steps are covered in Chapter 34, SPARC: Adding a Disk (Tasks) and Chapter 35, x86: Adding a Disk (Tasks).

See the following section for guidelines on using the format utility.

Guidelines for Using the format Utility

Table 32-6 The format Utility Guidelines

Task

Guidelines

For More Information

Format a disk

  • Any existing data is destroyed when you reformat a disk.

  • The need for formatting a disk drive has dropped as more and more manufacturers ship their disk drives formatted and partitioned. You might not need to use the format utility when you add a disk drive to an existing system.

  • If a disk has been relocated and is displaying a lot of disk errors, you can attempt to reformat it, which will automatically remap any bad sectors.

How to Format a Disk 

Replace a system disk

  • Data from the damaged system disk must be restored from a backup medium. Otherwise, the system will have to be reinstalled by using the installation program.

SPARC: How to Connect a System Disk and Boot or x86: How to Connect a System Disk and Boot or if the system must be reinstalled, Solaris 9 12/03 Installation Guide

Divide a disk into slices

  • Any existing data is destroyed when you repartition and relabel a disk with existing slices.

  • Existing data must be copied to backup media before the disk is repartitioned and restored.

SPARC: How to Create Disk Slices and Label a Disk or x86: How to Create Disk Slices and Label a Disk

Add a secondary disk to an existing system

  • Any existing data must be restored from backup media if the secondary disk is reformatted or repartitioned.

SPARC: How to Connect a Secondary Disk and Boot or x86: How to Connect a Secondary Disk and Boot

Repair a disk drive

  • Some customer sites prefer to replace rather than repair defective drives. If your site has a repair contract with the disk drive manufacturer, you might not need to use the format utility to repair disk drives.

  • The repair of a disk drive usually means that a bad sector is added to a defect list. New controllers remap bad sectors automatically with no system interruption.

  • If the system has an older controller, you might need to remap a bad sector and restore any lost data.

Repairing a Defective Sector 

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! 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) on a disk with a VTOC label. 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 32-7 Partition Table Terminology

Partition Term

Value

Description

Number

0-7

VTOC - Partitions or slices, numbered 0-7.

EFI - Partitions or slices, numbered 0-6.

Tag

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

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 4.0-Gbyte disk with a VTOC label displayed from the format utility:

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

Part      Tag    Flag     Cylinders        Size            Blocks
  0       root    wm    1110 - 4687        1.61GB    (0/3578/0) 3381210
  1       swap    wu       0 - 1109      512.00MB    (0/1110/0) 1048950
  2     backup    wm       0 - 8891        4.01GB    (0/8892/0) 8402940
  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 unassigned    wm       0               0         (0/0/0)          0
  7       home    wm    4688 - 8891        1.89GB    (0/4204/0) 3972780

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

Column Name

Description

Part

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

Tag

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

Flags

Partition flag. See Table 32-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.

First Sector

EFI - The starting block number.

Last Sector

EFI - The ending block number.

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

# prtvtoc /dev/rdsk/c4t1d0s0
* /dev/rdsk/c4t1d0s0 partition map
*
* Dimensions:
*     512 bytes/sector
* 2576941056 sectors
* 2576940989 accessible sectors
*
* Flags:
*   1: unmountable
*  10: read-only
*
*                           First     Sector    Last
* Partition  Tag  Flags     Sector     Count    Sector   Mount Directory
       0      2    00          34   629145600  629145633
       1      4    00   629145634   629145600 1258291233
       6      4    00  1258291234  1318633404 2576924637
       8     11    00  2576924638       16384 2576941021
* Flags:
*   1: unmountable
*  10: read-only
*

Previous Previous     Contents     Index     Next Next