NAME
newfs_msdos — construct a new MS-DOS (FAT) file system
SYNOPSIS
newfs_msdos [−N] [−B boot] [−F FAT-type] [−I volid] [−O OEM] [−S sector-size] [−a FAT-size] [−b block-size] [−c cluster-size] [−e dirents] [−f format] [−h heads] [−i info] [−k backup] [−m media] [−n FATs] [−o hidden] [−r reserved] [−s total] [−u track-size] [−v volume-name] special [disktype]
DESCRIPTION
The newfs_msdos utility creates a FAT12, FAT16, or FAT32 file system on device special, using disktab(5) entry disktype to determine geometry, if required.
The options are as follow:
−N
Don’t create a file system: just print out parameters.
−B boot
Get bootstrap from file.
−F FAT-type
FAT type (one of 12, 16, or 32).
−I volid
Volume ID.
−O OEM
OEM string (up to 8 characters). The default is "BSD 4.4".
−S sector-size
Number of bytes per sector. Acceptable values are powers of 2 in the range 128 through 32768.
−a FAT-size
Number of sectors per FAT.
−b block-size
File system block size (bytes per cluster). This should resolve to an acceptable number of sectors per cluster (see below).
−c cluster-size
Sectors per cluster. Acceptable values are powers of 2 in the range 1 through 128.
−e dirents
Number of root directory entries (FAT12 and FAT16 only).
−f format
Specify a standard (floppy disk) format. The eight standard formats are (capacities in kilobytes): 160, 180, 320, 360, 640, 720, 1200, 1232, 1440, 2880.
−h heads
Number of drive heads.
−i info
Location of the file system info sector (FAT32 only). A value of 0xffff signifies no info sector.
−k backup
Location of the backup boot sector (FAT32 only). A value of 0xffff signifies no backup sector.
−m media
Media descriptor (acceptable range 0xf0 to 0xff).
−n FATs
Number of FATs. Acceptable values are 1 to 16 inclusive. The default is 2.
−o hidden
Number of hidden sectors.
−r reserved
Number of reserved sectors.
−s total
File system size.
−u track-size
Number of sectors per track.
−v volume-name
Volume name (filesystem name), up to 11 characters. The name should consist of only those characters permitted in regular DOS (8+3) filenames.
NOTES
FAT file system parameters occupy a "Boot Sector BPB (BIOS Parameter Block)" in the first of the "reserved" sectors which precede the actual file system. For reference purposes, this structure is presented below.
struct bsbpb {
bps; |
/* [-S] bytes per sector */ |
|||||
spc; |
/* [-c] sectors per cluster */ |
|||||
res; |
/* [-r] reserved sectors */ |
|||||
nft; |
/* [-n] number of FATs */ |
|||||
rde; |
/* [-e] root directory entries */ |
|||||
sec; |
/* [-s] total sectors */ |
|||||
mid; |
/* [-m] media descriptor */ |
|||||
spf; |
/* [-a] sectors per FAT */ |
|||||
spt; |
/* [-u] sectors per track */ |
|||||
hds; |
/* [-h] drive heads */ |
|||||
hid; |
/* [-o] hidden sectors */ |
|||||
bsec; |
/* [-s] big total sectors */ |
};
/* FAT32 extensions */
struct bsxbpb {
bspf; |
/* [-a] big sectors per FAT */ |
|||||
xflg; |
/* control flags */ |
|||||
vers; |
/* file system version */ |
|||||
rdcl; |
/* root directory start cluster */ |
|||||
infs; |
/* [-i] file system info sector */ |
|||||
bkbs; |
/* [-k] backup boot sector */ |
};
EXAMPLES
newfs_msdos /dev/disk0s1
Create a file system, using default parameters, on /dev/disk0s1.
newfs_msdos -f 1440 -v foo fd0
Create a standard 1.44M file system, with volume name "foo", on /dev/fd0.
SEE ALSO
DIAGNOSTICS
Exit status is 0 on success and 1 on error.
HISTORY
The newfs_msdos command appeared in FreeBSD 3.0.
AUTHORS
Robert Nordier <rnordier [AT] FreeBSD.org>.
BSD July 6, 1998 BSD