1.\" Copyright (c) 1998 Robert Nordier 2.\" All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. --- 9 unchanged lines hidden (view full) --- 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. 25.\" |
26.\" $FreeBSD: head/sbin/newfs_msdos/newfs_msdos.8 102231 2002-08-21 18:11:48Z trhodes $ |
27.\" 28.Dd July 6, 1998 29.Dt NEWFS_MSDOS 8 30.Os 31.Sh NAME 32.Nm newfs_msdos |
33.Nd construct a new MS-DOS (FAT) file system |
34.Sh SYNOPSIS 35.Nm 36.Op Fl N 37.Op Fl B Ar boot 38.Op Fl F Ar FAT-type 39.Op Fl I Ar volid 40.Op Fl L Ar label 41.Op Fl O Ar OEM --- 12 unchanged lines hidden (view full) --- 54.Op Fl r Ar reserved 55.Op Fl s Ar total 56.Op Fl u Ar track-size 57.Ar special 58.Op Ar disktype 59.Sh DESCRIPTION 60The 61.Nm |
62utility creates a FAT12, FAT16, or FAT32 file system on device |
63.Ar special , 64using 65.Xr disktab 5 66entry 67.Ar disktype 68to determine geometry, if required. 69.Pp 70The options are as follow: 71.Bl -tag -width indent 72.It Fl N |
73Don't create a file system: just print out parameters. |
74.It Fl B Ar boot 75Get bootstrap from file. 76.It Fl F Ar FAT-type 77FAT type (one of 12, 16, or 32). 78.It Fl I Ar volid 79Volume ID. 80.It Fl L Ar label 81Volume label (up to 11 characters). The label should consist of --- 16 unchanged lines hidden (view full) --- 98Number of root directory entries (FAT12 and FAT16 only). 99.It Fl f Ar format 100Specify a standard (floppy disk) format. The standard formats 101are (capacities in kilobytes): 160, 180, 320, 360, 640, 720, 1200, 1021232, 1440, 2880. 103.It Fl h Ar heads 104Number of drive heads. 105.It Fl i Ar info |
106Location of the file system info sector (FAT32 only). |
107A value of 0xffff signifies no info sector. 108.It Fl k Ar backup 109Location of the backup boot sector (FAT32 only). A value 110of 0xffff signifies no backup sector. 111.It Fl m Ar media 112Media descriptor (acceptable range 0xf0 to 0xff). 113.It Fl n Ar FATs 114Number of FATs. Acceptable values are 1 to 16 inclusive. --- 4 unchanged lines hidden (view full) --- 119.It Fl r Ar reserved 120Number of reserved sectors. 121.It Fl s Ar total 122File system size. 123.It Fl u Ar track-size 124Number of sectors per track. 125.El 126.Sh NOTES |
127FAT file system parameters occupy a "Boot Sector BPB (BIOS Parameter |
128Block)" in the first of the "reserved" sectors which precede the actual |
129file system. For reference purposes, this structure is presented |
130below. 131.Bd -literal 132struct bsbpb { 133 u_int16_t bps; /* [-S] bytes per sector */ 134 u_int8_t spc; /* [-c] sectors per cluster */ 135 u_int16_t res; /* [-r] reserved sectors */ 136 u_int8_t nft; /* [-n] number of FATs */ 137 u_int16_t rde; /* [-e] root directory entries */ --- 4 unchanged lines hidden (view full) --- 142 u_int16_t hds; /* [-h] drive heads */ 143 u_int32_t hid; /* [-o] hidden sectors */ 144 u_int32_t bsec; /* [-s] big total sectors */ 145}; 146/* FAT32 extensions */ 147struct bsxbpb { 148 u_int32_t bspf; /* [-a] big sectors per FAT */ 149 u_int16_t xflg; /* control flags */ |
150 u_int16_t vers; /* file system version */ |
151 u_int32_t rdcl; /* root directory start cluster */ |
152 u_int16_t infs; /* [-i] file system info sector */ |
153 u_int16_t bkbs; /* [-k] backup boot sector */ 154}; 155.Ed 156.Sh EXAMPLES 157.Bd -literal -offset indent 158newfs_msdos /dev/ad0s1 159.Ed 160.Pp |
161Create a file system, using default parameters, on |
162.Pa /dev/ad0s1 . 163.Bd -literal -offset indent 164newfs_msdos -f 1440 -L foo fd0 165.Ed 166.Pp |
167Create a standard 1.44M file system, with volume label |
168.Ar foo , 169on 170.Pa /dev/fd0 . 171.Sh SEE ALSO 172.Xr disktab 5 , 173.Xr disklabel 8 , 174.Xr fdisk 8 , 175.Xr newfs 8 176.Sh DIAGNOSTICS 177Exit status is 0 on success and 1 on error. 178.Sh HISTORY 179The 180.Nm 181utility first appeared in 182.Fx 3.0 . 183.Sh AUTHORS 184.An Robert Nordier Aq rnordier@FreeBSD.org . |