System Administration Guide, Volume 1

Formatting Diskettes Task Map

Table 16-1 Formatting Diskettes Task Map

Task 

Description 

For Instructions, Go To ... 

1. Load Unformatted Diskette 

Insert the diskette into the drive and enter the volcheck command.

"How to Load a Diskette"

2. Format the Diskette 

Format the diskette for UFS.  

"How to Format a UFS Diskette"

 

Format the diskette for DOS.  

"How to Format a DOS Diskette"

3. Add a UFS File System 

UFS Only. Optional. To use the diskette for files, add a UFS file system. To use for characters, skip this step.

"How to Place a UFS File System on a Diskette"

4. Eject the Diskette  

When finished formatting, always eject the diskette, even if you are going to use it again right away. 

"How to Eject a Diskette"

Using Diskette Names

When working with diskettes, you can identify them by name or with a designator from Table 16-2. For brevity, task descriptions use floppy0, but you can replace this with either the diskette name or a different designator.

Table 16-2 How to Identify Diskettes

Diskette 

Alternate Name 

First diskette drive 

floppy0

Second diskette drive 

floppy1

Third diskette drive 

floppy2


Note -

Diskettes that are not named (that is, they have no "label") are assigned the default name of noname.


Hardware Considerations

A Solaris system can format diskettes for use on both Solaris and DOS systems. However, the hardware platform imposes some limitations. They are summarized in the table below.

Solaris On This Platform ... 

Can Format Diskettes For ... 

SPARC based systems 

UFS 

 

MS-DOS or NEC-DOS (PCFS) 

IA based systems 

UFS 

 

MS-DOS or NEC-DOS (PCFS) 

Diskettes formatted for UFS are restricted to the hardware platform on which they were formatted. In other words, a UFS diskette formatted on a SPARC based platform cannot be used for UFS on an IA platform, nor can a diskette formatted on an IA platform be used on a SPARC based platform. This is because the SPARC and IA UFS formats are different. SPARC uses little-endian bit coding, IA uses big-endian.

A complete format for SunOS file systems consists of the basic "bit" formatting plus the structure to support a SunOS file system. A complete format for a DOS file system consists of the basic "bit" formatting plus the structure to support either an MS-DOS or an NEC-DOS file system. The procedures required to prepare a diskette for each type of file system are different. Therefore, before you format a diskette, consider which procedure to follow. See "Formatting Diskettes Task Map".

On a Solaris system (either SPARC or IA), you can format diskettes of seven different densities (provided you have the appropriate drive).

Diskette Size 

Diskette Density 

Capacity 

3.5"  

Extended Density 

2.88 Mbytes 

3.5" 

High Density (HD) 

1.44 Mbytes 

3.5" 

Medium Density (DD) 

1.2 Mbytes 

3.5" 

Low Density 

720 Kbytes 

5.25" 

High Density (HD) 

1.2 Mbytes 

5.25" 

Medium Density (DD) 

720 Kbytes 

5.25" 

Low Density 

360 Kbytes 

By default, the diskette drive formats a diskette to a like density. In other words, a 1.44 Mbyte drive attempts to format a diskette for 1.44 Mbytes, whether the diskette is in fact a 1.44 Mbyte diskette or not--unless you instruct it otherwise. You can tell a 1.44 Mbyte drive to format a diskette to, for instance, 720 Kbytes. You cannot, however, instruct a 720 Kbyte drive to format a diskette to 1.44 Mbyte. In other words, a diskette can be formatted to its capacity or lower, and a drive can format to its capacity or lower.

To instruct a drive to format a diskette to a non-default density, use the fdformat command as instructed in the following tasks, but use the appropriate density option from the table below.

Table 16-3 Density Options

To Format A Diskette With This Density ... 

In A Drive With This Default Density ... 

Specify This fdformat Density Option ...

2.88 Mbytes  

2.88 Mbytes 

-E

1.44 Mbytes 

2.88 Mbytes 

-H

1.44 Mbytes 

1.44 Mbytes 

none 

1.2 Mbytes 

1.44 Mbytes 

-t nec -M

720 Kbytes 

1.44 Mbytes 

-D or -t dos -D

1.2 Mbytes 

1.2 Mbytes 

none 

720 Kbytes 

1.2 Mbytes 

-D

720 Kbytes 

720 Kbytes 

none 

360 Kbytes 

720 Kbytes 

-D

To view all the options to the fdformat command, either see fdformat(1) or enter fdformat -z. The -z option displays all the options to the command.

If you don't know the default density of your drive, begin the formatting process with the default setting (that is, no density options) and observe the configuration message. It will look something like this:


