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