MKFS(8)

NAME
mkfs - construct a file system

SYNOPSIS
/usr/etc/mkfs [ -N ] special size [ nsect ] [ ntrack ]
[ blksize ] [ fragsize ] [ ncpg ] [ minfree ]
[ rps ] [ nbpi ] [ opt ] [ apc ] [ rot ] [ nrpos ] [ maxcontig ]

DESCRIPTION

Note: file systems are normally created with the newfs(8) command.

mkfs constructs a file system by writing on the special file special unless the -N flag has been specified. special must be specified as a raw device and disk partition. For example, to create a file system on sd0, specify /dev/rsd0[a-h], where a-h is the disk partition.

The numeric size specifies the number of sectors in the file system. mkfs builds a file system with a root directory and a lost+found directory (see fsck(8)). The number of inodes is calculated as a function of the file system size. No boot program is initialized by mkfs (see newfs(8)).

You must be super-user to use this command.

OPTIONS

-N  Print out the file system parameters without actually creating the file system.

The following arguments allow fine tune control over the parameters of the file system.

nsect
    The number of sectors per track on the disk. The default is 32.

ntrack
    The number of tracks per cylinder on the disk. The default is 16.

blksize
    The primary block size for files on the file system. It must be a power of two, currently selected from 4096 or 8192 (the default).

fragsize
    The fragment size for files on the file system. The fragsize represents the smallest amount of disk space that will be allocated to a file. It must be a power of two currently selected from the range 512 to 8192. The default is 1024.

ncpg
    The number of disk cylinders per cylinder group. The default is 16.

minfree
    The minimum percentage of free disk space allowed. Once the file system capacity reaches this threshold, only the super-user is allowed to allocate disk blocks. The default value is 10%.

rps The rotational speed of the disk, in revolutions per second. The default is 60.

nbpi
    The number of bytes for which one inode block is allocated. This parameter is currently set at one inode block for every 2048 bytes.

opt Space or time optimization preference; s specifies optimization for space, t specifies optimization for time. The default is t.

apc The number of alternates per cylinder (SCSI devices only). The default is 0.

rot The expected time (in milliseconds) to service a transfer completion interrupt and initiate a new transfer on the same disk. It is used to decide how much rotational spacing to place between successive blocks in a file. The default is 1.

    Note: in earlier releases mkfs tried to guess what the right value for this parameter by querying the controller type. Since mkfs is a more primitive interface, this query has been moved into newfs. mkfs now does exactly what you tell it to do.

nrpos
    The number of distinguished rotational positions. The default is 8.

maxcontig
    The maximum number of blocks that will be allocated contiguously before inserting a rotational delay. The default is 1.

    Note: This parameter also controls clustering. Regardless of the value of rotdelay, clustering is enabled only when maxcontig is greater than 1. Clustering allows higher I/O rates for sequential I/O and is described in tunefs(8).

Users with special demands for their file systems are referred to the paper cited below for a discussion of the tradeoffs in using different configurations.

SEE ALSO
dir(5), fs(5), fsck(8), newfs(8), tunefs(8)

McKusick, Joy, Leffler; A Fast File System for UNIX

NOTES

newfs(8) is preferred for most routine uses.