Formatting 1.44 M in /vol/dev/rdiskette0/unformatted
Press return to start formatting floppy.

The confirmation message indicates the drive's default density. For instance, in the example above, the default density of the drive is 1.44 Mbytes. If the density is not what you expected, use Control-c to escape the formatting process and start over.

How to Format a UFS Diskette

As mentioned in "Hardware Considerations", a UFS diskette formatted on a SPARC based platform can only be used on another SPARC based platform, and a UFS diskette formatted on an IA platform can only be used on an IA based system.


Caution - Caution -

Formatting a diskette erases any pre-existing content.


  1. Quit File Manager.

    File Manager automatically displays a formatting window when you insert an unformatted diskette. To avoid the window, quit from File Manager. If you prefer to keep File Manager open, quit the formatting window when it appears.

  2. Make sure the diskette is write-enabled.

    On both 3.5-inch and 5.25 inch diskettes, write-protection is controlled by a small tab in either the lower left or lower right corner. If you can see through the square hole behind the tab, the diskette is write-protected. If the hole is covered by the tab, the diskette is write-enabled. (If you need to eject the diskette to examine it, simply type eject floppy in a shell.)

  3. Insert the diskette.

    Make sure the diskette is completely inserted.

  4. Invoke formatting.


    $ fdformat -v -U [density-options convenience-options]

    -v

    Verifies whether the diskette was formatted correctly. 

    -U

    Unmounts the diskette if it is mounted. 

    density-options

    If the drive density is 1.44 Mbytes, density-options are:

     

    --none--

    Formats a 1.44 Mbyte diskette. 

     

    -D

    Formats a 720 Kbyte diskette. 

     

     

    Lists all the options to the fdformat command, but does not format the diskette..

    convenience-options

     

     

    -e

    Ejects the diskette when done formatting. 

     

    -f

    Forces formatting without asking for confirmation. 

     

    -b label

    Names the diskette. label must be eight characters or less, upper or lower case.

     

    -z

    Lists all the options to the fdformat command, but does not format the diskette.


    Note -

    If you try to format a 720 Kbyte (DD) diskette for 1.44 Mbytes, fdformat will not stop you unless you include the -v option. With the -v option, fdformat will format the diskette, but the verification will catch the error and notify you with the following message: fdformat: check diskette density, I/O error


    The fdformat command displays a confirmation message (unless you used the -f option), indicating the type of formatting to be performed:


    Formatting 1.44 M in /vol/dev/rdiskette0/unformatted
    Press return to start formatting floppy.
  5. Select one of the options in the table below.

    To ... 

    Press ... 

    Confirm the type of formatting  

    Return (unless you used the -f option in the previous step, in which case no confirmation is necessary)

    Cancel formatting  

    Control-c 

    As the formatting progresses, a series of dots is displayed. As the verification progresses, a series of Vs appears beneath the dots. When the series stops, the formatting is complete.

    The diskette is now ready for raw character operations such as tar and cpio.

Examples--Formatting a UFS Diskette

Following are several examples of UFS formatting. The first example formats a 1.44 Mbyte diskette on a 1.44 Mbyte drive:


$ fdformat -v -U
Formatting 1.44 M in /vol/dev/rdiskette0/unformatted
Press return to start formatting floppy. [ Return ]
.......................................................
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

The following example performs the same job, but assigns the diskette the name myfiles:


$ fdformat -v -U -b myfiles
Formatting 1.44 M in /vol/dev/rdiskette0/unformatted
Press return to start formatting floppy. [ Return ]
.......................................................
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

The following example formats a 720Kbyte diskette on a 1.44 Mbyte drive, and names it myfiles:


$ fdformat -v -U -D -b myfiles
Formatting 720 KB in /vol/dev/rdiskette0/unformatted
Press return to start formatting floppy. [ Return ]
.......................................................
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

How to Place a UFS File System on a Diskette

Even though the procedure for adding a UFS file system is the same for UFS diskettes formatted on IA platforms and SPARC platforms, a UFS diskette formatted on a SPARC platform can only be used on another SPARC platform, and a UFS diskette formatted on an IA platform can only be used on an IA platform.

  1. Format the diskette for a UFS file system.

    Use "How to Format a UFS Diskette".

  2. Create a SunOS file system on the diskette.


    $ /usr/sbin/newfs -v /vol/dev/aliases/floppy0
    

    -v

    Prints status messages. 

    /vol/dev/aliases/floppy0

    Indicates the location of the floppy.  

    The newfs(1M) command displays a message asking you to confirm the creation of the file system.

  3. Confirm the creation of the file system.


    newfs: construct a new file system
           /vol/dev/aliases/floppy0:(y/n)? y
    

    A status message is displayed, indicating the particulars of the file system and the diskette's formatting.

    The diskette is now ready to be used on a SPARC platform. However, before Volume Management recognizes it, you must run the volrmmount command, as described in the following steps.

  4. Invoke the volrmmount command using the -i option to notify Volume Management that the diskette is inserted.


    $ volrmmount -i floppy0
    
  5. Verify that the UFS file system is on the diskette by using the ls command on the /floppy directory.

    If the floppy0 subdirectory appears, the diskette has a UFS file system and has been mounted properly.


    $ ls /floppy
    floppy0

