p Options with numeric arguments may contain an optional (case-insensitive) suffix: l -tag -width 3n -offset indent -compact t b Bytes; causes no modification. (Default) t k Kilo; multiply the argument by 1024 t m Mega; multiply the argument by 1048576 t g Giga; multiply the argument by 1073741824 .El
p The following options define the general layout policies. l -tag -width Fl t Fl a Ar maxcontig This specifies the maximum number of contiguous blocks that will be laid out before forcing a rotational delay (see the .Fl d option). The default value is 8. See .Xr tunefs 8 for more details on how to set this option. t Fl B Ar byte-order Specify the metadata byte order of the file system to be created. Valid byte orders are .Sq be and .Sq le . If no byte order is specified, the file system is created in host byte order. t Fl b Ar block-size The block size of the file system, in bytes. It must be a power of two. The smallest allowable size is 4096 bytes. The default size depends upon the size of the file system:
p l -tag -width "file system size" -compact -offset indent t Sy "file system size" .Ar block-size t \*[Lt] 20 MB 4 KB t \*[Lt] 1024 MB 8 KB t \*[Gt]= 1024 MB 16 KB .El t Fl e Ar maxbpg This indicates the maximum number of blocks any single file can allocate out of a cylinder group before it is forced to begin allocating blocks from another cylinder group. The default is about one quarter of the total blocks in a cylinder group. See .Xr tunefs 8 for more details on how to set this option. t Fl F Create a file system image in .Ar special . The file system size needs to be specified with .Dq Fl s Ar size . No attempts to use or update the disk label will be made. t Fl f Ar frag-size The fragment size of the file system in bytes. It must be a power of two ranging in value between .Ar block-size Ns /8 and .Ar block-size . The optimal .Ar block-size : Ns Ar frag-size ratio is 8:1. Other ratios are possible, but are not recommended, and may produce unpredictable results. The default size depends upon the size of the file system:
p l -tag -width "file system size" -compact -offset indent t Sy "file system size" .Ar frag-size t \*[Lt] 20 MB 0.5 KB t \*[Lt] 1024 MB 1 KB t \*[Gt]= 1024 MB 2 KB .El t Fl g Ar avgfilesize The expected average file size for the file system. t Fl h Ar avgfpdir The expected average number of files per directory on the file system. t Fl I Do not require that the file system type listed in the disk label is .Ql 4.2BSD or .Ql Apple UFS . t Fl i Ar bytes-per-inode This specifies the density of inodes in the file system. If fewer inodes are desired, a larger number should be used; to create more inodes a smaller number should be given. The default is to create an inode for every
q 4 * Ar frag-size bytes of data space:
p l -tag -width "file system size" -compact -offset indent t Sy "file system size" .Ar bytes-per-inode t \*[Lt] 20 MB 2 KB t \*[Lt] 1024 MB 4 KB t \*[Gt]= 1024 MB 8 KB .El t Fl m Ar free-space The percentage of space reserved from normal users; the minimum free space threshold. The default value used is 5%. See .Xr tunefs 8 for more details on how to set this option. t Fl N Causes the file system parameters to be printed out without really creating the file system. t Fl O Ar filesystem-format Select the filesystem-format l -tag -width 3n -offset indent -compact t 0 4.3BSD; This option is primarily used to build root file systems that can be understood by older boot ROMs. t 1 FFS; normal fast-filesystem (default). t 2 UFS2; enhanced fast-filesystem (suited for more than 1 Terabyte capacity, access control lists). .El t Fl o Ar optimization Optimization preference; either .Dq space or .Dq time . The file system can either be instructed to try to minimize the time spent allocating blocks, or to try to minimize the space fragmentation on the disk. If the value of minfree (see above) is less than 5%, the default is to optimize for space; if the value of minfree is greater than or equal to 5%, the default is to optimize for time. See .Xr tunefs 8 for more details on how to set this option. t Fl s Ar size The size of the file system in sectors. An .Sq s suffix will be interpreted as the number of sectors (the default). All other suffixes are interpreted as per other numeric arguments, except that the number is converted into sectors by dividing by the sector size (as specified by .Fl S Ar secsize ) after suffix interpretation. t Fl T Ar disk-type Uses information for the specified disk from
a /etc/disktab instead of trying to get the information from the disk label. t Fl v Ar volname This specifies that an Apple UFS filesystem should be created with the given volume name. t Fl Z Pre-zeros the file system image created with .Fl F . This is necessary if the image is to be used by .Xr vnd 4 (which doesn't support file systems with .Sq holes ) . .El
p The following option overrides the standard sizes for the disk geometry. The default value is taken from the disk label. Changing this default is useful only when using .Nm to build a file system whose raw image will eventually be used on a different type of disk than the one on which it is initially created (for example on a write-once disk). Note that changing this value from its default will make it impossible for .Xr fsck_ffs 8 to find the alternative superblocks if the standard superblock is lost. l -tag -width Fl t Fl S Ar sector-size The size of a sector in bytes (almost never anything but 512). Defaults to 512. .El .Sh NOTES If the file system will be exported over NFS, the .Xr fsirand 8 utility should be run after .Nm to improve security.
p The owner and group ids of the root node of the new file system are set to the effective uid and gid of the user initializing the file system.
p
For the
.Nm
command to succeed,
the disk label should first be updated such that the fstype field for the
partition is set to
.Ql 4.2BSD
or
.Ql Apple UFS ,
unless
.Fl F
or
.Fl I
is used.
.Sh SEE ALSO
.Xr disktab 5 ,
.Xr fs 5 ,
.Xr disklabel 8 ,
.Xr diskpart 8 ,
.Xr dumpfs 8 ,
.Xr format 8 ,
.Xr fsck_ffs 8 ,
.Xr fsirand 8 ,
.Xr mount 8 ,
.Xr mount_mfs 8 ,
.Xr tunefs 8
.Rs
.%A M. McKusick
.%A W. Joy
.%A S. Leffler
.%A R. Fabry
.%T A Fast File System for UNIX ,
.%J ACM Transactions on Computer Systems 2
.%V 3
.%P pp 181-197
.%D August 1984
.%O (reprinted in the BSD System Manager's Manual)
.Re
.Sh HISTORY
The
.Nm
command appeared in
x 4.2 .