Matt Mower | 18794c8 | 2015-11-11 16:22:45 -0600 | [diff] [blame] | 1 | .\" mkfs.fat.8 - manpage for fs.fatck |
| 2 | .\" |
| 3 | .\" Copyright (C) 2006-2014 Daniel Baumann <daniel@debian.org> |
| 4 | .\" |
| 5 | .\" This program is free software: you can redistribute it and/or modify |
| 6 | .\" it under the terms of the GNU General Public License as published by |
| 7 | .\" the Free Software Foundation, either version 3 of the License, or |
| 8 | .\" (at your option) any later version. |
| 9 | .\" |
| 10 | .\" This program is distributed in the hope that it will be useful, |
| 11 | .\" but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | .\" GNU General Public License for more details. |
| 14 | .\" |
| 15 | .\" You should have received a copy of the GNU General Public License |
| 16 | .\" along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 17 | .\" |
| 18 | .\" The complete text of the GNU General Public License |
| 19 | .\" can be found in /usr/share/common-licenses/GPL-3 file. |
| 20 | .\" |
| 21 | .\" |
| 22 | .TH MKFS.FAT 8 2015\-05\-16 3.0.28 "dosfstools" |
| 23 | .SH NAME |
| 24 | \fBmkfs.fat\fR \- create an MS-DOS filesystem under Linux |
| 25 | .\" ---------------------------------------------------------------------------- |
| 26 | .SH SYNOPSIS |
| 27 | \fBmkfs.fat\fR [\fIOPTIONS\fR] \fIDEVICE\fR [\fIBLOCK-COUNT\fR] |
| 28 | .\" ---------------------------------------------------------------------------- |
| 29 | .SH DESCRIPTION |
| 30 | \fBmkfs.fat\fR is used to create an MS-DOS filesystem under Linux on a device |
| 31 | (usually a disk partition). |
| 32 | \fIDEVICE\fR is the special file corresponding to the device (e.g. /dev/sdXX). |
| 33 | \fIBLOCK-COUNT\fR is the number of blocks on the device. |
| 34 | If omitted, \fBmkfs.fat\fR automatically determines the filesystem size. |
| 35 | .\" ---------------------------------------------------------------------------- |
| 36 | .SH OPTIONS |
| 37 | .IP "\fB\-a\fR" 4 |
| 38 | Normally, for any filesystem except very small ones, \fBmkfs.fat\fR will align |
| 39 | all the data structures to cluster size, to make sure that as long as the |
| 40 | partition is properly aligned, so will all the data structures in the |
| 41 | filesystem. |
| 42 | This option disables alignment; this may provide a handful of additional |
| 43 | clusters of storage at the expense of a significant performance degradation on |
| 44 | RAIDs, flash media or large-sector hard disks. |
| 45 | .IP "\fB \-A\fR" 4 |
| 46 | Use Atari variation of the MS-DOS filesystem. |
| 47 | This is default if \fBmkfs.fat\fR is run on an Atari, then this option turns off |
| 48 | Atari format. |
| 49 | There are some differences when using Atari format: |
| 50 | If not directed otherwise by the user, \fBmkfs.fat\fR will always use 2 sectors |
| 51 | per cluster, since GEMDOS doesn't like other values very much. |
| 52 | It will also obey the maximum number of sectors GEMDOS can handle. |
| 53 | Larger filesystems are managed by raising the logical sector size. |
| 54 | Under Atari format, an Atari-compatible serial number for the filesystem is |
| 55 | generated, and a 12 bit FAT is used only for filesystems that have one of the |
| 56 | usual floppy sizes (720k, 1.2M, 1.44M, 2.88M), a 16 bit FAT otherwise. |
| 57 | This can be overridden with the \fB\-F\fR option. |
| 58 | Some PC-specific boot sector fields aren't written, and a boot message (option |
| 59 | \fB\-m\fR) is ignored. |
| 60 | .IP "\fB\-b\fR \fISECTOR-OF-BACKUP\fR" 4 |
| 61 | Selects the location of the backup boot sector for FAT32. |
| 62 | Default depends on number of reserved sectors, but usually is sector 6. |
| 63 | The backup must be within the range of reserved sectors. |
| 64 | .IP "\fB\-c" 4 |
| 65 | Check the device for bad blocks before creating the filesystem. |
| 66 | .IP "\fB\-C\fR" 4 |
| 67 | Create the file given as \fIDEVICE\fR on the command line, and write the |
| 68 | to-be-created filesystem to it. |
| 69 | This can be used to create the new filesystem in a file instead of on a real |
| 70 | device, and to avoid using \fBdd\fR in advance to create a file of appropriate |
| 71 | size. |
| 72 | With this option, the \fIBLOCK-COUNT\fR must be given, because otherwise the |
| 73 | intended size of the filesystem wouldn't be known. |
| 74 | The file created is a sparse file, which actually only contains the meta-data |
| 75 | areas (boot sector, FATs, and root directory). |
| 76 | The data portions won't be stored on the disk, but the file nevertheless will |
| 77 | have the correct size. |
| 78 | The resulting file can be copied later to a floppy disk or other device, or |
| 79 | mounted through a loop device. |
| 80 | .IP "\fB\-D\fR \fIDRIVE-NUMBER\fR" 4 |
| 81 | Specify the BIOS drive number to be stored in the FAT boot sector. |
| 82 | This value is usually 0x80 for hard disks and 0x00 for floppy devices or |
| 83 | partitions to be used for floppy emulation. |
| 84 | .IP "\fB\-f\fR \fINUMBER-OF-FATS\fR" 4 |
| 85 | Specify the number of file allocation tables in the filesystem. |
| 86 | The default is 2. |
| 87 | .IP "\fB\-F\fR \fIFAT-SIZE\fR" 4 |
| 88 | Specifies the type of file allocation tables used (12, 16 or 32 bit). |
| 89 | If nothing is specified, \fBmkfs.fat\fR will automatically select between 12, 16 |
| 90 | and 32 bit, whatever fits better for the filesystem size. |
| 91 | .IP "\fB\-h\fR \fINUMBER-OF-HIDDEN-SECTORS\fR" 4 |
| 92 | Select the number of hidden sectors in the volume. |
| 93 | Apparently some digital cameras get indigestion if you feed them a CF card |
| 94 | without such hidden sectors, this option allows you to satisfy them. |
| 95 | .IP "\fB\-i\fR \fIVOLUME-ID\fR" 4 |
| 96 | Sets the volume ID of the newly created filesystem; \fIVOLUME-ID\fR is a 32-bit |
| 97 | hexadecimal number (for example, 2e24ec82). |
| 98 | The default is a number which depends on the filesystem creation time. |
| 99 | .IP "\fB\-I\fR" 4 |
| 100 | It is typical for fixed disk devices to be partitioned so, by default, you are |
| 101 | not permitted to create a filesystem across the entire device. |
| 102 | \fBmkfs.fat\fR will complain and tell you that it refuses to work. |
| 103 | This is different when using MO disks. |
| 104 | One doesn't always need partitions on MO disks. |
| 105 | The filesystem can go directly to the whole disk. |
| 106 | Under other OSes this is known as the 'superfloppy' format. |
| 107 | This switch will force \fBmkfs.fat\fR to work properly. |
| 108 | .IP "\fB\-l\fR \fIFILENAME\fR" 4 |
| 109 | Read the bad blocks list from \fIFILENAME\fR. |
| 110 | .IP "\fB\-m\fR \fIMESSAGE-FILE\fR" 4 |
| 111 | Sets the message the user receives on attempts to boot this filesystem without |
| 112 | having properly installed an operating system. |
| 113 | The message file must not exceed 418 bytes once line feeds have been converted |
| 114 | to carriage return-line feed combinations, and tabs have been expanded. |
| 115 | If the filename is a hyphen (-), the text is taken from standard input. |
| 116 | .IP "\fB\-M\fR \fIFAT-MEDIA-TYPE\fR" 4 |
| 117 | Specify the media type to be stored in the FAT boot sector. |
| 118 | This value is usually 0xF8 for hard disks and is 0xF0 or a value from 0xF9 to |
| 119 | 0xFF for floppies or partitions to be used for floppy emulation. |
| 120 | .IP "\fB\-n\fR \fIVOLUME-NAME\fR" 4 |
| 121 | Sets the volume name (label) of the filesystem. |
| 122 | The volume name can be up to 11 characters long. |
| 123 | The default is no label. |
| 124 | .IP "\fB\-r\fR \fIROOT-DIR-ENTRIES\fR" 4 |
| 125 | Select the number of entries available in the root directory. |
| 126 | The default is 112 or 224 for floppies and 512 for hard disks. |
| 127 | .IP "\fB\-R\fR \fINUMBER-OF-RESERVED-SECTORS\fR" 4 |
| 128 | Select the number of reserved sectors. |
| 129 | With FAT32 format at least 2 reserved sectors are needed, the default is 32. |
| 130 | Otherwise the default is 1 (only the boot sector). |
| 131 | .IP "\fB\-s\fR \fISECTORS-PER-CLUSTER\fR" 4 |
| 132 | Specify the number of disk sectors per cluster. |
| 133 | Must be a power of 2, i.e. 1, 2, 4, 8, ... 128. |
| 134 | .IP "\fB\-S\fR \fILOGICAL-SECTOR-SIZE\fR" 4 |
| 135 | Specify the number of bytes per logical sector. |
| 136 | Must be a power of 2 and greater than or equal to 512, i.e. 512, 1024, 2048, |
| 137 | 4096, 8192, 16384, or 32768. |
| 138 | .IP "\fB\-v\fR" 4 |
| 139 | Verbose execution. |
| 140 | .IP "\fB\-\-invariant\fR" 4 |
| 141 | Use constants for normally randomly generated or time based data such as |
| 142 | volume ID and creation time. |
| 143 | Multiple runs of \fBmkfs.fat\fR on the same device create identical results |
| 144 | with this option. |
| 145 | Its main purpose is testing \fBmkfs.fat\fR. |
| 146 | .IP "\fB\-\-help\fR" 4 |
| 147 | Display option summary and exit. |
| 148 | .\" ---------------------------------------------------------------------------- |
| 149 | .SH BUGS |
| 150 | \fBmkfs.fat\fR can not create boot-able filesystems. |
| 151 | This isn't as easy as you might think at first glance for various reasons and |
| 152 | has been discussed a lot already. |
| 153 | \fBmkfs.fat\fR simply will not support it ;) |
| 154 | .\" ---------------------------------------------------------------------------- |
| 155 | .SH SEE ALSO |
| 156 | \fBfatlabel\fR(8) |
| 157 | .br |
| 158 | \fBfsck.fat\fR(8) |
| 159 | .\" ---------------------------------------------------------------------------- |
| 160 | .SH HOMEPAGE |
| 161 | The home for the \fBdosfstools\fR project is its |
| 162 | .UR https://github.com/dosfstools/dosfstools |
| 163 | GitHub project page |
| 164 | .UE . |
| 165 | .\" ---------------------------------------------------------------------------- |
| 166 | .SH AUTHORS |
| 167 | \fBdosfstools\fR were written by |
| 168 | .MT werner.almesberger@\:lrc.di.epfl.ch |
| 169 | Werner Almesberger |
| 170 | .ME , |
| 171 | .MT Roman.Hodek@\:informatik.\:uni-erlangen.de |
| 172 | Roman Hodek |
| 173 | .ME , |
| 174 | and others. |
| 175 | The current maintainer is |
| 176 | .MT aeb@\:debian.org |
| 177 | Andreas Bombe |
| 178 | .ME . |