Example--Placing a UFS File System on a Diskette


$ volcheck -v
media was found
$ /usr/sbin/newfs -v /vol/dev/aliases/floppy0
newfs: construct a new file system /vol/dev/aliases/floppy0: (y/n)? y
mkfs -F ufs /vol/dev/aliases/floppy0 2880 18 2 8192 1024 16 10 5 2048 
t 0 -1 8 15
/vol/dev/aliases/floppy0:  2880 sectors in 80 cylinders of 2 tracks, 
18 sectors
        1.4MB in 5 cyl groups (16 c/g, 0.28MB/g, 128 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
 32, 640, 1184, 1792, 2336,
$ volrmmount -i floppy0
$ ls /floppy
floppy0

How to Format a DOS Diskette

You can format a DOS diskette on a SPARC or IA platform. The steps are similar, except that instead of a SunOS file system being placed on the diskette, a DOS file system, either MS-DOS or NEC-DOS, is put on the diskette.


Caution - Caution -

Formatting a diskette erases any pre-existing content.


  1. Quit File Manager.

    File Manager automatically displays a formatting window when you insert an unformatted diskette. To avoid the window, quit from File Manager. If you prefer to keep File Manager open, quit the formatting window when it appears.

  2. Make sure the diskette is not write-protected.

    On both 3.5-inch and 5.25 inch diskettes, write-protection is controlled by a small tab in either the lower left or lower right corner. If you can see through the square hole behind the tab, the diskette is write-protected. If the hole is covered by the tab, the diskette is write-enabled. (If you need to eject the diskette to examine it, simply type eject floppy in a shell.)

  3. Insert the diskette.

    Make sure the diskette is completely inserted. It must drop down into the drive.

  4. Invoke formatting.


    $ fdformat -v -U [density-options convenience-options]

    -v

    Verifies whether the diskette was formatted correctly. 

    -U

    Unmounts the diskette if it is mounted. 

    density-options

    If the drive density is 1.44 Mbytes, density-options are:

     

    -d

    Formats at 1.44 Mbytes for MS-DOS.  

     

    -d -D

    Formats at 720 Kbytes for MS-DOS. 

     

    -t nec -M

    Formats at 1.2 Mbytes for NEC-DOS. 

     

     

    Lists all the options to the fdformat command, but does not format the diskette.

    convenience-options

     

     

    -e

    Ejects the diskette when done formatting. 

     

    -f

    Does not ask for confirmation before formatting. 

     

    -b label

    Name for the diskette. label must be eight characters or less, upper or lower case.

     

    -z

    Lists all the options to the fdformat command, but does not format the diskette.


    Note -

    If you try to format a 720 Kbyte (DD) diskette for 1.44 Mbytes, fdformat will not stop you unless you include the -v option. With the -v option, fdformat will format the diskette, but the verification will catch the error and notify you with the following message: fdformat: check diskette density, I/O error


    The fdformat command displays a confirmation message, indicating the type of formatting to be performed:


    Formatting 1.44 M in /vol/dev/rdiskette0/unformatted
    Press return to start formatting floppy.
  5. Select one of the options in the table below.

    To ... 

    Press ... 

    Confirm the type of formatting 

    Return (unless you used the -f option in the previous step, in which case no confirmation is necessary)

    Cancel formatting 

    Control-c 

    As the formatting progresses, a series of dots is displayed. As the verification progresses, a series of Vs appears beneath the dots. When the series stops, the formatting is complete and the diskette is ready for use on a DOS system.

  6. Run the volrmmount(1) command using the -i option to notify Volume Management that the diskette is inserted.


    $ volrmmount -i floppy0
    

    Volume Management mounts the diskette under /floppy/floppy0.

Example--Formatting a DOS Diskette

The following example formats a 1.44 Mbyte MS-DOS diskette and assigns the diskette the name myfiles:


$ fdformat -v -U -b myfiles
Formatting 1.44 M in /vol/dev/rdiskette0/unformatted
Press return to start formatting floppy. [ Return ]
......................................................
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv