2 .\" Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved.
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH RMFORMAT 1 "Feb 19, 2009"
8 rmformat \- removable rewritable media format utility
12 \fBrmformat\fR [\fB-DeHUv\fR] [\fB-b\fR \fIlabel\fR] [\fB-c\fR \fIblockno\fR]
13 [\fB-F\fRquick | long | force ] [\fB-s\fR \fIfilename\fR] [\fIdevname\fR]
18 \fBrmformat\fR \fB-V\fR read | write \fIdevname\fR
23 \fBrmformat\fR \fB-l\fR [\fIdevname\fR]
29 The \fBrmformat\fR utility is used to format, label, partition, and perform
30 other miscellaneous functions on removable, rewritable media that include
31 floppy drives, and the \fBPCMCIA\fR memory and \fBata\fR cards. The
32 \fBrmformat\fR utility should also be used with all USB mass storage devices,
33 including USB hard drives. This utility can also be used for the verification
34 and surface analysis and for repair of the bad sectors found during
35 verification if the drive or the driver supports bad block management.
38 After formatting, \fBrmformat\fR writes the label, which covers the full
39 capacity of the media as one slice on floppy and \fBPCMCIA\fR memory cards to
40 maintain compatibility with the behavior of \fBfdformat\fR. The partition
41 information can be changed with the help of other options provided by
46 The following options are supported:
50 \fB\fB-b\fR \fIlabel\fR\fR
54 Labels the media with a SUNOS label. A SUNOS volume label name is restricted to
55 8 characters. For media size greater than 1 TB, an EFI label is created. For
56 writing a \fBDOS\fR Volume label, the user should use \fBmkfs_pcfs\fR(8).
62 \fB\fB-c\fR \fIblockno\fR\fR
66 Corrects and repairs the given block. This correct and repair option may not be
67 applicable to all devices supported by \fBrmformat\fR, as some devices may have
68 a drive with bad block management capability and others may have this option
69 implemented in the driver. If the drive or driver supports bad block
70 management, a best effort is made to rectify the bad block. If the bad block
71 still cannot be rectified, a message is displayed to indicate the failure to
72 repair. The block number can be provided in decimal, octal, or hexadecimal
75 The normal floppy and \fBPCMCIA\fR memory and ata cards do not support bad
86 Formats a 720KB (3.5 inch) double density diskette. This is the default for
87 double density type drives. This option is needed if the drive is a high or
88 extended-density type.
98 Ejects the media upon completion. This feature may not be available if the
99 drive does not support motorized eject.
105 \fB\fB-F\fR quick | long | force\fR
111 The \fBquick\fR option starts a format without certification or format with
112 limited certification of certain tracks on the media.
114 The \fBlong\fR option starts a complete format. For some devices this might
115 include the certification of the whole media by the drive itself.
117 The \fBforce\fR option to format is provided to start a long format without
118 user confirmation before the format is started.
120 In legacy media such as floppy drives, all options start a long format
121 depending on the mode (Extended Density mode, High Density mode, or Double
122 Density mode) with which the floppy drive operates by default. On \fBPCMCIA\fR
123 memory cards, all options start a long format.
133 Formats a 1.44 MB (3.5 inch) high density diskette. This is the default for
134 high density type drives. It is needed if the drive is the Extended Density
145 Lists all removable devices. By default, without any options, \fBrmformat\fR
146 also lists all removable devices. If the \fBdev_name\fR is given,
147 \fBrmformat\fR lists the device associated with the \fBdev_name\fR. The output
148 shows the device pathname, vendor information, and the device type.
154 \fB\fB-s\fR \fIfilename\fR\fR
158 Enables the user to lay out the partition information in the SUNOS label.
160 The user should provide a file as input with information about each slice in a
161 format providing byte offset, size required, tags, and flags, as follows:
165 slices: \fIn\fR = \fIoffset\fR, \fIsize\fR [, \fIflags\fR, \fItags\fR]
170 where \fIn\fR is the slice number, \fIoffset\fR is the byte offset at which the
171 slice \fIn\fR starts, and \fIsize\fR is the required size for slice \fIn\fR.
172 Both \fIoffset\fR and \fIsize\fR must be a multiple of 512 bytes. These numbers
173 can be represented as decimal, hexadecimal, or octal numbers. No floating point
174 numbers are accepted. Details about maximum number of slices can be obtained
175 from the \fISystem Administration Guide: Basic Administration\fR.
177 To specify the \fIsize\fR or \fIoffset\fR in kilobytes, megabytes, or
178 gigabytes, add \fBKB\fR, \fBMB\fR, \fBGB\fR, respectively. A number without a
179 suffix is assumed to be a byte offset. The flags are represented as follows:
183 \fBwm\fR = read-write, mountable
184 \fBwu\fR = read-write, unmountable
185 \fBru\fR = read-only, unmountable
190 The tags are represented as follows: \fBunassigned\fR, \fBboot\fR, \fBroot\fR,
191 \fBswap\fR, \fBusr\fR, \fBbackup\fR, \fBstand\fR, \fBvar\fR, \fBhome\fR,
194 The tags and flags can be omitted from the four tuple when finer control on
195 those values is not required. It is required to omit both or include both. If
196 the tags and flags are omitted from the four tuple for a particular slice, a
197 default value for each is assumed. The default value for flags is \fBwm\fR and
198 for tags is \fBunassigned\fR.
200 Either full tag names can be provided or an abbreviation for the tags can be
201 used. The abbreviations can be the first two or more letters from the standard
202 tag names. \fBrmformat\fR is case insensitive in handling the defined tags &
205 Slice specifications are separated by :
211 slices: 0 = 0, 30MB, "wm", "home" :
213 2 = 0, 100MB, "wm", "backup" :
219 \fBrmformat\fR does the necessary checking to detect any overlapping partitions
220 or illegal requests to addresses beyond the capacity of the media under
221 consideration. There can be only one slice information entry for each slice
222 \fIn\fR. If multiple slice information entries for the same slice \fIn\fR are
223 provided, an appropriate error message is displayed. The slice \fB2\fR is the
224 backup slice covering the whole disk capacity. The pound sign character,
225 \fB#\fR, can be used to describe a line of comments in the input file. If the
226 line starts with \fB#\fR, then \fBrmformat\fR ignores all the characters
227 following \fB#\fR until the end of the line.
229 Partitioning some of the media with very small capacity is permitted, but be
230 cautious in using this option on such devices.
240 Performs \fBumount\fR on any file systems and then formats. See
241 \fBmount\fR(8). This option unmounts all the mounted slices and issues a long
242 format on the device requested.
248 \fB\fB-V\fR read | write\fR
252 Verifies each block of media after format. The write verification is a
253 destructive mechanism. The user is queried for confirmation before the
254 verification is started. The output of this option is a list of block numbers,
255 which are identified as bad.
257 The read verification only verifies the blocks and report the blocks which are
260 The list of block numbers displayed can be used with the \fB-c\fR option for
267 The following operand is supported:
275 \fIdevname\fR can be provided as absolute device pathname or relative pathname
276 for the device from the current working directory or the nickname, such as
277 \fBcdrom\fR or \fBrmdisk\fR.
279 For floppy devices, to access the first drive use \fB/dev/rdiskette0\fR (for
280 systems without volume management) or \fBfloppy0\fR (for systems with volume
281 management). Specify \fB/dev/rdiskette1\fR (for systems without volume
282 management) or \fBfloppy1\fR (for systems with volume management) to use the
285 For systems without volume management running, the user can also provide the
286 absolute device pathname as \fB/dev/rdsk/c\fI?\fRt\fI?\fRd\fI?\fRs\fI?\fR\fR or
287 the appropriate relative device pathname from the current working directory.
292 \fBExample 1 \fRFormatting a Diskette
296 example$ \fBrmformat -F quick /dev/rdiskette\fR
297 Formatting will erase all the data on disk.
298 Do you want to continue? (y/n)\fBy\fR
304 \fBExample 2 \fRFormatting a Diskette for a UFS File System
307 The following example formats a diskette and creates a UFS file system:
312 example$ \fBrmformat -F quick /dev/aliases/floppy0\fR
313 Formatting will erase all the data on disk.
314 Do you want to continue? (y/n)\fBy\fR
316 # \fB/usr/sbin/newfs /dev/aliases/floppy0\fR
317 newfs: construct a new file system /dev/rdiskette: (y/n)? \fBy\fR
318 /dev/rdiskette: 2880 sectors in 80 cylinders of 2 tracks, 18 sectors
319 1.4MB in 5 cyl groups (16 c/g, 0.28MB/g, 128 i/g)
320 super-block backups (for fsck -F ufs -o b=#) at:
321 32, 640, 1184, 1792, 2336,
328 \fBExample 3 \fRFormatting Removable Media for a PCFS File System
331 The following example shows how to create an alternate \fBfdisk\fR partition:
336 example$ \fBrmformat -F quick /dev/rdsk/c0t4d0s2:c\fR
337 Formatting will erase all the data on disk.
338 Do you want to continue? (y/n)\fBy\fR
340 # \fBfdisk /dev/rdsk/c0t4d0s2:c\fR
341 # \fBmkfs -F pcfs /dev/rdsk/c0t4d0s2:c\fR
342 Construct a new FAT file system on /dev/rdsk/c0t4d0s2:c: (y/n)? \fBy\fR
350 The following example describes how to create a \fBPCFS\fR file system
351 \fBwithout\fR an \fBfdisk\fR partition:
356 example$ \fBrmformat -F quick /dev/rdiskette\fR
357 Formatting will erase all the data on disk.
358 Do you want to continue? (y/n)\fBy\fR
360 # \fBmkfs -F pcfs -o nofdisk,size=2 /dev/rdiskette\fR
361 Construct a new FAT file system on /dev/rdiskette: (y/n)? \fBy\fR
368 \fBExample 4 \fRListing All Removable Devices
371 The following example shows how to list removable devices. This output shows a
372 long listing of such devices.
378 Looking for devices...
379 Logical Node: /dev/rdsk/c5t0d0s2
380 Physical Node: /pci@1e,600000/usb@b/hub@2/storage@4/disk@0,0
381 Connected Device: TEAC FD-05PUB 1026
382 Device Type: Floppy drive
386 Access permissions: Medium is not write protected.
395 \fB\fB/dev/diskette0\fR\fR
399 Directory providing block device access for the media in floppy drive 0.
405 \fB\fB/dev/rdiskette0\fR\fR
409 Directory providing character device access for the media in floppy drive 0.
415 \fB\fB/dev/aliases\fR\fR
419 Directory providing symbolic links to the character devices for the different
420 media under the control of volume management using appropriate alias.
426 \fB\fB/dev/aliases/floppy0\fR\fR
430 Symbolic link to the character device for the media in floppy drive 0.
436 \fB\fB/dev/rdiskette\fR\fR
440 Symbolic link providing character device access for the media in the primary
441 floppy drive, usually drive 0.
451 Directory providing block device access for the \fBPCMCIA\fR memory and ata
452 cards and removable media devices.
458 \fB\fB/dev/rdsk\fR\fR
462 Directory providing character device access for the \fBPCMCIA\fR memory and ata
463 cards and removable media devices.
469 \fB\fB/dev/aliases/pcmemS\fR\fR
473 Symbolic link to the character device for the \fBPCMCIA\fR memory card in
474 socket S, where S represents a \fBPCMCIA\fR socket number.
480 \fB\fB/dev/aliases/rmdisk0\fR\fR
484 Symbolic link to the generic removable media device that is not a \fBCD-ROM\fR,
485 floppy, \fBDVD-ROM\fR, \fBPCMCIA\fR memory card, and so forth.
491 \fB\fB/dev/rdsk\fR\fR
495 Directory providing character device access for the \fBPCMCIA\fR memory and ata
496 cards and other removable devices.
506 Directory providing block device access for the \fBPCMCIA\fR memory and ata
507 cards and other removable media devices.
513 \fBcpio\fR(1), \fBeject\fR(1), \fBfdformat\fR(1), \fBtar\fR(1),
514 \fBvolcheck\fR(1), \fBvolrmmount\fR(1), \fBformat\fR(8), \fBmkfs_pcfs\fR(8),
515 \fBmount\fR(8), \fBnewfs\fR(8), \fBprtvtoc\fR(8), \fBrmmount\fR(8),
516 \fBrpc.smserverd\fR(8), \fBattributes\fR(5), \fBscsa2usb\fR(7D), \fBsd\fR(7D),
517 \fBpcfs\fR(7FS), \fBudfs\fR(7FS)
520 \fISystem Administration Guide: Basic Administration\fR
524 A rewritable media or \fBPCMCIA\fR memory card or \fBPCMCIA\fR ata card
525 containing a \fBufs\fR file system created on a SPARC-based system (using
526 \fBnewfs\fR(8)) is not identical to a rewritable media or \fBPCMCIA\fR memory
527 card containing a \fBufs\fR file system created on an x86 based system. Do not
528 interchange any removable media containing \fBufs\fR between these platforms;
529 use \fBcpio\fR(1) or \fBtar\fR(1) to transfer files on diskettes or memory
530 cards between them. For interchangeable filesystems refer to \fBpcfs\fR(7FS)
534 \fBrmformat\fR might not list all removable devices in virtualization
539 Currently, bad sector mapping is not supported on floppy diskettes or
540 \fBPCMCIA\fR memory cards. Therefore, a diskette or memory card is unusable if
541 \fBrmformat\fR finds an error (\fBbad sector\fR).