1 RMFORMAT(1) User Commands RMFORMAT(1) 2 3 4 5 NAME 6 rmformat - removable rewritable media format utility 7 8 SYNOPSIS 9 rmformat [-DeHUv] [-b label] [-c blockno] 10 [-Fquick | long | force ] [-s filename] [devname] 11 12 13 rmformat -V read | write devname 14 15 16 rmformat -l [devname] 17 18 19 DESCRIPTION 20 The rmformat utility is used to format, label, partition, and perform 21 other miscellaneous functions on removable, rewritable media that 22 include floppy drives, and the PCMCIA memory and ata cards. The 23 rmformat utility should also be used with all USB mass storage 24 devices, including USB hard drives. This utility can also be used for 25 the verification and surface analysis and for repair of the bad sectors 26 found during verification if the drive or the driver supports bad block 27 management. 28 29 30 After formatting, rmformat writes the label, which covers the full 31 capacity of the media as one slice on floppy and PCMCIA memory cards to 32 maintain compatibility with the behavior of fdformat. The partition 33 information can be changed with the help of other options provided by 34 rmformat. 35 36 OPTIONS 37 The following options are supported: 38 39 -b label 40 41 Labels the media with a SUNOS label. A SUNOS volume label name is 42 restricted to 8 characters. For media size greater than 1 TB, an 43 EFI label is created. For writing a DOS Volume label, the user 44 should use mkfs_pcfs(1M). 45 46 47 -c blockno 48 49 Corrects and repairs the given block. This correct and repair 50 option may not be applicable to all devices supported by rmformat, 51 as some devices may have a drive with bad block management 52 capability and others may have this option implemented in the 53 driver. If the drive or driver supports bad block management, a 54 best effort is made to rectify the bad block. If the bad block 55 still cannot be rectified, a message is displayed to indicate the 56 failure to repair. The block number can be provided in decimal, 57 octal, or hexadecimal format. 58 59 The normal floppy and PCMCIA memory and ata cards do not support 60 bad block management. 61 62 63 -D 64 65 Formats a 720KB (3.5 inch) double density diskette. This is the 66 default for double density type drives. This option is needed if 67 the drive is a high or extended-density type. 68 69 70 -e 71 72 Ejects the media upon completion. This feature may not be available 73 if the drive does not support motorized eject. 74 75 76 -F quick | long | force 77 78 Formats the media. 79 80 The quick option starts a format without certification or format 81 with limited certification of certain tracks on the media. 82 83 The long option starts a complete format. For some devices this 84 might include the certification of the whole media by the drive 85 itself. 86 87 The force option to format is provided to start a long format 88 without user confirmation before the format is started. 89 90 In legacy media such as floppy drives, all options start a long 91 format depending on the mode (Extended Density mode, High Density 92 mode, or Double Density mode) with which the floppy drive operates 93 by default. On PCMCIA memory cards, all options start a long 94 format. 95 96 97 -H 98 99 Formats a 1.44 MB (3.5 inch) high density diskette. This is the 100 default for high density type drives. It is needed if the drive is 101 the Extended Density type. 102 103 104 -l 105 106 Lists all removable devices. By default, without any options, 107 rmformat also lists all removable devices. If the dev_name is 108 given, rmformat lists the device associated with the dev_name. The 109 output shows the device pathname, vendor information, and the 110 device type. 111 112 113 -s filename 114 115 Enables the user to lay out the partition information in the SUNOS 116 label. 117 118 The user should provide a file as input with information about each 119 slice in a format providing byte offset, size required, tags, and 120 flags, as follows: 121 122 slices: n = offset, size [, flags, tags] 123 124 125 where n is the slice number, offset is the byte offset at which the 126 slice n starts, and size is the required size for slice n. Both 127 offset and size must be a multiple of 512 bytes. These numbers can 128 be represented as decimal, hexadecimal, or octal numbers. No 129 floating point numbers are accepted. Details about maximum number 130 of slices can be obtained from the System Administration Guide: 131 Basic Administration. 132 133 To specify the size or offset in kilobytes, megabytes, or 134 gigabytes, add KB, MB, GB, respectively. A number without a suffix 135 is assumed to be a byte offset. The flags are represented as 136 follows: 137 138 wm = read-write, mountable 139 wu = read-write, unmountable 140 ru = read-only, unmountable 141 142 143 The tags are represented as follows: unassigned, boot, root, swap, 144 usr, backup, stand, var, home, alternates. 145 146 The tags and flags can be omitted from the four tuple when finer 147 control on those values is not required. It is required to omit 148 both or include both. If the tags and flags are omitted from the 149 four tuple for a particular slice, a default value for each is 150 assumed. The default value for flags is wm and for tags is 151 unassigned. 152 153 Either full tag names can be provided or an abbreviation for the 154 tags can be used. The abbreviations can be the first two or more 155 letters from the standard tag names. rmformat is case insensitive 156 in handling the defined tags & flags. 157 158 Slice specifications are separated by : 159 160 For example: 161 162 slices: 0 = 0, 30MB, "wm", "home" : 163 1 = 30MB, 51MB : 164 2 = 0, 100MB, "wm", "backup" : 165 6 = 81MB, 19MB 166 167 168 rmformat does the necessary checking to detect any overlapping 169 partitions or illegal requests to addresses beyond the capacity of 170 the media under consideration. There can be only one slice 171 information entry for each slice n. If multiple slice information 172 entries for the same slice n are provided, an appropriate error 173 message is displayed. The slice 2 is the backup slice covering the 174 whole disk capacity. The pound sign character, #, can be used to 175 describe a line of comments in the input file. If the line starts 176 with #, then rmformat ignores all the characters following # until 177 the end of the line. 178 179 Partitioning some of the media with very small capacity is 180 permitted, but be cautious in using this option on such devices. 181 182 183 -U 184 185 Performs umount on any file systems and then formats. See 186 mount(1M). This option unmounts all the mounted slices and issues a 187 long format on the device requested. 188 189 190 -V read | write 191 192 Verifies each block of media after format. The write verification 193 is a destructive mechanism. The user is queried for confirmation 194 before the verification is started. The output of this option is a 195 list of block numbers, which are identified as bad. 196 197 The read verification only verifies the blocks and report the 198 blocks which are prone to errors. 199 200 The list of block numbers displayed can be used with the -c option 201 for repairing. 202 203 204 OPERANDS 205 The following operand is supported: 206 207 devname 208 209 devname can be provided as absolute device pathname or relative 210 pathname for the device from the current working directory or the 211 nickname, such as cdrom or rmdisk. 212 213 For floppy devices, to access the first drive use /dev/rdiskette0 214 (for systems without volume management) or floppy0 (for systems 215 with volume management). Specify /dev/rdiskette1 (for systems 216 without volume management) or floppy1 (for systems with volume 217 management) to use the second drive. 218 219 For systems without volume management running, the user can also 220 provide the absolute device pathname as /dev/rdsk/c?t?d?s? or the 221 appropriate relative device pathname from the current working 222 directory. 223 224 225 EXAMPLES 226 Example 1 Formatting a Diskette 227 228 example$ rmformat -F quick /dev/rdiskette 229 Formatting will erase all the data on disk. 230 Do you want to continue? (y/n)y 231 232 233 234 Example 2 Formatting a Diskette for a UFS File System 235 236 237 The following example formats a diskette and creates a UFS file system: 238 239 240 example$ rmformat -F quick /dev/aliases/floppy0 241 Formatting will erase all the data on disk. 242 Do you want to continue? (y/n)y 243 example$ su 244 # /usr/sbin/newfs /dev/aliases/floppy0 245 newfs: construct a new file system /dev/rdiskette: (y/n)? y 246 /dev/rdiskette: 2880 sectors in 80 cylinders of 2 tracks, 18 sectors 247 1.4MB in 5 cyl groups (16 c/g, 0.28MB/g, 128 i/g) 248 super-block backups (for fsck -F ufs -o b=#) at: 249 32, 640, 1184, 1792, 2336, 250 # 251 252 253 254 Example 3 Formatting Removable Media for a PCFS File System 255 256 257 The following example shows how to create an alternate fdisk partition: 258 259 260 example$ rmformat -F quick /dev/rdsk/c0t4d0s2:c 261 Formatting will erase all the data on disk. 262 Do you want to continue? (y/n)y 263 example$ su 264 # fdisk /dev/rdsk/c0t4d0s2:c 265 # mkfs -F pcfs /dev/rdsk/c0t4d0s2:c 266 Construct a new FAT file system on /dev/rdsk/c0t4d0s2:c: (y/n)? y 267 # 268 269 270 271 272 The following example describes how to create a PCFS file system 273 without an fdisk partition: 274 275 276 example$ rmformat -F quick /dev/rdiskette 277 Formatting will erase all the data on disk. 278 Do you want to continue? (y/n)y 279 example$ su 280 # mkfs -F pcfs -o nofdisk,size=2 /dev/rdiskette 281 Construct a new FAT file system on /dev/rdiskette: (y/n)? y 282 # 283 284 285 286 Example 4 Listing All Removable Devices 287 288 289 The following example shows how to list removable devices. This output 290 shows a long listing of such devices. 291 292 293 example$ rmformat -l 294 Looking for devices... 295 Logical Node: /dev/rdsk/c5t0d0s2 296 Physical Node: /pci@1e,600000/usb@b/hub@2/storage@4/disk@0,0 297 Connected Device: TEAC FD-05PUB 1026 298 Device Type: Floppy drive 299 Bus: USB 300 Size: 1.4 MB 301 Label: floppy 302 Access permissions: Medium is not write protected. 303 304 305 306 FILES 307 /dev/diskette0 308 309 Directory providing block device access for the media in floppy 310 drive 0. 311 312 313 /dev/rdiskette0 314 315 Directory providing character device access for the media in floppy 316 drive 0. 317 318 319 /dev/aliases 320 321 Directory providing symbolic links to the character devices for the 322 different media under the control of volume management using 323 appropriate alias. 324 325 326 /dev/aliases/floppy0 327 328 Symbolic link to the character device for the media in floppy drive 329 0. 330 331 332 /dev/rdiskette 333 334 Symbolic link providing character device access for the media in 335 the primary floppy drive, usually drive 0. 336 337 338 /dev/dsk 339 340 Directory providing block device access for the PCMCIA memory and 341 ata cards and removable media devices. 342 343 344 /dev/rdsk 345 346 Directory providing character device access for the PCMCIA memory 347 and ata cards and removable media devices. 348 349 350 /dev/aliases/pcmemS 351 352 Symbolic link to the character device for the PCMCIA memory card in 353 socket S, where S represents a PCMCIA socket number. 354 355 356 /dev/aliases/rmdisk0 357 358 Symbolic link to the generic removable media device that is not a 359 CD-ROM, floppy, DVD-ROM, PCMCIA memory card, and so forth. 360 361 362 /dev/rdsk 363 364 Directory providing character device access for the PCMCIA memory 365 and ata cards and other removable devices. 366 367 368 /dev/dsk 369 370 Directory providing block device access for the PCMCIA memory and 371 ata cards and other removable media devices. 372 373 374 SEE ALSO 375 cpio(1), eject(1), fdformat(1), tar(1), volcheck(1), format(1M), 376 mkfs_pcfs(1M), mount(1M), newfs(1M), prtvtoc(1M), rmmount(1M), 377 rpc.smserverd(1M), attributes(5), scsa2usb(7D), sd(7D), pcfs(7FS), 378 udfs(7FS) 379 380 381 System Administration Guide: Basic Administration 382 383 NOTES 384 A rewritable media or PCMCIA memory card or PCMCIA ata card containing 385 a ufs file system created on a SPARC-based system (using newfs(1M)) is 386 not identical to a rewritable media or PCMCIA memory card containing a 387 ufs file system created on an x86 based system. Do not interchange any 388 removable media containing ufs between these platforms; use cpio(1) or 389 tar(1) to transfer files on diskettes or memory cards between them. For 390 interchangeable filesystems refer to pcfs(7FS) and udfs(7FS). 391 392 393 rmformat might not list all removable devices in virtualization 394 environments. 395 396 BUGS 397 Currently, bad sector mapping is not supported on floppy diskettes or 398 PCMCIA memory cards. Therefore, a diskette or memory card is unusable 399 if rmformat finds an error (bad sector). 400 401 402 403 May 2, 2014 RMFORMAT(1)