NEWFS(8)

NAME
newfs - construct a new file system

SYNOPSIS
/etc/newfs [ -N ] [ -C ] [ [ -v ] [ options ] special [ disktype ]

DESCRIPTION
The operating system programs newfs and mkfs(8) are the same program binary. newfs provides a friendly interface to create file systems on disks. special is the device special file on which the new filesystem is to be created. newfs consults the VTOC residing on the disk to determine the characteristics of the disk. A set of parameters for the disk are then calculated from these characteristics; if no VTOC is present on the disk, the disktype parameter must be specified; newfs will then look up the disk characteristics in /etc/diskinfo.

If the -v option is specified, newfs prints out parameters which could be supplied to the mkfs interface for making file systems.

The -N option causes the file system parameters to be printed out without really creating the file system.

The -C option will cause newfs to calculate the inodes per cylinder group in a manner which matches previous (pre-3.1) versions of newfs. This option would primarily be used when compatibility with previous versions of the filesystem is needed. Keep in mind that the calculations will take into account any changes to the default bytes per inode density (see -i and -I below).

Note that newfs will not install any system bootstraps on the disk. To install a bootstrap, use the installboot(8) command.

newfs uses fsirand(8) as a security precaution for file systems which are mounted over NFS.

The following options define the general layout policies.

-b blocksize
    The block size of the file system in bytes. The default is taken from the VTOC or default disk parameters.

-f frag_size
    The fragment size of the file system in bytes. The default is taken from the VTOC or default disk parameters.

-m free_space %
    The percentage of space reserved from normal users; the minimum free space threshold. The default is 10%. See tunefs(8) for more information on setting this option.

-a maxcontig
    The maximum number of contiguous blocks that will be laid out before forcing a rotational delay (see -d below). The default is 1. See tunefs(8) for more information on setting this option.

-d rotdelay
    The expected time (in milliseconds) to service a transfer completion interrupt and initiate a new transfer on the same disk. The default is 4 milliseconds. See tunefs(8) for more information on setting this option.

-e maxbpg
    Indicates the maximum number of blocks any single file can allocate from one 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 tunefs(8) for more information on setting this option.

-i number_of_bytes_per_inode
    This specifies the density of inodes in the file system. The default is to create an inode for each 2048 bytes of data space. If fewer inodes are desired, a larger number should be used; to create more inodes a smaller number should be given. Be sure to specify this option for small filesystems (less than one cylinder group) or the number of inodes created will be too large. Note that this option will override any alterations made by the -I option (below) if it had previously been given.

-I percentage_of_bytes_per_inode
    This specifies a percentage modifier for the inode density of the filesystem. The modification will be applied to the default density unless the -i flag has previously been given, in which case the new density will be modified. The modification is a simple multiplier based on the percentage given. 1000 would multiply the density by 10 (1000%), while 50 will divide by 2 (50%).

-c #cylinders_per_group
    The number of cylinders per cylinder group in a file system. The default is 16.

-s size
    The size of the file system in sectors. The default is taken from the VTOC or default disk parameters.

The following options override the standard sizes for the disk geometry. Their default values are taken from the VTOC, or are coded internally to newfs. Changing these defaults is useful when using newfs 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).

-r revolutions_per_minute
    The speed of the disk in revolutions per minute.

-S sector-size
    The size of a sector in bytes (almost never anything but 512).

-u sectors_per_track
    The number of sectors/track available for data allocation by the file system. This does not include sectors reserved at the end of each track for bad block replacement (see -p below).

-t #tracks_per_cylinder
    The number of tracks/cylinder available for data allocation by the file system.

-p spare_sectors_per_track
    Spare sectors (bad sector replacements) are physical sectors that occupy space at the end of each track. They are not counted as part of the sectors/track (-u) since they are not available to the file system for data allocation.

-x spare_sectors_per_cylinder
    Spare sectors (bad sector replacements) are physical sectors that occupy space at the end of the last track in the cylinder. They are deducted from the sectors/track (-u) of the last track of each cylinder since they are not available to the file system for data allocation.

-l hardware_sector_interleave
    Used to describe the media format to compensate for a slow controller. Interleave is physical sector interleave on each track, specified as the denominator of the ratio:
    	sectors read / sectors passed over
    Thus an interleave of 1/1 implies contiguous layout, while 1/2 implies logical sector 0 is separated by one sector from logical sector 1.

-k skew
    Used to describe the media format to compensate for a slow controller. Track skew is the offset of sector 0 on track N relative to sector 0 on track N-1 on the same cylinder.

SEE ALSO
fsck(8), fsirand(8), installboot(8), mkfs(8), mkvtoc(8), prtvtoc(8), tunefs(8), fs(5), diskinfo(5)