.TH MKFS 8 .UC .SH NAME mkfs \- construct a file system .SH SYNTAX .B /etc/mkfs special proto [m] [n] .br .B /etc/mkfs special size [m] [n] .SH DESCRIPTION .I Mkfs constructs a file system by writing on the special file .I special according to the directions found in the prototype file .IR proto . The prototype file contains tokens separated by spaces or new lines. The first token is the name of a file to be copied onto block zero as the bootstrap program, see \fIboot\fP\|(8). The second token is a number specifying the size of the created file system. Typically it will be the number of logical blocks on the device (not necessarily the same as physical blocks), perhaps diminished by space for swapping. The next token is the number of inodes in the i-list. The next set of tokens comprise the specification for the root file. File specifications consist of tokens giving the mode, the user id, the group id, and the initial contents of the file. The syntax of the contents field depends on the mode. .PP The mode token for a file is a 6 character string. The first character specifies the type of the file. (The characters .B \-bcd specify regular, block special, character special and directory files respectively.) The second character of the type is either .B u or .B \- to specify set-user-id mode or not. The third is .B g or .B \- for the set-group-id mode. The rest of the mode is a three digit octal number giving the owner, group, and other read, write, execute permissions, see \fIchmod\fP\|(1). .PP Two decimal number tokens come after the mode; they specify the user and group ID's of the owner of the file. .PP If the file is a regular file, the next token is a pathname whence the contents and size are copied. .PP If the file is a block or character special file, two decimal number tokens follow which give the major and minor device numbers. .PP If the file is a directory, .I mkfs makes the entries .BR . "" and .B .. and then reads a list of names and (recursively) file specifications for the entries in the directory. The scan is terminated with .BR $ . .PP If the prototype file cannot be opened and its name consists of a string of digits, .I mkfs builds a file system with an empty directory in it. .I Mkfs always constructs a lost+found directory. The size of the file system, in logical blocks, is the value of .I proto interpreted as a decimal number. The number of inodes is calculated as a function of the filsystem size. The boot program is left uninitialized. .PP The optional flags \fIm\fP and \fIn\fP determine the block interleaving of the freelist that will be constructed, where \fIm\fP is the distance between successive 1024-byte blocks, and \fIn\fP is the number of blocks before the pattern repeats, typically one cylinder. The optimal values for these parameters vary with the speed and geometry of the disk, as well as the speed of the processor. .PP A sample prototype specification follows: .PP .nf .in +5 /usr/src/sys/mdec/rkuboot 2436 55 d\-\-777 3 1 usr d\-\-777 3 1 sh \-\-\-755 3 1 /bin/sh ken d\-\-755 6 1 $ b0 b\-\-644 3 1 0 0 c0 c\-\-644 3 1 0 0 $ $ .in -5 .fi .SH FILES .ta 2.5i /usr/src/sys/mdec/*uboot bootstrap binaries .SH "SEE ALSO" dir(5), filsys(5), boot(8) .SH BUGS There should be some way to specify links.