2004-09-23 03:52:38 +04:00
|
|
|
.\" $NetBSD: newfs_msdos.8,v 1.14 2004/09/22 23:52:38 thorpej Exp $
|
2004-09-23 03:40:49 +04:00
|
|
|
.\"
|
2001-09-10 22:27:41 +04:00
|
|
|
.\" Copyright (c) 1998 Robert Nordier
|
1997-03-01 22:42:54 +03:00
|
|
|
.\" All rights reserved.
|
|
|
|
.\"
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
2001-09-10 22:27:41 +04:00
|
|
|
.\" notice, this list of conditions and the following disclaimer in
|
|
|
|
.\" the documentation and/or other materials provided with the
|
|
|
|
.\" distribution.
|
1997-03-01 22:42:54 +03:00
|
|
|
.\"
|
2001-09-10 22:27:41 +04:00
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS
|
|
|
|
.\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
|
|
.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY
|
|
|
|
.\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
|
|
|
.\" GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
|
|
.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
|
|
|
.\" IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
|
|
.\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
|
|
|
.\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
1997-03-01 22:42:54 +03:00
|
|
|
.\"
|
2001-09-10 22:27:41 +04:00
|
|
|
.\" From: $FreeBSD: src/sbin/newfs_msdos/newfs_msdos.8,v 1.13 2001/08/14 10:01:48 ru Exp $
|
1997-03-01 22:42:54 +03:00
|
|
|
.\"
|
2004-09-23 03:40:49 +04:00
|
|
|
.Dd September 22, 2004
|
1997-03-01 22:42:54 +03:00
|
|
|
.Dt NEWFS_MSDOS 8
|
2001-09-10 22:27:41 +04:00
|
|
|
.Os
|
1997-03-01 22:42:54 +03:00
|
|
|
.Sh NAME
|
|
|
|
.Nm newfs_msdos
|
2001-09-10 22:27:41 +04:00
|
|
|
.Nd construct a new MS-DOS (FAT) file system
|
1997-03-01 22:42:54 +03:00
|
|
|
.Sh SYNOPSIS
|
|
|
|
.Nm
|
2001-09-10 22:27:41 +04:00
|
|
|
.Op Fl N
|
|
|
|
.Op Fl B Ar boot
|
|
|
|
.Op Fl F Ar FAT-type
|
|
|
|
.Op Fl I Ar volid
|
|
|
|
.Op Fl L Ar label
|
|
|
|
.Op Fl O Ar OEM
|
|
|
|
.Op Fl S Ar sector-size
|
|
|
|
.Op Fl a Ar FAT-size
|
|
|
|
.Op Fl b Ar block-size
|
|
|
|
.Op Fl c Ar cluster-size
|
|
|
|
.Op Fl e Ar dirents
|
|
|
|
.Op Fl f Ar format
|
|
|
|
.Op Fl h Ar heads
|
|
|
|
.Op Fl i Ar info
|
|
|
|
.Op Fl k Ar backup
|
|
|
|
.Op Fl m Ar media
|
|
|
|
.Op Fl n Ar FATs
|
|
|
|
.Op Fl o Ar hidden
|
|
|
|
.Op Fl r Ar reserved
|
|
|
|
.Op Fl s Ar total
|
|
|
|
.Op Fl u Ar track-size
|
|
|
|
.Ar special
|
|
|
|
.Op Ar disktype
|
1997-03-01 22:42:54 +03:00
|
|
|
.Sh DESCRIPTION
|
2001-09-10 22:27:41 +04:00
|
|
|
The
|
1998-04-29 13:49:10 +04:00
|
|
|
.Nm
|
2001-09-10 22:27:41 +04:00
|
|
|
utility creates a FAT12, FAT16, or FAT32 file system on device
|
|
|
|
.Ar special ,
|
|
|
|
using
|
|
|
|
.Xr disktab 5
|
|
|
|
entry
|
|
|
|
.Ar disktype
|
|
|
|
to determine geometry, if required.
|
1997-03-01 22:42:54 +03:00
|
|
|
.Pp
|
2001-09-10 22:27:41 +04:00
|
|
|
The options are as follow:
|
|
|
|
.Bl -tag -width indent
|
|
|
|
.It Fl N
|
|
|
|
Don't create a file system: just print out parameters.
|
|
|
|
.It Fl B Ar boot
|
|
|
|
Get bootstrap from file.
|
|
|
|
.It Fl F Ar FAT-type
|
|
|
|
FAT type (one of 12, 16, or 32).
|
|
|
|
.It Fl I Ar volid
|
|
|
|
Volume ID.
|
|
|
|
.It Fl L Ar label
|
2002-10-01 17:40:23 +04:00
|
|
|
Volume label (up to 11 characters).
|
|
|
|
The label should consist of only those characters permitted
|
|
|
|
in regular DOS (8+3) filenames.
|
2004-09-23 03:52:38 +04:00
|
|
|
The default is
|
|
|
|
.Qq Li "NO_NAME" .
|
2001-09-10 22:27:41 +04:00
|
|
|
.It Fl O Ar OEM
|
2002-10-01 17:40:23 +04:00
|
|
|
OEM string (up to 8 characters).
|
|
|
|
The default is
|
2004-09-23 03:46:38 +04:00
|
|
|
.Qq Li "NetBSD" .
|
2001-09-10 22:27:41 +04:00
|
|
|
.It Fl S Ar sector-size
|
2002-10-01 17:40:23 +04:00
|
|
|
Number of bytes per sector.
|
|
|
|
Acceptable values are powers of 2 in the range 128 through 32768.
|
2001-09-10 22:27:41 +04:00
|
|
|
.It Fl a Ar FAT-size
|
|
|
|
Number of sectors per FAT.
|
|
|
|
.It Fl b Ar block-size
|
2002-10-01 17:40:23 +04:00
|
|
|
File system block size (bytes per cluster).
|
|
|
|
This should resolve to an acceptable number of sectors
|
|
|
|
per cluster (see below).
|
2001-09-10 22:27:41 +04:00
|
|
|
.It Fl c Ar cluster-size
|
2002-10-01 17:40:23 +04:00
|
|
|
Sectors per cluster.
|
|
|
|
Acceptable values are powers of 2 in the range 1 through 128.
|
2001-09-10 22:27:41 +04:00
|
|
|
.It Fl e Ar dirents
|
|
|
|
Number of root directory entries (FAT12 and FAT16 only).
|
|
|
|
.It Fl f Ar format
|
2002-10-01 17:40:23 +04:00
|
|
|
Specify a standard (floppy disk) format.
|
|
|
|
The standard formats are (capacities in kilobytes):
|
|
|
|
160, 180, 320, 360, 640, 720, 1200, 1232, 1440, 2880.
|
2001-09-10 22:27:41 +04:00
|
|
|
.It Fl h Ar heads
|
|
|
|
Number of drive heads.
|
|
|
|
.It Fl i Ar info
|
|
|
|
Location of the file system info sector (FAT32 only).
|
|
|
|
A value of 0xffff signifies no info sector.
|
|
|
|
.It Fl k Ar backup
|
2002-10-01 17:40:23 +04:00
|
|
|
Location of the backup boot sector (FAT32 only).
|
|
|
|
A value of 0xffff signifies no backup sector.
|
2001-09-10 22:27:41 +04:00
|
|
|
.It Fl m Ar media
|
|
|
|
Media descriptor (acceptable range 0xf0 to 0xff).
|
|
|
|
.It Fl n Ar FATs
|
2002-10-01 17:40:23 +04:00
|
|
|
Number of FATs.
|
|
|
|
Acceptable values are 1 to 16 inclusive.
|
|
|
|
The default is 2.
|
2001-09-10 22:27:41 +04:00
|
|
|
.It Fl o Ar hidden
|
|
|
|
Number of hidden sectors.
|
|
|
|
.It Fl r Ar reserved
|
|
|
|
Number of reserved sectors.
|
|
|
|
.It Fl s Ar total
|
|
|
|
File system size.
|
|
|
|
.It Fl u Ar track-size
|
|
|
|
Number of sectors per track.
|
1997-03-01 22:42:54 +03:00
|
|
|
.El
|
2003-04-21 11:58:55 +04:00
|
|
|
.Pp
|
|
|
|
If
|
|
|
|
.Nm
|
|
|
|
receives a
|
|
|
|
.Dv SIGINFO
|
|
|
|
signal
|
|
|
|
(see the
|
|
|
|
.Sy status
|
|
|
|
argument for
|
|
|
|
.Xr stty 1 ) ,
|
|
|
|
a line will be written to the standard error output indicating
|
|
|
|
the name of the device currently being formatted, the sector
|
|
|
|
number being written, and the total number of sectors to be written.
|
2001-09-10 22:27:41 +04:00
|
|
|
.Sh NOTES
|
|
|
|
FAT file system parameters occupy a "Boot Sector BPB (BIOS Parameter
|
|
|
|
Block)" in the first of the "reserved" sectors which precede the actual
|
2002-10-01 17:40:23 +04:00
|
|
|
file system.
|
|
|
|
For reference purposes, this structure is presented below.
|
2001-09-10 22:27:41 +04:00
|
|
|
.Bd -literal
|
|
|
|
struct bsbpb {
|
|
|
|
u_int16_t bps; /* [-S] bytes per sector */
|
|
|
|
u_int8_t spc; /* [-c] sectors per cluster */
|
|
|
|
u_int16_t res; /* [-r] reserved sectors */
|
|
|
|
u_int8_t nft; /* [-n] number of FATs */
|
|
|
|
u_int16_t rde; /* [-e] root directory entries */
|
|
|
|
u_int16_t sec; /* [-s] total sectors */
|
|
|
|
u_int8_t mid; /* [-m] media descriptor */
|
|
|
|
u_int16_t spf; /* [-a] sectors per FAT */
|
|
|
|
u_int16_t spt; /* [-u] sectors per track */
|
|
|
|
u_int16_t hds; /* [-h] drive heads */
|
|
|
|
u_int32_t hid; /* [-o] hidden sectors */
|
|
|
|
u_int32_t bsec; /* [-s] big total sectors */
|
|
|
|
};
|
|
|
|
/* FAT32 extensions */
|
|
|
|
struct bsxbpb {
|
|
|
|
u_int32_t bspf; /* [-a] big sectors per FAT */
|
|
|
|
u_int16_t xflg; /* control flags */
|
|
|
|
u_int16_t vers; /* file system version */
|
|
|
|
u_int32_t rdcl; /* root directory start cluster */
|
|
|
|
u_int16_t infs; /* [-i] file system info sector */
|
|
|
|
u_int16_t bkbs; /* [-k] backup boot sector */
|
|
|
|
};
|
|
|
|
.Ed
|
|
|
|
.Sh EXAMPLES
|
|
|
|
.Bd -literal -offset indent
|
2004-09-23 03:40:49 +04:00
|
|
|
newfs_msdos /dev/rwd1a
|
2001-09-10 22:27:41 +04:00
|
|
|
.Ed
|
1997-03-01 22:42:54 +03:00
|
|
|
.Pp
|
2001-09-10 22:27:41 +04:00
|
|
|
Create a file system, using default parameters, on
|
2004-09-23 03:40:49 +04:00
|
|
|
.Pa /dev/rwd1a .
|
2001-09-10 22:27:41 +04:00
|
|
|
.Bd -literal -offset indent
|
2004-09-23 03:40:49 +04:00
|
|
|
newfs_msdos -f 1440 -L foo /dev/rfd0a
|
2001-09-10 22:27:41 +04:00
|
|
|
.Ed
|
|
|
|
.Pp
|
|
|
|
Create a standard 1.44M file system, with volume label
|
|
|
|
.Ar foo ,
|
|
|
|
on
|
2004-09-23 03:40:49 +04:00
|
|
|
.Pa /dev/rfd0a .
|
2001-11-16 14:21:37 +03:00
|
|
|
.Sh DIAGNOSTICS
|
|
|
|
Exit status is 0 on success and 1 on error.
|
1997-03-01 22:42:54 +03:00
|
|
|
.Sh SEE ALSO
|
2001-09-10 22:27:41 +04:00
|
|
|
.Xr disktab 5 ,
|
|
|
|
.Xr disklabel 8 ,
|
|
|
|
.Xr fdisk 8 ,
|
1998-05-22 22:27:50 +04:00
|
|
|
.Xr newfs 8
|
1997-03-01 22:42:54 +03:00
|
|
|
.Sh HISTORY
|
2001-09-10 22:27:41 +04:00
|
|
|
The
|
1997-03-01 22:42:54 +03:00
|
|
|
.Nm
|
2001-09-10 22:27:41 +04:00
|
|
|
command first appeared in
|
2004-09-23 03:40:49 +04:00
|
|
|
.Nx 1.3 .
|
2001-09-10 22:27:41 +04:00
|
|
|
.Sh AUTHORS
|
|
|
|
.An Robert Nordier Aq rnordier@FreeBSD.org .
|