1 .\" Copyright (c) 1998 Robert Nordier
2 .\" All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in
11 .\" the documentation and/or other materials provided with the
14 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS
15 .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16 .\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY
18 .\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
20 .\" GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
22 .\" IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
23 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
24 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 .\" $FreeBSD: src/sbin/newfs_msdos/newfs_msdos.8,v 1.7.2.7 2003/02/24 00:56:42 trhodes Exp $
27 .\" $DragonFly: src/sbin/newfs_msdos/newfs_msdos.8,v 1.3 2006/02/17 19:33:33 swildner Exp $
34 .Nd construct a new MS-DOS (FAT) file system
43 .Op Fl S Ar sector-size
45 .Op Fl b Ar block-size
46 .Op Fl c Ar cluster-size
57 .Op Fl u Ar track-size
63 utility creates a FAT12, FAT16, or FAT32 file system on device
69 to determine geometry, if required.
71 The options are as follow:
72 .Bl -tag -width indent
74 Don't create a file system: just print out parameters.
76 Get bootstrap from file.
78 FAT type (one of 12, 16, or 32).
82 Volume label (up to 11 characters). The label should consist of
83 only those characters permitted in regular DOS (8+3) filenames.
85 OEM string (up to 8 characters). The default is
87 .It Fl S Ar sector-size
88 Number of bytes per sector. Acceptable values are powers of 2
89 in the range 128 through 32768.
91 Number of sectors per FAT.
92 .It Fl b Ar block-size
93 File system block size (bytes per cluster). This should resolve to an
94 acceptable number of sectors per cluster (see below).
95 .It Fl c Ar cluster-size
96 Sectors per cluster. Acceptable values are powers of 2 in the range
99 Number of root directory entries (FAT12 and FAT16 only).
101 Specify a standard (floppy disk) format. The standard formats
102 are (capacities in kilobytes): 160, 180, 320, 360, 640, 720, 1200,
105 Number of drive heads.
107 Location of the file system info sector (FAT32 only).
108 A value of 0xffff signifies no info sector.
110 Location of the backup boot sector (FAT32 only). A value
111 of 0xffff signifies no backup sector.
113 Media descriptor (acceptable range 0xf0 to 0xff).
115 Number of FATs. Acceptable values are 1 to 16 inclusive.
119 Number of hidden sectors.
121 Number of reserved sectors.
124 .It Fl u Ar track-size
125 Number of sectors per track.
128 FAT file system parameters occupy a "Boot Sector BPB (BIOS Parameter
129 Block)" in the first of the "reserved" sectors which precede the actual
130 file system. For reference purposes, this structure is presented
134 u_int16_t bps; /* [-S] bytes per sector */
135 u_int8_t spc; /* [-c] sectors per cluster */
136 u_int16_t res; /* [-r] reserved sectors */
137 u_int8_t nft; /* [-n] number of FATs */
138 u_int16_t rde; /* [-e] root directory entries */
139 u_int16_t sec; /* [-s] total sectors */
140 u_int8_t mid; /* [-m] media descriptor */
141 u_int16_t spf; /* [-a] sectors per FAT */
142 u_int16_t spt; /* [-u] sectors per track */
143 u_int16_t hds; /* [-h] drive heads */
144 u_int32_t hid; /* [-o] hidden sectors */
145 u_int32_t bsec; /* [-s] big total sectors */
147 /* FAT32 extensions */
149 u_int32_t bspf; /* [-a] big sectors per FAT */
150 u_int16_t xflg; /* control flags */
151 u_int16_t vers; /* file system version */
152 u_int32_t rdcl; /* root directory start cluster */
153 u_int16_t infs; /* [-i] file system info sector */
154 u_int16_t bkbs; /* [-k] backup boot sector */
158 .Bd -literal -offset indent
159 newfs_msdos /dev/ad0s1
162 Create a file system, using default parameters, on
164 .Bd -literal -offset indent
165 newfs_msdos -f 1440 -L foo fd0
168 Create a standard 1.44M file system, with volume label
173 Exit status is 0 on success and 1 on error.
182 utility first appeared in
185 .An Robert Nordier Aq rnordier@FreeBSD.org .