newfs_msdos.8 (174478) | newfs_msdos.8 (185587) |
---|---|
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.\" | 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 174478 2007-12-09 13:34:10Z remko $ | 26.\" $FreeBSD: head/sbin/newfs_msdos/newfs_msdos.8 185587 2008-12-03 18:22:36Z luigi $ |
27.\" 28.Dd December 8, 2007 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 | 27.\" 28.Dd December 8, 2007 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 @ Ar offset |
|
37.Op Fl B Ar boot | 38.Op Fl B Ar boot |
39.Op Fl C Ar create-size |
|
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 42.Op Fl S Ar sector-size 43.Op Fl a Ar FAT-size 44.Op Fl b Ar block-size 45.Op Fl c Ar cluster-size --- 8 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 | 40.Op Fl F Ar FAT-type 41.Op Fl I Ar volid 42.Op Fl L Ar label 43.Op Fl O Ar OEM 44.Op Fl S Ar sector-size 45.Op Fl a Ar FAT-size 46.Op Fl b Ar block-size 47.Op Fl c Ar cluster-size --- 8 unchanged lines hidden (view full) --- 56.Op Fl r Ar reserved 57.Op Fl s Ar total 58.Op Fl u Ar track-size 59.Ar special 60.Op Ar disktype 61.Sh DESCRIPTION 62The 63.Nm |
62utility creates a FAT12, FAT16, or FAT32 file system on device | 64utility creates a FAT12, FAT16, or FAT32 file system on device or file named |
63.Ar special , 64using 65.Xr disktab 5 66entry 67.Ar disktype 68to determine geometry, if required. 69.Pp | 65.Ar special , 66using 67.Xr disktab 5 68entry 69.Ar disktype 70to determine geometry, if required. 71.Pp |
72If 73.Ar special 74does not contain a 75.Ar / , 76it is assumed to be a device name and 77.Ar /dev 78is prepended to the name to construct the actual device name. 79To work a file in the current directory use 80.Ar ./filename 81.Pp |
|
70The options are as follow: 71.Bl -tag -width indent 72.It Fl N 73Do not create a file system: just print out parameters. | 82The options are as follow: 83.Bl -tag -width indent 84.It Fl N 85Do not create a file system: just print out parameters. |
86.It Fl @ Ar offset 87Build the filesystem at the specified offset in bytes in the device or file. 88A suffix s, k, m, g (lower or upper case) 89appended to the offset specifies that the 90number is in sectors, kilobytes, megabytes or gigabytes, respectively. |
|
74.It Fl B Ar boot 75Get bootstrap from file. | 91.It Fl B Ar boot 92Get bootstrap from file. |
93.It Fl C Ar create-size 94Create the image file with the specified size. A suffix character appended 95to the size is interpreted as for the 96.Fl @ 97option. The file is created by truncating any existing file with the 98same name, seeking just before the required size and writing 99a single 0 byte. As a consequence, the space occupied on disk 100may be smaller than the size specified as a parameter. |
|
76.It Fl F Ar FAT-type 77FAT type (one of 12, 16, or 32). 78.It Fl I Ar volid | 101.It Fl F Ar FAT-type 102FAT type (one of 12, 16, or 32). 103.It Fl I Ar volid |
79Volume ID. | 104Volume ID, a 32 bit number in decimal or hexadecimal (0x...) format. |
80.It Fl L Ar label 81Volume label (up to 11 characters). 82The label should consist of 83only those characters permitted in regular DOS (8+3) filenames. 84.It Fl O Ar OEM 85OEM string (up to 8 characters). 86The default is 87.Qq Li "BSD 4.4" . --- 6 unchanged lines hidden (view full) --- 94.It Fl b Ar block-size 95File system block size (bytes per cluster). 96This should resolve to an 97acceptable number of sectors per cluster (see below). 98.It Fl c Ar cluster-size 99Sectors per cluster. 100Acceptable values are powers of 2 in the range 1011 through 128. | 105.It Fl L Ar label 106Volume label (up to 11 characters). 107The label should consist of 108only those characters permitted in regular DOS (8+3) filenames. 109.It Fl O Ar OEM 110OEM string (up to 8 characters). 111The default is 112.Qq Li "BSD 4.4" . --- 6 unchanged lines hidden (view full) --- 119.It Fl b Ar block-size 120File system block size (bytes per cluster). 121This should resolve to an 122acceptable number of sectors per cluster (see below). 123.It Fl c Ar cluster-size 124Sectors per cluster. 125Acceptable values are powers of 2 in the range 1261 through 128. |
127If the block or cluster size are not specified, the code 128uses a cluster between 512 bytes and 32K depending on 129the filesystem size. |
|
102.It Fl e Ar dirents 103Number of root directory entries (FAT12 and FAT16 only). 104.It Fl f Ar format 105Specify a standard (floppy disk) format. 106The standard formats 107are (capacities in kilobytes): 160, 180, 320, 360, 640, 720, 1200, 1081232, 1440, 2880. 109.It Fl h Ar heads --- 17 unchanged lines hidden (view full) --- 127.It Fl r Ar reserved 128Number of reserved sectors. 129.It Fl s Ar total 130File system size. 131.It Fl u Ar track-size 132Number of sectors per track. 133.El 134.Sh NOTES | 130.It Fl e Ar dirents 131Number of root directory entries (FAT12 and FAT16 only). 132.It Fl f Ar format 133Specify a standard (floppy disk) format. 134The standard formats 135are (capacities in kilobytes): 160, 180, 320, 360, 640, 720, 1200, 1361232, 1440, 2880. 137.It Fl h Ar heads --- 17 unchanged lines hidden (view full) --- 155.It Fl r Ar reserved 156Number of reserved sectors. 157.It Fl s Ar total 158File system size. 159.It Fl u Ar track-size 160Number of sectors per track. 161.El 162.Sh NOTES |
163If some parameters (e.g. size, number of sectors, etc.) are not specified 164through options or disktype, the program tries to generate them 165automatically. In particular, the size is determined as the 166device or file size minus the offset specified with the 167.Fl @ 168option. When the geometry is not available, it is assumed to be 16963 sectors, 255 heads. The size is then rounded to become 170a multiple of the track size and avoid complaints by some filesystem code. 171.Pp |
|
135FAT file system parameters occupy a "Boot Sector BPB (BIOS Parameter 136Block)" in the first of the "reserved" sectors which precede the actual 137file system. 138For reference purposes, this structure is presented 139below. 140.Bd -literal 141struct bsbpb { 142 u_int16_t bps; /* [-S] bytes per sector */ --- 19 unchanged lines hidden (view full) --- 162 u_int16_t bkbs; /* [-k] backup boot sector */ 163}; 164.Ed 165.Sh LIMITATION 166The maximum file size is 4GB, even if the file system itself is bigger. 167.Sh EXIT STATUS 168Exit status is 0 on success and 1 on error. 169.Sh EXAMPLES | 172FAT file system parameters occupy a "Boot Sector BPB (BIOS Parameter 173Block)" in the first of the "reserved" sectors which precede the actual 174file system. 175For reference purposes, this structure is presented 176below. 177.Bd -literal 178struct bsbpb { 179 u_int16_t bps; /* [-S] bytes per sector */ --- 19 unchanged lines hidden (view full) --- 199 u_int16_t bkbs; /* [-k] backup boot sector */ 200}; 201.Ed 202.Sh LIMITATION 203The maximum file size is 4GB, even if the file system itself is bigger. 204.Sh EXIT STATUS 205Exit status is 0 on success and 1 on error. 206.Sh EXAMPLES |
207Create a file system, using default parameters, on 208.Pa /dev/ad0s1 : |
|
170.Bd -literal -offset indent 171newfs_msdos /dev/ad0s1 172.Ed 173.Pp | 209.Bd -literal -offset indent 210newfs_msdos /dev/ad0s1 211.Ed 212.Pp |
174Create a file system, using default parameters, on 175.Pa /dev/ad0s1 . | 213Create a standard 1.44M file system, with volume label 214.Ar foo , 215on 216.Pa /dev/fd0 : |
176.Bd -literal -offset indent 177newfs_msdos -f 1440 -L foo fd0 178.Ed 179.Pp | 217.Bd -literal -offset indent 218newfs_msdos -f 1440 -L foo fd0 219.Ed 220.Pp |
180Create a standard 1.44M file system, with volume label 181.Ar foo , 182on 183.Pa /dev/fd0 . | 221Create a 30MB image file, with the FAT partition starting 22263 sectors within the image file: 223.Bd -literal -offset indent 224newfs_msdos -C 30M -@63s ./somefile 225.Ed |
184.Sh SEE ALSO 185.Xr disktab 5 , 186.Xr disklabel 8 , 187.Xr fdisk 8 , 188.Xr newfs 8 189.Sh HISTORY 190The 191.Nm 192utility first appeared in 193.Fx 3.0 . 194.Sh AUTHORS 195.An Robert Nordier Aq rnordier@FreeBSD.org . | 226.Sh SEE ALSO 227.Xr disktab 5 , 228.Xr disklabel 8 , 229.Xr fdisk 8 , 230.Xr newfs 8 231.Sh HISTORY 232The 233.Nm 234utility first appeared in 235.Fx 3.0 . 236.Sh AUTHORS 237.An Robert Nordier Aq rnordier@FreeBSD.org . |