MKFS(8) MKFS(8)
NAME
mkfs, mkext - archive or update a file system
SYNOPSIS
disk/mkfs [-aprvx] [-n name] [-s source] [-u users] [-z n]
proto ...
disk/mkext [-d name] [-u] [-h] [-v] file ...
DESCRIPTION
Mkfs copies files from the file tree source (default /) to a
kfs file system (see kfs(4)). The kfs service is mounted on
/n/kfs, and /adm/users, if it exists, is copied to
/n/kfs/adm/users. The proto files are read, and any files
specified in them that are out of date are copied to /n/kfs.
See proto(6) for the description of file system prototype
files.
Mkfs copies only those files that are out of date. Such a
file is first copied into a temporary file in the appropri-
ate destination directory and then moved to the destination
file. Files in the kfs file system that are not specified
in the proto file are not updated and not removed.
The options to mkfs are:
a Instead of writing to a kfs file system, write an
archive file to standard output, suitable for
mkext. All files in proto, not just those out of
date, are archived.
x For use with -a, this option writes a list of file
names, dates, and sizes to standard output rather
than producing an archive file.
n name Use kfs.name as the name of the kfs service
(default kfs).
p Update the permissions of a file even if it is up
to date.
r Copy all files.
s source Copy from files rooted at the tree source.
u users Copy file users into /adm/users in the new system.
v Print the names of all of the files as they are
copied.
z n Copy files assuming kfs block n (default 1024)
bytes long. If a block contains only 0-valued
bytes, it is not copied.
Mkext unpacks archive files made by the -a option of mkfs.
The -d option specifies a directory (default /n/kfs) to
serve as the root of the unpacked file system. The -u
option, to be used only when initializing a new kfs(4) file
Page 1 Plan 9 (printed 11/5/25)
MKFS(8) MKFS(8)
system, sets the owners of the files created to correspond
to those in the archive and restores the modification times
of the files. (This is only permitted at the initial load
of the files into a file system.) Each file on the command
line is unpacked in one pass through the archive. If the
file is a directory, all files and subdirectories of that
directory are also unpacked. When a file is unpacked, the
entire path is created if it does not exist. If no files
are specified, the entire archive is unpacked; in this case,
missing intermediate directories are not created. The -v
option prints the names and sizes of files as they are
extracted; -h prints headers for the files on standard out-
put instead of unpacking the files.
EXAMPLES
Make an archive to establish a new file system (assuming
that the output file arch is not referenced by proto):
bind '#U' /n/local
disk/mkfs -a -u files/adm.users -s /n/local proto > arch
Unpack that archive on another machine:
mount tcp!server /n/remote
disk/mkext -u -d /n/remote < arch
FILES
/lib/proto directory of prototype files.
/lib/proto/portproto generic prototype file.
SOURCE
/appl/cmd/disk/mkfs.b
/appl/cmd/disk/mkext.b
SEE ALSO
fs(1), kfs(4), proto(6), kfscmd(8)
Page 2 Plan 9 (printed 11/5/25)