1 '\" te 2 .\" Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved. 3 .\" Copyright 2014 Andrew Stormont. 4 .\" 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. 5 .\" 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. 6 .\" 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] 7 .TH RMFORMAT 1 "May 2, 2014" 8 .SH NAME 9 rmformat \- removable rewritable media format utility 10 .SH SYNOPSIS 11 .LP 12 .nf 13 \fBrmformat\fR [\fB-DeHUv\fR] [\fB-b\fR \fIlabel\fR] [\fB-c\fR \fIblockno\fR] 14 [\fB-F\fRquick | long | force ] [\fB-s\fR \fIfilename\fR] [\fIdevname\fR] 15 .fi 16 17 .LP 18 .nf 19 \fBrmformat\fR \fB-V\fR read | write \fIdevname\fR 20 .fi 21 22 .LP 23 .nf 24 \fBrmformat\fR \fB-l\fR [\fIdevname\fR] 25 .fi 26 27 .SH DESCRIPTION 28 .sp 29 .LP 30 The \fBrmformat\fR utility is used to format, label, partition, and perform 31 other miscellaneous functions on removable, rewritable media that include 32 floppy drives, and the \fBPCMCIA\fR memory and \fBata\fR cards. The 33 \fBrmformat\fR utility should also be used with all USB mass storage devices, 34 including USB hard drives. This utility can also be used for the verification 35 and surface analysis and for repair of the bad sectors found during 36 verification if the drive or the driver supports bad block management. 37 .sp 38 .LP 39 After formatting, \fBrmformat\fR writes the label, which covers the full 40 capacity of the media as one slice on floppy and \fBPCMCIA\fR memory cards to 41 maintain compatibility with the behavior of \fBfdformat\fR. The partition 42 information can be changed with the help of other options provided by 43 \fBrmformat\fR. 44 .SH OPTIONS 45 .sp 46 .LP 47 The following options are supported: 48 .sp 49 .ne 2 50 .na 51 \fB\fB-b\fR \fIlabel\fR\fR 52 .ad 53 .sp .6 54 .RS 4n 55 Labels the media with a SUNOS label. A SUNOS volume label name is restricted to 56 8 characters. For media size greater than 1 TB, an EFI label is created. For 57 writing a \fBDOS\fR Volume label, the user should use \fBmkfs_pcfs\fR(1M). 58 .RE 59 60 .sp 61 .ne 2 62 .na 63 \fB\fB-c\fR \fIblockno\fR\fR 64 .ad 65 .sp .6 66 .RS 4n 67 Corrects and repairs the given block. This correct and repair option may not be 68 applicable to all devices supported by \fBrmformat\fR, as some devices may have 69 a drive with bad block management capability and others may have this option 70 implemented in the driver. If the drive or driver supports bad block 71 management, a best effort is made to rectify the bad block. If the bad block 72 still cannot be rectified, a message is displayed to indicate the failure to 73 repair. The block number can be provided in decimal, octal, or hexadecimal 74 format. 75 .sp 76 The normal floppy and \fBPCMCIA\fR memory and ata cards do not support bad 77 block management. 78 .RE 79 80 .sp 81 .ne 2 82 .na 83 \fB\fB-D\fR\fR 84 .ad 85 .sp .6 86 .RS 4n 87 Formats a 720KB (3.5 inch) double density diskette. This is the default for 88 double density type drives. This option is needed if the drive is a high or 89 extended-density type. 90 .RE 91 92 .sp 93 .ne 2 94 .na 95 \fB\fB-e\fR\fR 96 .ad 97 .sp .6 98 .RS 4n 99 Ejects the media upon completion. This feature may not be available if the 100 drive does not support motorized eject. 101 .RE 102 103 .sp 104 .ne 2 105 .na 106 \fB\fB-F\fR quick | long | force\fR 107 .ad 108 .sp .6 109 .RS 4n 110 Formats the media. 111 .sp 112 The \fBquick\fR option starts a format without certification or format with 113 limited certification of certain tracks on the media. 114 .sp 115 The \fBlong\fR option starts a complete format. For some devices this might 116 include the certification of the whole media by the drive itself. 117 .sp 118 The \fBforce\fR option to format is provided to start a long format without 119 user confirmation before the format is started. 120 .sp 121 In legacy media such as floppy drives, all options start a long format 122 depending on the mode (Extended Density mode, High Density mode, or Double 123 Density mode) with which the floppy drive operates by default. On \fBPCMCIA\fR 124 memory cards, all options start a long format. 125 .RE 126 127 .sp 128 .ne 2 129 .na 130 \fB\fB-H\fR\fR 131 .ad 132 .sp .6 133 .RS 4n 134 Formats a 1.44 MB (3.5 inch) high density diskette. This is the default for 135 high density type drives. It is needed if the drive is the Extended Density 136 type. 137 .RE 138 139 .sp 140 .ne 2 141 .na 142 \fB\fB-l\fR\fR 143 .ad 144 .sp .6 145 .RS 4n 146 Lists all removable devices. By default, without any options, \fBrmformat\fR 147 also lists all removable devices. If the \fBdev_name\fR is given, 148 \fBrmformat\fR lists the device associated with the \fBdev_name\fR. The output 149 shows the device pathname, vendor information, and the device type. 150 .RE 151 152 .sp 153 .ne 2 154 .na 155 \fB\fB-s\fR \fIfilename\fR\fR 156 .ad 157 .sp .6 158 .RS 4n 159 Enables the user to lay out the partition information in the SUNOS label. 160 .sp 161 The user should provide a file as input with information about each slice in a 162 format providing byte offset, size required, tags, and flags, as follows: 163 .sp 164 .in +2 165 .nf 166 slices: \fIn\fR = \fIoffset\fR, \fIsize\fR [, \fIflags\fR, \fItags\fR] 167 .fi 168 .in -2 169 .sp 170 171 where \fIn\fR is the slice number, \fIoffset\fR is the byte offset at which the 172 slice \fIn\fR starts, and \fIsize\fR is the required size for slice \fIn\fR. 173 Both \fIoffset\fR and \fIsize\fR must be a multiple of 512 bytes. These numbers 174 can be represented as decimal, hexadecimal, or octal numbers. No floating point 175 numbers are accepted. Details about maximum number of slices can be obtained 176 from the \fISystem Administration Guide: Basic Administration\fR. 177 .sp 178 To specify the \fIsize\fR or \fIoffset\fR in kilobytes, megabytes, or 179 gigabytes, add \fBKB\fR, \fBMB\fR, \fBGB\fR, respectively. A number without a 180 suffix is assumed to be a byte offset. The flags are represented as follows: 181 .sp 182 .in +2 183 .nf 184 \fBwm\fR = read-write, mountable 185 \fBwu\fR = read-write, unmountable 186 \fBru\fR = read-only, unmountable 187 .fi 188 .in -2 189 .sp 190 191 The tags are represented as follows: \fBunassigned\fR, \fBboot\fR, \fBroot\fR, 192 \fBswap\fR, \fBusr\fR, \fBbackup\fR, \fBstand\fR, \fBvar\fR, \fBhome\fR, 193 \fBalternates\fR. 194 .sp 195 The tags and flags can be omitted from the four tuple when finer control on 196 those values is not required. It is required to omit both or include both. If 197 the tags and flags are omitted from the four tuple for a particular slice, a 198 default value for each is assumed. The default value for flags is \fBwm\fR and 199 for tags is \fBunassigned\fR. 200 .sp 201 Either full tag names can be provided or an abbreviation for the tags can be 202 used. The abbreviations can be the first two or more letters from the standard 203 tag names. \fBrmformat\fR is case insensitive in handling the defined tags & 204 flags. 205 .sp 206 Slice specifications are separated by : 207 .sp 208 For example: 209 .sp 210 .in +2 211 .nf 212 slices: 0 = 0, 30MB, "wm", "home" : 213 1 = 30MB, 51MB : 214 2 = 0, 100MB, "wm", "backup" : 215 6 = 81MB, 19MB 216 .fi 217 .in -2 218 .sp 219 220 \fBrmformat\fR does the necessary checking to detect any overlapping partitions 221 or illegal requests to addresses beyond the capacity of the media under 222 consideration. There can be only one slice information entry for each slice 223 \fIn\fR. If multiple slice information entries for the same slice \fIn\fR are 224 provided, an appropriate error message is displayed. The slice \fB2\fR is the 225 backup slice covering the whole disk capacity. The pound sign character, 226 \fB#\fR, can be used to describe a line of comments in the input file. If the 227 line starts with \fB#\fR, then \fBrmformat\fR ignores all the characters 228 following \fB#\fR until the end of the line. 229 .sp 230 Partitioning some of the media with very small capacity is permitted, but be 231 cautious in using this option on such devices. 232 .RE 233 234 .sp 235 .ne 2 236 .na 237 \fB\fB-U\fR\fR 238 .ad 239 .sp .6 240 .RS 4n 241 Performs \fBumount\fR on any file systems and then formats. See 242 \fBmount\fR(1M). This option unmounts all the mounted slices and issues a long 243 format on the device requested. 244 .RE 245 246 .sp 247 .ne 2 248 .na 249 \fB\fB-V\fR read | write\fR 250 .ad 251 .sp .6 252 .RS 4n 253 Verifies each block of media after format. The write verification is a 254 destructive mechanism. The user is queried for confirmation before the 255 verification is started. The output of this option is a list of block numbers, 256 which are identified as bad. 257 .sp 258 The read verification only verifies the blocks and report the blocks which are 259 prone to errors. 260 .sp 261 The list of block numbers displayed can be used with the \fB-c\fR option for 262 repairing. 263 .RE 264 265 .SH OPERANDS 266 .sp 267 .LP 268 The following operand is supported: 269 .sp 270 .ne 2 271 .na 272 \fB\fIdevname\fR\fR 273 .ad 274 .sp .6 275 .RS 4n 276 \fIdevname\fR can be provided as absolute device pathname or relative pathname 277 for the device from the current working directory or the nickname, such as 278 \fBcdrom\fR or \fBrmdisk\fR. 279 .sp 280 For floppy devices, to access the first drive use \fB/dev/rdiskette0\fR (for 281 systems without volume management) or \fBfloppy0\fR (for systems with volume 282 management). Specify \fB/dev/rdiskette1\fR (for systems without volume 283 management) or \fBfloppy1\fR (for systems with volume management) to use the 284 second drive. 285 .sp 286 For systems without volume management running, the user can also provide the 287 absolute device pathname as \fB/dev/rdsk/c\fI?\fRt\fI?\fRd\fI?\fRs\fI?\fR\fR or 288 the appropriate relative device pathname from the current working directory. 289 .RE 290 291 .SH EXAMPLES 292 .LP 293 \fBExample 1 \fRFormatting a Diskette 294 .sp 295 .in +2 296 .nf 297 example$ \fBrmformat -F quick /dev/rdiskette\fR 298 Formatting will erase all the data on disk. 299 Do you want to continue? (y/n)\fBy\fR 300 .fi 301 .in -2 302 .sp 303 304 .LP 305 \fBExample 2 \fRFormatting a Diskette for a UFS File System 306 .sp 307 .LP 308 The following example formats a diskette and creates a UFS file system: 309 310 .sp 311 .in +2 312 .nf 313 example$ \fBrmformat -F quick /dev/aliases/floppy0\fR 314 Formatting will erase all the data on disk. 315 Do you want to continue? (y/n)\fBy\fR 316 example$ \fBsu\fR 317 # \fB/usr/sbin/newfs /dev/aliases/floppy0\fR 318 newfs: construct a new file system /dev/rdiskette: (y/n)? \fBy\fR 319 /dev/rdiskette: 2880 sectors in 80 cylinders of 2 tracks, 18 sectors 320 1.4MB in 5 cyl groups (16 c/g, 0.28MB/g, 128 i/g) 321 super-block backups (for fsck -F ufs -o b=#) at: 322 32, 640, 1184, 1792, 2336, 323 # 324 .fi 325 .in -2 326 .sp 327 328 .LP 329 \fBExample 3 \fRFormatting Removable Media for a PCFS File System 330 .sp 331 .LP 332 The following example shows how to create an alternate \fBfdisk\fR partition: 333 334 .sp 335 .in +2 336 .nf 337 example$ \fBrmformat -F quick /dev/rdsk/c0t4d0s2:c\fR 338 Formatting will erase all the data on disk. 339 Do you want to continue? (y/n)\fBy\fR 340 example$ \fBsu\fR 341 # \fBfdisk /dev/rdsk/c0t4d0s2:c\fR 342 # \fBmkfs -F pcfs /dev/rdsk/c0t4d0s2:c\fR 343 Construct a new FAT file system on /dev/rdsk/c0t4d0s2:c: (y/n)? \fBy\fR 344 # 345 .fi 346 .in -2 347 .sp 348 349 .sp 350 .LP 351 The following example describes how to create a \fBPCFS\fR file system 352 \fBwithout\fR an \fBfdisk\fR partition: 353 354 .sp 355 .in +2 356 .nf 357 example$ \fBrmformat -F quick /dev/rdiskette\fR 358 Formatting will erase all the data on disk. 359 Do you want to continue? (y/n)\fBy\fR 360 example$ \fBsu\fR 361 # \fBmkfs -F pcfs -o nofdisk,size=2 /dev/rdiskette\fR 362 Construct a new FAT file system on /dev/rdiskette: (y/n)? \fBy\fR 363 # 364 .fi 365 .in -2 366 .sp 367 368 .LP 369 \fBExample 4 \fRListing All Removable Devices 370 .sp 371 .LP 372 The following example shows how to list removable devices. This output shows a 373 long listing of such devices. 374 375 .sp 376 .in +2 377 .nf 378 example$ rmformat -l 379 Looking for devices... 380 Logical Node: /dev/rdsk/c5t0d0s2 381 Physical Node: /pci@1e,600000/usb@b/hub@2/storage@4/disk@0,0 382 Connected Device: TEAC FD-05PUB 1026 383 Device Type: Floppy drive 384 Bus: USB 385 Size: 1.4 MB 386 Label: floppy 387 Access permissions: Medium is not write protected. 388 .fi 389 .in -2 390 .sp 391 392 .SH FILES 393 .sp 394 .ne 2 395 .na 396 \fB\fB/dev/diskette0\fR\fR 397 .ad 398 .sp .6 399 .RS 4n 400 Directory providing block device access for the media in floppy drive 0. 401 .RE 402 403 .sp 404 .ne 2 405 .na 406 \fB\fB/dev/rdiskette0\fR\fR 407 .ad 408 .sp .6 409 .RS 4n 410 Directory providing character device access for the media in floppy drive 0. 411 .RE 412 413 .sp 414 .ne 2 415 .na 416 \fB\fB/dev/aliases\fR\fR 417 .ad 418 .sp .6 419 .RS 4n 420 Directory providing symbolic links to the character devices for the different 421 media under the control of volume management using appropriate alias. 422 .RE 423 424 .sp 425 .ne 2 426 .na 427 \fB\fB/dev/aliases/floppy0\fR\fR 428 .ad 429 .sp .6 430 .RS 4n 431 Symbolic link to the character device for the media in floppy drive 0. 432 .RE 433 434 .sp 435 .ne 2 436 .na 437 \fB\fB/dev/rdiskette\fR\fR 438 .ad 439 .sp .6 440 .RS 4n 441 Symbolic link providing character device access for the media in the primary 442 floppy drive, usually drive 0. 443 .RE 444 445 .sp 446 .ne 2 447 .na 448 \fB\fB/dev/dsk\fR\fR 449 .ad 450 .sp .6 451 .RS 4n 452 Directory providing block device access for the \fBPCMCIA\fR memory and ata 453 cards and removable media devices. 454 .RE 455 456 .sp 457 .ne 2 458 .na 459 \fB\fB/dev/rdsk\fR\fR 460 .ad 461 .sp .6 462 .RS 4n 463 Directory providing character device access for the \fBPCMCIA\fR memory and ata 464 cards and removable media devices. 465 .RE 466 467 .sp 468 .ne 2 469 .na 470 \fB\fB/dev/aliases/pcmemS\fR\fR 471 .ad 472 .sp .6 473 .RS 4n 474 Symbolic link to the character device for the \fBPCMCIA\fR memory card in 475 socket S, where S represents a \fBPCMCIA\fR socket number. 476 .RE 477 478 .sp 479 .ne 2 480 .na 481 \fB\fB/dev/aliases/rmdisk0\fR\fR 482 .ad 483 .sp .6 484 .RS 4n 485 Symbolic link to the generic removable media device that is not a \fBCD-ROM\fR, 486 floppy, \fBDVD-ROM\fR, \fBPCMCIA\fR memory card, and so forth. 487 .RE 488 489 .sp 490 .ne 2 491 .na 492 \fB\fB/dev/rdsk\fR\fR 493 .ad 494 .sp .6 495 .RS 4n 496 Directory providing character device access for the \fBPCMCIA\fR memory and ata 497 cards and other removable devices. 498 .RE 499 500 .sp 501 .ne 2 502 .na 503 \fB\fB/dev/dsk\fR\fR 504 .ad 505 .sp .6 506 .RS 4n 507 Directory providing block device access for the \fBPCMCIA\fR memory and ata 508 cards and other removable media devices. 509 .RE 510 511 .SH SEE ALSO 512 .sp 513 .LP 514 \fBcpio\fR(1), \fBeject\fR(1), \fBfdformat\fR(1), \fBtar\fR(1), 515 \fBvolcheck\fR(1), \fBformat\fR(1M), \fBmkfs_pcfs\fR(1M), \fBmount\fR(1M), 516 \fBnewfs\fR(1M), \fBprtvtoc\fR(1M), \fBrmmount\fR(1M), \fBrpc.smserverd\fR(1M), 517 \fBattributes\fR(5), \fBscsa2usb\fR(7D), \fBsd\fR(7D), \fBpcfs\fR(7FS), 518 \fBudfs\fR(7FS) 519 .sp 520 .LP 521 \fISystem Administration Guide: Basic Administration\fR 522 .SH NOTES 523 .sp 524 .LP 525 A rewritable media or \fBPCMCIA\fR memory card or \fBPCMCIA\fR ata card 526 containing a \fBufs\fR file system created on a SPARC-based system (using 527 \fBnewfs\fR(1M)) is not identical to a rewritable media or \fBPCMCIA\fR memory 528 card containing a \fBufs\fR file system created on an x86 based system. Do not 529 interchange any removable media containing \fBufs\fR between these platforms; 530 use \fBcpio\fR(1) or \fBtar\fR(1) to transfer files on diskettes or memory 531 cards between them. For interchangeable filesystems refer to \fBpcfs\fR(7FS) 532 and \fBudfs\fR(7FS). 533 .sp 534 .LP 535 \fBrmformat\fR might not list all removable devices in virtualization 536 environments. 537 .SH BUGS 538 .sp 539 .LP 540 Currently, bad sector mapping is not supported on floppy diskettes or 541 \fBPCMCIA\fR memory cards. Therefore, a diskette or memory card is unusable if 542 \fBrmformat\fR finds an error (\fBbad sector\fR).