MKFS(C) XENIX System V MKFS(C)
Name
mkfs - Constructs a file system.
Syntax
/etc/mkfs [ -y ] [ -n ] special blocks[ : inodes] [gap
inblocks]
/etc/mkfs [ -y ] [ -n ] special proto [gap inblocks]
[-s blocks [ : inodes]]
Description
mkfs constructs a file system by writing on the special file
special , according to the directions found in the remainder
of the command line.
If it appears that the special file contains a file system,
operator confirmation is requested before overwriting the
data. The -y ``yes'' option overrides this, and writes over
any existing data without question. The -n option causes
mkfs to terminate without question if the target contains an
existing file system. The check used is to read block one
from the target device (block one is the super-block) and
see whether the bytes are the same. If they are not, this
is taken to be meaningful data and confirmation is
requested.
If the second argument is given as a string of digits, mkfs
builds a file system with a single empty directory on it.
The size of the file system is the value of blocks
interpreted as a decimal number. The boot program is left
uninitialized. If the number of inodes is specified, then
this number should be the same as the estimated number of
files in the file system. If the optional number of inodes
is not given, the number of inodes is calculated as a
function of the system file size.
If the second argument is a file name that can be opened,
mkfs assumes it to be a prototype file, proto, and takes its
directions from that file. The prototype file contains
tokens separated by spaces or newlines. The first token is
the name of a file to be copied onto block zero as the
bootstrap program. The bootstrap program specified should
already be stripped of the header (see strip(CP)). If the
header has not been stripped from the bootstrap program,
then mkfs issues a warning. The second token is a number
specifying the size of the created file system. Typically,
it will have been the number of blocks on the device,
perhaps diminished by space for swapping. The next token is
the i-list size in blocks. 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.
Page 1 (printed 8/7/87)
MKFS(C) XENIX System V MKFS(C)
The mode token for a file is a 6 character string. The
first character specifies the type of the file. (The
characters -bcd specify regular, block special, character
special and directory files respectively.) The second
character of the type 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 three digit octal number
giving the owner, group, and other read, write, execute
permissions; see chmod(C).
Two decimal number tokens come after the mode; they specify
the user and group ID's of the owner of the file.
If the file is a regular file, the next token is a pathname
whose contents and size are copied. If the file is a block
or character special file, two decimal number tokens 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. The scan is terminated
with the token $.
A sample prototype specification follows:
/stand/diskboot
4872 110
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 the second version of the command the -s option is a
command-line override of the size and number of inodes in
the proto file.
In both commands, the disk interleaving factors, gap and
inblocks , can be specified. The interleaving factors are a
disk hardware function and are described in detail in the
XENIX Operations Guide.
See Also
chmod(C), filesystem(F), dir(F), strip(CP)
Notes
There is no way to specify links when using a prototype
file. If the number of inodes is specified on the command
line, then the maximum number of inodes in the file system
Page 2 (printed 8/7/87)
MKFS(C) XENIX System V MKFS(C)
is 65500.
This utility uses BSIZE blocks. Refer to the machine (HW)
manual page for the size of filesystem blocks.
Page 3 (printed 8/7/87)