The rmformat command is a non-superuser utility that you can use to format and protect rewritable removable media. The rmformat command has three formatting options:
quick – This option formats removable media without certification or with limited certification of certain tracks on the media.
long – This option formats removable media completely. For some devices, the use of this option might include the certification of the whole media by the drive itself.
force – This option formats completely without user confirmation. For media with a password-protection mechanism, this option clears the password before formatting. This feature is useful when a password is forgotten. On media without password protection, this option forces a long format.
Keep the following in mind when formatting removable media:
Close and quit the file manager window.
File Manager automatically displays a formatting window when you insert an unformatted media. To avoid the window, quit from File Manager. If you prefer to keep File Manager open, quit the formatting window when it appears.
Volume manager (vold) mounts file systems automatically so you might have to unmount media before you can format it, if it contains an existing file system.
This section describes removable media hardware considerations.
Keep the following in mind when formatting diskettes:
For information on diskette names, see Table 18–1.
Diskettes that are not named (that is, they have no “label”) are assigned the default name of noname.
A Solaris system can format diskettes for use on both Solaris and DOS systems. However, the hardware platform imposes some limitations. These limitations are summarized in the following table.
Platform Type |
Diskettes Format Type |
---|---|
SPARC based systems |
UFS |
|
MS-DOS or NEC-DOS (PCFS) |
|
UDFS |
x86 based systems |
UFS |
|
MS-DOS or NEC-DOS (PCFS) |
|
UDFS |
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 x86 platform, nor can a diskette formatted on an x86 platform be used on a SPARC based platform. This is because the SPARC and x86 UFS formats are different. SPARC uses little-endian bit coding, x86 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. For more information, see Formatting Removable Media (Task Map).
On a Solaris system (either SPARC or x86), you can format diskettes with the following densities.
Diskette Size |
Diskette Density |
Capacity |
---|---|---|
3.5” |
High Density (HD) |
1.44 Mbytes |
3.5” |
Double Density (DD) |
720 Kbytes |
By default, the diskette drive formats a diskette to a like density. This default means that 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. In other words, a diskette can be formatted to its capacity or lower, and a drive can format to its capacity or lower.
A Solaris platform can format PCMCIA memory cards for use on both Solaris and DOS platforms. However, the hardware platform imposes some limitations. These limitations are summarized in the following table.
Platform Type |
PCMCIA Memory Cards Format Type |
---|---|
SPARC based systems |
UFS |
|
MS-DOS or NEC-DOS (PCFS) |
x86 based systems |
UFS |
|
MS-DOS or NEC-DOS (PCFS) |
PCMCIA memory cards formatted for UFS are restricted to the hardware platform on which they were formatted. In other words, a UFS PCMCIA memory card formatted on a SPARC platform cannot be used for UFS on an x86 platform. Likewise, PCMCIA memory cards formatted on an x86 platform cannot be used on a SPARC platform. This is because the SPARC and x86 UFS formats are different.
A complete format for UFS file systems consists of the basic “bit” formatting plus the structure to support a UFS 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 PCMCIA memory card for each type of file system are different. Therefore, before you format a PCMCIA memory card, consider which file system you are using.
Insert the media.
Make sure the media is formatted.
If you aren't sure, insert it and check the status messages in the console, as described in Step 3. If you need to format the diskette, go to How to Format Removable Media (rmformat).
Notify volume management.
$ volcheck -v media was found |
Two status messages are possible:
Volume management detected the media and will attempt to mount it in the directory described in Table 18–1.
If the media is formatted properly, no error messages appear in the console.
If the media is not formatted, the “media was found” message is still displayed, but the error messages similar to the following appear in the Console:
fd0: unformatted diskette or no diskette in the drive fd0: read failed (40 1 0) fd0: bad format You must format the media before volume management can mount it. For more information, see Chapter 19, Formatting Removable Media (Tasks). |
|
Volume management did not detect the media. Make sure the media is inserted properly and run volcheck again. If unsuccessful, check the media, it could be damaged. You can also try to mount the media manually. |
Verify that the media was mounted by listing its contents.
For example, do the following for a diskette:
$ ls /floppy floppy0 myfiles |
As described earlier, floppy0 is a symbolic link to the actual name of the diskette, In this case, myfiles. If the diskette has no name but is formatted correctly, the system will refer to it as unnamed_floppy.
If nothing appears under the /floppy directory, the diskette was either not mounted or is not formatted properly. To find out, run the mount command and look for the line that begins with /floppy (usually at the end of the listing):
/floppy/name on /vol/dev/diskette0/name
If the line does not appear, the diskette was not mounted. Check the console window for error messages.
You can use the rmformat command to format the media. By default, this command creates two partitions on the media: partition 0 and partition 2 (the whole media).
Verify that the volume manager is running, which means you can use the shorter nickname for the device name.
$ ps -ef | grep vold root 212 1 0 Nov 03 ? 0:01 /usr/sbin/vold |
For information on starting vold, see How to Restart Volume Management (vold). For information on identifying media device names, see Using Removable Media Names.
Format the removable media.
$ rmformat -F [ quick | long | force ] device-name |
See the previous section for more information on rmformat formatting options.
If the rmformat output indicates bad blocks, see How to Repair Bad Blocks on Removable Media for information on repairing bad blocks.
(Optional) Label the removable media with an 8-character label to be used in the Solaris environment.
$ rmformat -b label device-name |
For information on creating a DOS label, see mkfs_pcfs(1M).
This example shows how to format a diskette.
$ rmformat -F quick /dev/rdiskette Formatting will erase all the data on disk. Do you want to continue? (y/n) y ......................................................................... |
This example shows how to format a Zip drive.
$ rmformat -F quick /vol/dev/aliases/zip0 Formatting will erase all the data on disk. Do you want to continue? (y/n) y ......................................................................... |
Format the media.
$ rmformat -F quick device-name |
(Optional) Create an alternate Solaris partition table.
$ rmformat -s slice-file device-name |
A sample slice file looks like the following:
slices: 0 = 0, 30MB, "wm", "home" : 1 = 30MB, 51MB : 2 = 0, 94MB, "wm", "backup" : 6 = 81MB, 13MB |
Become superuser.
Determine the appropriate file system type and select one of the following:
The following example shows how to format a diskette and create a UFS file system on the diskette.
$ rmformat -F quick /vol/dev/aliases/floppy0 Formatting will erase all the data on disk. Do you want to continue? (y/n) y $ su # /usr/sbin/newfs /vol/dev/aliases/floppy0 newfs: construct a new file system /dev/rdiskette: (y/n)? y /dev/rdiskette: 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, # |
The following example shows how to format a PCMCIA memory card and create a UFS file system on the card.
$ rmformat -F quick /vol/dev/aliases/pcmem0 $ su # /usr/sbin/newfs -v /vol/dev/aliases/pcmem0 newfs: construct a new file system /vol/dev/aliases/pcmem0:(y/n)? y . . . # |
This example shows how to create an alternate fdisk partition.
$ rmformat -F quick /dev/rdsk/c0t4d0s2:c Formatting will erase all the data on disk. Do you want to continue? (y/n) y $ su # fdisk /dev/rdsk/c0t4d0s2:c # mkfs -F pcfs /dev/rdsk/c0t4d0s2:c Construct a new FAT file system on /dev/rdsk/c0t4d0s2:c: (y/n)? y # |
This example shows how to create a PCFS file system without an fdisk partition.
$ rmformat -F quick /dev/rdiskette Formatting will erase all the data on disk. Do you want to continue? (y/n) y $ su # mkfs -F pcfs -o nofdisk,size=2 /dev/rdiskette Construct a new FAT file system on /dev/rdiskette: (y/n)? y # |
The following example shows how check the consistency of a PCFS file system on media.
# fsck -F pcfs /dev/rdsk/c0t4d0s2 ** /dev/rdsk/c0t4d0s2 ** Scanning file system meta-data ** Correcting any meta-data discrepancies 1457664 bytes. 0 bytes in bad sectors. 0 bytes in 0 directories. 0 bytes in 0 files. 1457664 bytes free. 512 bytes per allocation unit. 2847 total allocation units. 2847 available allocation units. # |
You can only use the rmformat command to verify, analyze, and repair bad sectors that are found during verification if the drive supports bad block management. Most diskettes and PCMCIA memory cards do not support bad block management.
If the drive supports bad block management, a best effort is made to rectify the bad block. If the bad block cannot be rectified despite the best effort mechanism, a message indicates a failure to repair.
Repair bad blocks on removable media.
$ rmformat -c block-numbers device-name |
Supply the block number in decimal, octal, or hexadecimal format from a previous rmformat session.
Verify the media.
$ rmformat -V read device-name |
You can apply read protection or write protection and set a password on Iomega media such as Zip drives and Jaz drives.
Determine whether you want to enable or disable write protection and select one of the following:
Verify whether the media's write protection is enabled or disabled.
$ rmformat -p device-name |
You can apply a password with a maximum of 32 characters for Iomega media that support this feature. You cannot set read protection or write protection without a password on Iomega media. In this situation, you are prompted to provide a password.
You receive a warning message if you attempt to apply a password on media that does not support this feature.
Determine whether you want to enable or disable read protection or write protection and a password.
Enable read protection or write protection.
$ rmformat -W enable device-name Please enter password (32 chars maximum): xxx Please reenter password: |
$ rmformat -R enable device-name Please enter password (32 chars maximum): xxx Please reenter password: |
Disable read protection or write protection and remove the password.
$ rmformat -W disable device-name Please enter password (32 chars maximum): xxx |
$ rmformat -R disable device-name Please enter password (32 chars maximum): xxx |
Verify whether the media's read protection or write protection is enabled or disabled.
$ rmformat -p device-name |
This example shows how to enable write protection and set a password on a Zip drive.
$ rmformat -W enable /vol/dev/aliases/zip0 Please enter password (32 chars maximum): xxx Please reenter password: xxx |
This example shows how to disable write protection and remove the password on a Zip drive.
$ rmformat -W disable /vol/dev/aliases/zip0 Please enter password (32 chars maximum): xxx |
This example shows how to enable read protection and set a password on a Zip drive.
rmformat -R enable /vol/dev/aliases/zip0 Please enter password (32 chars maximum): xxx Please reenter password: xxx |
This example shows to disable read protection and remove the password on a Zip drive.
$ rmformat -R disable /vol/dev/aliases/zip0 Please enter password (32 chars maximum): xxx |