MKFS(1M) — Kubota Pacfic Computer Inc. (Essential Utilities)
NAME
mkfs − construct a file system
SYNOPSIS
/etc/mkfs special
/etc/mkfs special blocks[:i-nodes] [gap blocks/cyl]
/etc/mkfs special proto [gap blocks/cyl]
/etc/mkfs [ −t type ] filsys proto [ gap blocks/cyl ]
/etc/mkfs [ −t type ] filsys blocks[ :inodes ] [ gap blocks/cyl ]
DESCRIPTION
mkfs constructs a file system by writing on the special file using the values found in the remaining arguments of the command line. Invoking mkfs with only the −t option lists the types of file systems mkfs knows how to create. Names listed on the same line are synonyms; the first type listed is the default type. Invoking mkfs with −t and a file system type gives the command syntax for the file system type.
4KFsTYPE4DanaSVSys5-4K
AFFSaffsFFSffsDANADana
If no other arguments are provided following the special file, the file system is constructed based on the actual size of the disk partition and the physical attributes of the disk.
If the second argument is a string of digits, the size of the file system is the value of blocks interpreted as a decimal number. This is the number of 512-byte sectors the file system will occupy. If the number of i-nodes is not given, the default is the number of logical (512, 1024, or 4096 byte) blocks divided by 4. mkfs builds a file system with a single empty directory on it. The boot program block (block zero) is left uninitialized.
If the second argument is the name of a file that can be opened, mkfs assumes it to be a prototype file proto, and will take its directions from that file. The prototype file contains tokens separated by spaces or new-lines. A sample prototype specification follows (line numbers have been added to aid in the explanation):
1./stand/diskboot
2.4872 110
3.d−−777 3 1
4.usrd−−777 3 1
5.sh−−−755 3 1 /bin/sh
6.kend−−755 6 1
7.$
8.b0b−−644 3 1 0 0
9.c0c−−644 3 1 0 0
10.$
11.$
Line 1 in the example is the name of a file to be copied onto block zero as the bootstrap program.
Line 2 specifies the number of 512-byte sectors the file system is to occupy and the number of i-nodes in the file system.
Lines 3-9 tell mkfs about files and directories to be included in this file system.
Line 3 specifies the root directory.
lines 4-6 and 8-9 specifies other directories and files.
The $ on line 7 tells mkfs to end the branch of the file system it is on, and continue from the next higher directory. The $ on lines 10 and 11 end the process, since no additional specifications follow.
File specifications give the mode, the user ID, the group ID, and the initial contents of the file. Valid syntax for the contents field depends on the first character of the mode.
The mode for a file is specified by a 6-character string. The first character specifies the type of the file. The character range is −bcd to specify regular, block special, character special and directory files respectively. The second character of the mode is either u or − to specify set-user-id mode or not. The third is g or − for the set-group-id mode. The rest of the mode is a 3 digit octal number giving the owner, group, and other read, write, execute permissions (see chmod(1)).
Two decimal number tokens come after the mode; they specify the user and group IDs of the owner of the file.
If the file is a regular file, the next token of the specification may be a path name to which the contents and size are copied. If the file is a block or character special file, two decimal numbers follow which give the major and minor device numbers. If the file is a directory, mkfs makes the entries . and .. and then reads a list of names and (recursively) file specifications for the entries in the directory. As noted above, the scan is terminated with the token $.
SEE ALSO
chmod(1), dir(4), dvhtool(1M), fs(4) Installation/Administration Manual
BUGS
There is no way to specify links. The maximum number of i-nodes configurable is 65500.
September 02, 1992