]> git.lizzy.rs Git - plan9front.git/blob - sys/man/8/mkfs
disk/mkfs: rmeove kfs support
[plan9front.git] / sys / man / 8 / mkfs
1 .TH MKFS 8
2 .SH NAME
3 mkfs, mkext \- archive or update a file system
4 .SH SYNOPSIS
5 .B disk/mkfs
6 .RB [ -aprvoxU ]
7 .RB [ -d
8 .IR root ]
9 .RB [ -s
10 .IR source ]
11 .RB [ -z
12 .IR n ]
13 .I proto ...
14 .PP
15 .B disk/mkext
16 .RB [ -d
17 .IR name ]
18 .RB [ -u ]
19 .RB [ -h ]
20 .RB [ -v ]
21 .RB [ -x ]
22 .RB [ -T ]
23 .I file ...
24 .SH DESCRIPTION
25 .I Mkfs
26 copies files from the file tree
27 .I source
28 (default
29 .BR / )
30 to a new file system
31 .I root
32 (default
33 .BR /n/newfs ).
34 The
35 .I proto
36 files are read
37 (see
38 .IR proto (2)
39 for their format)
40 and any files specified in them that are out of date are copied.
41 .PP
42 .I Mkfs
43 copies only those files that are out of date.
44 Such a file is first copied into a temporary
45 file in the appropriate destination directory
46 and then moved to the destination file.
47 Files that are not specified in the
48 .I proto
49 file
50 are not updated and not removed.
51 .PP
52 The options to
53 .I mkfs
54 are:
55 .TF "s source"
56 .TP
57 .B a
58 Instead of writing to a
59 .B kfs
60 file system, write an archive file to standard output, suitable for
61 .IR mkext .
62 All files in
63 .IR proto ,
64 not just those out of date, are archived.
65 .TP
66 .B x
67 For use with
68 .BR -a ,
69 this option writes a list of file names, dates, and sizes to standard output
70 rather than producing an archive file.
71 .TP
72 .B o
73 Similar to
74 .BR -x
75 above, but produces a list of source file names to standard output
76 rather than producing an archive file.
77 .TP
78 .BI "d " root
79 Copy files into the tree rooted at
80 .I root 
81 (default
82 .BR /n/newfs ).
83 This option suppresses setting the
84 .B uid
85 and
86 .B gid
87 fields when copying files.
88 Use
89 .B -U
90 to reenable it. 
91 .TP
92 .B p
93 Update the permissions of a file even if it is up to date.
94 .TP
95 .B U
96 Update of uid and gid of the target files.
97 .TP
98 .B r
99 Copy all files.
100 .TP
101 .BI "s " source
102 Copy from files rooted at the tree
103 .IR source .
104 .TP
105 .B v
106 Print the names of all of the files as they are copied.
107 .TP
108 .BI "z " n
109 Copy files assuming block size
110 .I n
111 (default 1024)
112 bytes long.
113 If a block contains only 0-valued bytes, it is not copied.
114 .PD
115 .PP
116 .I Mkext
117 unpacks archive files made by the
118 .B -a
119 option of
120 .IR mkfs .
121 Each file on the command line is unpacked in one pass through the archive.
122 If the file is a directory,
123 all files and subdirectories of that directory are also unpacked.
124 When a file is unpacked, the entire path is created if it
125 does not exist.
126 If no files are specified, the entire archive is unpacked;
127 in this case, missing intermediate directories are not created.
128 The options are:
129 .TP
130 .B d
131 specifies a directory (default
132 .BR / )
133 to serve as the root of the unpacked file system.
134 .TP
135 .B u
136 sets the owners of the files created to correspond to
137 those in the archive and restores the modification times of the files.
138 .TP
139 .B T
140 restores only the modification times of the files.
141 .TP
142 .B v
143 prints the names and sizes of files as they are extracted.
144 .TP
145 .B h
146 prints headers for the files on standard output
147 instead of unpacking the files.
148 .PD
149 .SH EXAMPLES
150 .PP
151 Make an archive to establish a new file system:
152 .IP
153 .EX
154 disk/mkfs -a -s dist proto > arch
155 .EE
156 .PP
157 Unpack that archive onto a new file system:
158 .IP
159 .EX
160 srv newfs
161 mount -c /srv/newfs /n/newfs
162 disk/mkext -u -d /n/newfs < arch
163 .EE
164 .SH SOURCE
165 .B /sys/src/cmd/disk/mkfs.c
166 .br
167 .B /sys/src/cmd/disk/mkext.c
168 .SH "SEE ALSO"
169 .IR prep (8),
170 .IR sd (3),
171 .IR tar (1)