2011-03-30 13:49:47 +00:00
|
|
|
.TH MKFS 8
|
|
|
|
.SH NAME
|
|
|
|
mkfs, mkext \- archive or update a file system
|
|
|
|
.SH SYNOPSIS
|
|
|
|
.B disk/mkfs
|
2014-12-14 23:52:22 +00:00
|
|
|
.RB [ -aprvoxU ]
|
2011-03-30 13:49:47 +00:00
|
|
|
.RB [ -d
|
|
|
|
.IR root ]
|
|
|
|
.RB [ -s
|
|
|
|
.IR source ]
|
|
|
|
.RB [ -z
|
|
|
|
.IR n ]
|
|
|
|
.I proto ...
|
|
|
|
.PP
|
|
|
|
.B disk/mkext
|
|
|
|
.RB [ -d
|
|
|
|
.IR name ]
|
|
|
|
.RB [ -u ]
|
|
|
|
.RB [ -h ]
|
|
|
|
.RB [ -v ]
|
|
|
|
.RB [ -x ]
|
|
|
|
.RB [ -T ]
|
|
|
|
.I file ...
|
|
|
|
.SH DESCRIPTION
|
|
|
|
.I Mkfs
|
|
|
|
copies files from the file tree
|
|
|
|
.I source
|
|
|
|
(default
|
|
|
|
.BR / )
|
2015-08-21 17:32:48 +00:00
|
|
|
to a new file system
|
2011-03-30 13:49:47 +00:00
|
|
|
.I root
|
|
|
|
(default
|
2015-08-21 17:32:48 +00:00
|
|
|
.BR /n/newfs ).
|
2011-03-30 13:49:47 +00:00
|
|
|
The
|
|
|
|
.I proto
|
|
|
|
files are read
|
|
|
|
(see
|
|
|
|
.IR proto (2)
|
|
|
|
for their format)
|
2015-08-21 17:32:48 +00:00
|
|
|
and any files specified in them that are out of date are copied.
|
2011-03-30 13:49:47 +00:00
|
|
|
.PP
|
|
|
|
.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.
|
2015-08-21 17:32:48 +00:00
|
|
|
Files that are not specified in the
|
2011-03-30 13:49:47 +00:00
|
|
|
.I proto
|
|
|
|
file
|
|
|
|
are not updated and not removed.
|
|
|
|
.PP
|
|
|
|
The options to
|
|
|
|
.I mkfs
|
|
|
|
are:
|
|
|
|
.TF "s source"
|
|
|
|
.TP
|
|
|
|
.B a
|
2015-08-21 17:35:56 +00:00
|
|
|
Instead of writing to new file system,
|
|
|
|
write an archive file to standard output, suitable for
|
2011-03-30 13:49:47 +00:00
|
|
|
.IR mkext .
|
|
|
|
All files in
|
|
|
|
.IR proto ,
|
|
|
|
not just those out of date, are archived.
|
|
|
|
.TP
|
|
|
|
.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.
|
|
|
|
.TP
|
2014-12-14 23:52:22 +00:00
|
|
|
.B o
|
|
|
|
Similar to
|
|
|
|
.BR -x
|
|
|
|
above, but produces a list of source file names to standard output
|
|
|
|
rather than producing an archive file.
|
|
|
|
.TP
|
2011-03-30 13:49:47 +00:00
|
|
|
.BI "d " root
|
|
|
|
Copy files into the tree rooted at
|
|
|
|
.I root
|
|
|
|
(default
|
2015-08-21 17:32:48 +00:00
|
|
|
.BR /n/newfs ).
|
2011-03-30 13:49:47 +00:00
|
|
|
This option suppresses setting the
|
|
|
|
.B uid
|
|
|
|
and
|
|
|
|
.B gid
|
|
|
|
fields when copying files.
|
|
|
|
Use
|
|
|
|
.B -U
|
|
|
|
to reenable it.
|
|
|
|
.TP
|
|
|
|
.B p
|
|
|
|
Update the permissions of a file even if it is up to date.
|
|
|
|
.TP
|
2013-09-22 01:30:04 +00:00
|
|
|
.B U
|
|
|
|
Update of uid and gid of the target files.
|
|
|
|
.TP
|
2011-03-30 13:49:47 +00:00
|
|
|
.B r
|
|
|
|
Copy all files.
|
|
|
|
.TP
|
|
|
|
.BI "s " source
|
|
|
|
Copy from files rooted at the tree
|
|
|
|
.IR source .
|
|
|
|
.TP
|
|
|
|
.B v
|
|
|
|
Print the names of all of the files as they are copied.
|
|
|
|
.TP
|
|
|
|
.BI "z " n
|
2015-08-21 17:32:48 +00:00
|
|
|
Copy files assuming block size
|
2011-03-30 13:49:47 +00:00
|
|
|
.I n
|
|
|
|
(default 1024)
|
|
|
|
bytes long.
|
|
|
|
If a block contains only 0-valued bytes, it is not copied.
|
|
|
|
.PD
|
|
|
|
.PP
|
|
|
|
.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:
|
|
|
|
.TP
|
|
|
|
.B d
|
|
|
|
specifies a directory (default
|
|
|
|
.BR / )
|
|
|
|
to serve as the root of the unpacked file system.
|
|
|
|
.TP
|
|
|
|
.B u
|
|
|
|
sets the owners of the files created to correspond to
|
|
|
|
those in the archive and restores the modification times of the files.
|
|
|
|
.TP
|
|
|
|
.B T
|
|
|
|
restores only the modification times of the files.
|
|
|
|
.TP
|
|
|
|
.B v
|
|
|
|
prints the names and sizes of files as they are extracted.
|
|
|
|
.TP
|
|
|
|
.B h
|
|
|
|
prints headers for the files on standard output
|
|
|
|
instead of unpacking the files.
|
|
|
|
.PD
|
|
|
|
.SH EXAMPLES
|
|
|
|
.PP
|
|
|
|
Make an archive to establish a new file system:
|
|
|
|
.IP
|
|
|
|
.EX
|
2015-08-21 17:32:48 +00:00
|
|
|
disk/mkfs -a -s dist proto > arch
|
2011-03-30 13:49:47 +00:00
|
|
|
.EE
|
|
|
|
.PP
|
|
|
|
Unpack that archive onto a new file system:
|
|
|
|
.IP
|
|
|
|
.EX
|
|
|
|
srv newfs
|
|
|
|
mount -c /srv/newfs /n/newfs
|
|
|
|
disk/mkext -u -d /n/newfs < arch
|
|
|
|
.EE
|
|
|
|
.SH SOURCE
|
|
|
|
.B /sys/src/cmd/disk/mkfs.c
|
|
|
|
.br
|
|
|
|
.B /sys/src/cmd/disk/mkext.c
|
|
|
|
.SH "SEE ALSO"
|
|
|
|
.IR prep (8),
|
|
|
|
.IR sd (3),
|
|
|
|
.IR tar (1)
|