blob: 2eaba6c1cb79c8f5419ce2d75890e852b5b190d5 [file] [log] [blame]
mkfs, mkext \- archive or update a file system
.B disk/mkfs
.RB [ -aprvxU ]
.RB [ -d
.IR root ]
.RB [ -n
.IR name ]
.RB [ -s
.IR source ]
.RB [ -u
.IR users ]
.RB [ -z
.IR n ]
.I proto ...
.B disk/mkext
.RB [ -d
.IR name ]
.RB [ -u ]
.RB [ -h ]
.RB [ -v ]
.RB [ -x ]
.RB [ -T ]
.I file ...
.I Mkfs
copies files from the file tree
.I source
.BR / )
to a
.B kfs
file system (see
.IR kfs (4)).
The kfs service is mounted on
.I root
.BR /n/kfs ),
.B /adm/users
is copied to
.IB root /adm/users\f1.
.I proto
files are read
.IR proto (2)
for their format)
and any files specified in them that are out of date are copied to
.BR /n/kfs .
.I Mkfs
copies only those files that are out of date.
Such a file is first copied into a temporary
file in the appropriate destination directory
and then moved to the destination file.
Files in the
.I kfs
file system that are not specified in the
.I proto
are not updated and not removed.
The options to
.I mkfs
.TF "s source"
.B a
Instead of writing to a
.B kfs
file system, write an archive file to standard output, suitable for
.IR mkext .
All files in
.IR proto ,
not just those out of date, are archived.
.B x
For use with
.BR -a ,
this option writes a list of file names, dates, and sizes to standard output
rather than producing an archive file.
.BI "d " root
Copy files into the tree rooted at
.I root
.BR /n/kfs ).
This option suppresses setting the
.B uid
.B gid
fields when copying files.
.B -U
to reenable it.
.BI "n " name
.RI kfs. name
as the name of the kfs service (default
.BR kfs ).
.B p
Update the permissions of a file even if it is up to date.
.B r
Copy all files.
.BI "s " source
Copy from files rooted at the tree
.IR source .
.BI "u " users
Copy file
.I users
.B /adm/users
in the new system.
.B v
Print the names of all of the files as they are copied.
.BI "z " n
Copy files assuming kfs block
.I n
(default 1024)
bytes long.
If a block contains only 0-valued bytes, it is not copied.
.I Mkext
unpacks archive files made by the
.B -a
option of
.IR mkfs .
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 options are:
.B d
specifies a directory (default
.BR / )
to serve as the root of the unpacked file system.
.B u
sets the owners of the files created to correspond to
those in the archive and restores the modification times of the files.
.B T
restores only the modification times of the files.
.B v
prints the names and sizes of files as they are extracted.
.B h
prints headers for the files on standard output
instead of unpacking the files.
Make an archive to establish a new file system:
disk/mkfs -a -u files/adm.users -s dist proto > arch
Unpack that archive onto a new file system:
disk/mkext -u -d /n/newfs < arch
.B \*9/src/cmd/disk/mkfs.c
.B \*9/src/cmd/disk/mkext.c
.IR prep (8),
.IR tar (1)