| NEWFS_MSDOS(8) | System Manager's Manual | NEWFS_MSDOS(8) |
newfs_msdos —
construct a new MS-DOS (FAT) file system
newfs_msdos |
[-N]
[-a FAT-size]
[-B boot]
[-b block-size]
[-c cluster-size]
[-e dirents]
[-F FAT-type]
[-f format]
[-h heads]
[-I volid]
[-i info]
[-k backup]
[-L label]
[-m media]
[-n FATs]
[-O OEM]
[-o hidden]
[-r reserved]
[-S sector-size]
[-s total]
[-u track-size] special
[disktype] |
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 special file should be a raw device, for example /dev/rsd0i; if a relative path like sd0i is specified, the corresponding raw device is used.
The options are as follows:
-a
FAT-size-B
boot-b
block-size-c
cluster-size-e
dirents-F
FAT-type-f
format-h
heads-I
volid-i
info-k
backup-L
label-m
media-N-n
FATs-O
OEM-o
hidden-r
reserved-S
sector-size-s
total-u
track-sizeFAT 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 {
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 */
};
Create a file system, using default parameters, on /dev/rwd0i.
newfs_msdos /dev/rwd0iCreate a standard 1.44M file system, with volume label "foo", on /dev/rfd0c.
newfs_msdos -f 1440 -L foo
fd0cExit status is 0 on success and 1 on error.
The newfs_msdos command first appeared in
OpenBSD 2.1.
Robert Nordier <rnordier@FreeBSD.org>.
| July 10, 2014 | openbsd |