1 '\" te 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" 7 .SH NAME 8 rmformat \- removable rewritable media format utility 9 .SH SYNOPSIS 10 .LP 11 .nf 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] 14 .fi 15 16 .LP 17 .nf 18 \fBrmformat\fR \fB-V\fR read | write \fIdevname\fR 19 .fi 20 21 .LP 22 .nf 23 \fBrmformat\fR \fB-l\fR [\fIdevname\fR] 24 .fi 25 26 .SH DESCRIPTION 27 .sp 28 .LP 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. 36 .sp 37 .LP 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 42 \fBrmformat\fR. 43 .SH OPTIONS 44 .sp 45 .LP 46 The following options are supported: 47 .sp 48 .ne 2 49 .na 50 \fB\fB-b\fR \fIlabel\fR\fR 51 .ad 52 .sp .6 53 .RS 4n 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(1M). 57 .RE 58 59 .sp 60 .ne 2 61 .na 62 \fB\fB-c\fR \fIblockno\fR\fR 63 .ad 64 .sp .6 65 .RS 4n 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 73 format. 74 .sp 75 The normal floppy and \fBPCMCIA\fR memory and ata cards do not support bad 76 block management. 77 .RE 78 79 .sp 80 .ne 2 81 .na 82 \fB\fB-D\fR\fR 83 .ad 84 .sp .6 85 .RS 4n 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. 89 .RE 90 91 .sp 92 .ne 2 93 .na 94 \fB\fB-e\fR\fR 95 .ad 96 .sp .6 97 .RS 4n 98 Ejects the media upon completion. This feature may not be available if the 99 drive does not support motorized eject. 100 .RE 101 102 .sp 103 .ne 2 104 .na 105 \fB\fB-F\fR quick | long | force\fR 106 .ad 107 .sp .6 108 .RS 4n 109 Formats the media. 110 .sp 111 The \fBquick\fR option starts a format without certification or format with 112 limited certification of certain tracks on the media. 113 .sp 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. 116 .sp 117 The \fBforce\fR option to format is provided to start a long format without 118 user confirmation before the format is started. 119 .sp 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. 124 .RE 125 126 .sp 127 .ne 2 128 .na 129 \fB\fB-H\fR\fR 130 .ad 131 .sp .6 132 .RS 4n 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 135 type. 136 .RE 137 138 .sp 139 .ne 2 140 .na 141 \fB\fB-l\fR\fR 142 .ad 143 .sp .6 144 .RS 4n 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. 149 .RE 150 151 .sp 152 .ne 2 153 .na 154 \fB\fB-s\fR \fIfilename\fR\fR 155 .ad 156 .sp .6 157 .RS 4n 158 Enables the user to lay out the partition information in the SUNOS label. 159 .sp 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: 162 .sp 163 .in +2 164 .nf 165 slices: \fIn\fR = \fIoffset\fR, \fIsize\fR [, \fIflags\fR, \fItags\fR] 166 .fi 167 .in -2 168 .sp 169 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. 176 .sp 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: 180 .sp 181 .in +2 182 .nf 183 \fBwm\fR = read-write, mountable 184 \fBwu\fR = read-write, unmountable 185 \fBru\fR = read-only, unmountable 186 .fi 187 .in -2 188 .sp 189 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, 192 \fBalternates\fR. 193 .sp 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. 199 .sp 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 & 203 flags. 204 .sp 205 Slice specifications are separated by : 206 .sp 207 For example: 208 .sp 209 .in +2 210 .nf 211 slices: 0 = 0, 30MB, "wm", "home" : 212 1 = 30MB, 51MB : 213 2 = 0, 100MB, "wm", "backup" : 214 6 = 81MB, 19MB 215 .fi 216 .in -2 217 .sp 218 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. 228 .sp 229 Partitioning some of the media with very small capacity is permitted, but be 230 cautious in using this option on such devices. 231 .RE 232 233 .sp 234 .ne 2 235 .na 236 \fB\fB-U\fR\fR 237 .ad 238 .sp .6 239 .RS 4n 240 Performs \fBumount\fR on any file systems and then formats. See 241 \fBmount\fR(1M). This option unmounts all the mounted slices and issues a long 242 format on the device requested. 243 .RE 244 245 .sp 246 .ne 2 247 .na 248 \fB\fB-V\fR read | write\fR 249 .ad 250 .sp .6 251 .RS 4n 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. 256 .sp 257 The read verification only verifies the blocks and report the blocks which are 258 prone to errors. 259 .sp 260 The list of block numbers displayed can be used with the \fB-c\fR option for 261 repairing. 262 .RE 263 264 .SH OPERANDS 265 .sp 266 .LP 267 The following operand is supported: 268 .sp 269 .ne 2 270 .na 271 \fB\fIdevname\fR\fR 272 .ad 273 .sp .6 274 .RS 4n 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. 278 .sp 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 283 second drive. 284 .sp 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. 288 .RE 289 290 .SH EXAMPLES 291 .LP 292 \fBExample 1 \fRFormatting a Diskette 293 .sp 294 .in +2 295 .nf 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 299 .fi 300 .in -2 301 .sp 302 303 .LP 304 \fBExample 2 \fRFormatting a Diskette for a UFS File System 305 .sp 306 .LP 307 The following example formats a diskette and creates a UFS file system: 308 309 .sp 310 .in +2 311 .nf 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 315 example$ \fBsu\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, 322 # 323 .fi 324 .in -2 325 .sp 326 327 .LP 328 \fBExample 3 \fRFormatting Removable Media for a PCFS File System 329 .sp 330 .LP 331 The following example shows how to create an alternate \fBfdisk\fR partition: 332 333 .sp 334 .in +2 335 .nf 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 339 example$ \fBsu\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 343 # 344 .fi 345 .in -2 346 .sp 347 348 .sp 349 .LP 350 The following example describes how to create a \fBPCFS\fR file system 351 \fBwithout\fR an \fBfdisk\fR partition: 352 353 .sp 354 .in +2 355 .nf 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 359 example$ \fBsu\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 362 # 363 .fi 364 .in -2 365 .sp 366 367 .LP 368 \fBExample 4 \fRListing All Removable Devices 369 .sp 370 .LP 371 The following example shows how to list removable devices. This output shows a 372 long listing of such devices. 373 374 .sp 375 .in +2 376 .nf 377 example$ rmformat -l 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 383 Bus: USB 384 Size: 1.4 MB 385 Label: floppy 386 Access permissions: Medium is not write protected. 387 .fi 388 .in -2 389 .sp 390 391 .SH FILES 392 .sp 393 .ne 2 394 .na 395 \fB\fB/dev/diskette0\fR\fR 396 .ad 397 .sp .6 398 .RS 4n 399 Directory providing block device access for the media in floppy drive 0. 400 .RE 401 402 .sp 403 .ne 2 404 .na 405 \fB\fB/dev/rdiskette0\fR\fR 406 .ad 407 .sp .6 408 .RS 4n 409 Directory providing character device access for the media in floppy drive 0. 410 .RE 411 412 .sp 413 .ne 2 414 .na 415 \fB\fB/dev/aliases\fR\fR 416 .ad 417 .sp .6 418 .RS 4n 419 Directory providing symbolic links to the character devices for the different 420 media under the control of volume management using appropriate alias. 421 .RE 422 423 .sp 424 .ne 2 425 .na 426 \fB\fB/dev/aliases/floppy0\fR\fR 427 .ad 428 .sp .6 429 .RS 4n 430 Symbolic link to the character device for the media in floppy drive 0. 431 .RE 432 433 .sp 434 .ne 2 435 .na 436 \fB\fB/dev/rdiskette\fR\fR 437 .ad 438 .sp .6 439 .RS 4n 440 Symbolic link providing character device access for the media in the primary 441 floppy drive, usually drive 0. 442 .RE 443 444 .sp 445 .ne 2 446 .na 447 \fB\fB/dev/dsk\fR\fR 448 .ad 449 .sp .6 450 .RS 4n 451 Directory providing block device access for the \fBPCMCIA\fR memory and ata 452 cards and removable media devices. 453 .RE 454 455 .sp 456 .ne 2 457 .na 458 \fB\fB/dev/rdsk\fR\fR 459 .ad 460 .sp .6 461 .RS 4n 462 Directory providing character device access for the \fBPCMCIA\fR memory and ata 463 cards and removable media devices. 464 .RE 465 466 .sp 467 .ne 2 468 .na 469 \fB\fB/dev/aliases/pcmemS\fR\fR 470 .ad 471 .sp .6 472 .RS 4n 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. 475 .RE 476 477 .sp 478 .ne 2 479 .na 480 \fB\fB/dev/aliases/rmdisk0\fR\fR 481 .ad 482 .sp .6 483 .RS 4n 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. 486 .RE 487 488 .sp 489 .ne 2 490 .na 491 \fB\fB/dev/rdsk\fR\fR 492 .ad 493 .sp .6 494 .RS 4n 495 Directory providing character device access for the \fBPCMCIA\fR memory and ata 496 cards and other removable devices. 497 .RE 498 499 .sp 500 .ne 2 501 .na 502 \fB\fB/dev/dsk\fR\fR 503 .ad 504 .sp .6 505 .RS 4n 506 Directory providing block device access for the \fBPCMCIA\fR memory and ata 507 cards and other removable media devices. 508 .RE 509 510 .SH SEE ALSO 511 .sp 512 .LP 513 \fBcpio\fR(1), \fBeject\fR(1), \fBfdformat\fR(1), \fBtar\fR(1), 514 \fBvolcheck\fR(1), \fBvolrmmount\fR(1), \fBformat\fR(1M), \fBmkfs_pcfs\fR(1M), 515 \fBmount\fR(1M), \fBnewfs\fR(1M), \fBprtvtoc\fR(1M), \fBrmmount\fR(1M), 516 \fBrpc.smserverd\fR(1M), \fBattributes\fR(5), \fBscsa2usb\fR(7D), \fBsd\fR(7D), 517 \fBpcfs\fR(7FS), \fBudfs\fR(7FS) 518 .sp 519 .LP 520 \fISystem Administration Guide: Basic Administration\fR 521 .SH NOTES 522 .sp 523 .LP 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(1M)) 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) 531 and \fBudfs\fR(7FS). 532 .sp 533 .LP 534 \fBrmformat\fR might not list all removable devices in virtualization 535 environments. 536 .SH BUGS 537 .sp 538 .LP 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).