RMFORMAT(1) | User Commands | RMFORMAT(1) |
rmformat - removable rewritable media format utility
rmformat [-DeHUv] [-b label] [-c blockno]
[-Fquick | long | force ] [-s filename] [devname]
rmformat -V read | write devname
rmformat -l [devname]
The rmformat utility is used to format, label, partition, and perform other miscellaneous functions on removable, rewritable media that include floppy drives, and the PCMCIA memory and ata cards. The rmformat utility should also be used with all USB mass storage devices, including USB hard drives. This utility can also be used for the verification and surface analysis and for repair of the bad sectors found during verification if the drive or the driver supports bad block management.
After formatting, rmformat writes the label, which covers the full capacity of the media as one slice on floppy and PCMCIA memory cards to maintain compatibility with the behavior of fdformat. The partition information can be changed with the help of other options provided by rmformat.
The following options are supported:
-b label
-c blockno
The normal floppy and PCMCIA memory and ata cards do not support bad block management.
-D
-e
-F quick | long | force
The quick option starts a format without certification or format with limited certification of certain tracks on the media.
The long option starts a complete format. For some devices this might include the certification of the whole media by the drive itself.
The force option to format is provided to start a long format without user confirmation before the format is started.
In legacy media such as floppy drives, all options start a long format depending on the mode (Extended Density mode, High Density mode, or Double Density mode) with which the floppy drive operates by default. On PCMCIA memory cards, all options start a long format.
-H
-l
-s filename
The user should provide a file as input with information about each slice in a format providing byte offset, size required, tags, and flags, as follows:
slices: n = offset, size [, flags, tags]
where n is the slice number, offset is the byte offset at which the slice n starts, and size is the required size for slice n. Both offset and size must be a multiple of 512 bytes. These numbers can be represented as decimal, hexadecimal, or octal numbers. No floating point numbers are accepted. Details about maximum number of slices can be obtained from the System Administration Guide: Basic Administration.
To specify the size or offset in kilobytes, megabytes, or gigabytes, add KB, MB, GB, respectively. A number without a suffix is assumed to be a byte offset. The flags are represented as follows:
wm = read-write, mountable wu = read-write, unmountable ru = read-only, unmountable
The tags are represented as follows: unassigned, boot, root, swap, usr, backup, stand, var, home, alternates.
The tags and flags can be omitted from the four tuple when finer control on those values is not required. It is required to omit both or include both. If the tags and flags are omitted from the four tuple for a particular slice, a default value for each is assumed. The default value for flags is wm and for tags is unassigned.
Either full tag names can be provided or an abbreviation for the tags can be used. The abbreviations can be the first two or more letters from the standard tag names. rmformat is case insensitive in handling the defined tags & flags.
Slice specifications are separated by :
For example:
slices: 0 = 0, 30MB, "wm", "home" :
1 = 30MB, 51MB :
2 = 0, 100MB, "wm", "backup" :
6 = 81MB, 19MB
rmformat does the necessary checking to detect any overlapping partitions or illegal requests to addresses beyond the capacity of the media under consideration. There can be only one slice information entry for each slice n. If multiple slice information entries for the same slice n are provided, an appropriate error message is displayed. The slice 2 is the backup slice covering the whole disk capacity. The pound sign character, #, can be used to describe a line of comments in the input file. If the line starts with #, then rmformat ignores all the characters following # until the end of the line.
Partitioning some of the media with very small capacity is permitted, but be cautious in using this option on such devices.
-U
-V read | write
The read verification only verifies the blocks and report the blocks which are prone to errors.
The list of block numbers displayed can be used with the -c option for repairing.
The following operand is supported:
devname
For floppy devices, to access the first drive use /dev/rdiskette0 (for systems without volume management) or floppy0 (for systems with volume management). Specify /dev/rdiskette1 (for systems without volume management) or floppy1 (for systems with volume management) to use the second drive.
For systems without volume management running, the user can also provide the absolute device pathname as /dev/rdsk/c?t?d?s? or the appropriate relative device pathname from the current working directory.
Example 1 Formatting a Diskette
example$ rmformat -F quick /dev/rdiskette Formatting will erase all the data on disk. Do you want to continue? (y/n)y
Example 2 Formatting a Diskette for a UFS File System
The following example formats a diskette and creates a UFS file system:
example$ rmformat -F quick /dev/aliases/floppy0 Formatting will erase all the data on disk. Do you want to continue? (y/n)y example$ su # /usr/sbin/newfs /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, #
Example 3 Formatting Removable Media for a PCFS File System
The following example shows how to create an alternate fdisk partition:
example$ rmformat -F quick /dev/rdsk/c0t4d0s2:c Formatting will erase all the data on disk. Do you want to continue? (y/n)y example$ 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 #
The following example describes how to create a PCFS file system without an fdisk partition:
example$ rmformat -F quick /dev/rdiskette Formatting will erase all the data on disk. Do you want to continue? (y/n)y example$ su # mkfs -F pcfs -o nofdisk,size=2 /dev/rdiskette Construct a new FAT file system on /dev/rdiskette: (y/n)? y #
Example 4 Listing All Removable Devices
The following example shows how to list removable devices. This output shows a long listing of such devices.
example$ rmformat -l Looking for devices... Logical Node: /dev/rdsk/c5t0d0s2 Physical Node: /pci@1e,600000/usb@b/hub@2/storage@4/disk@0,0 Connected Device: TEAC FD-05PUB 1026 Device Type: Floppy drive Bus: USB Size: 1.4 MB Label: floppy Access permissions: Medium is not write protected.
/dev/diskette0
/dev/rdiskette0
/dev/aliases
/dev/aliases/floppy0
/dev/rdiskette
/dev/dsk
/dev/rdsk
/dev/aliases/pcmemS
/dev/aliases/rmdisk0
/dev/rdsk
/dev/dsk
cpio(1), eject(1), fdformat(1), tar(1), volcheck(1), volrmmount(1), scsa2usb(4D), sd(4D), pcfs(4FS), udfs(4FS), attributes(7), format(8), mkfs_pcfs(8), mount(8), newfs(8), prtvtoc(8), rmmount(8), rpc.smserverd(8)
System Administration Guide: Basic Administration
A rewritable media or PCMCIA memory card or PCMCIA ata card containing a ufs file system created on a SPARC-based system (using newfs(8)) is not identical to a rewritable media or PCMCIA memory card containing a ufs file system created on an x86 based system. Do not interchange any removable media containing ufs between these platforms; use cpio(1) or tar(1) to transfer files on diskettes or memory cards between them. For interchangeable filesystems refer to pcfs(4FS) and udfs(4FS).
rmformat might not list all removable devices in virtualization environments.
Currently, bad sector mapping is not supported on floppy diskettes or PCMCIA memory cards. Therefore, a diskette or memory card is unusable if rmformat finds an error (bad sector).
February 19, 2009 | OmniOS |