]> CyberLeo.Net >> Repos - FreeBSD/releng/8.1.git/blob - usr.sbin/makefs/makefs.8
Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.
[FreeBSD/releng/8.1.git] / usr.sbin / makefs / makefs.8
1 .\"     $NetBSD: makefs.8,v 1.13 2004/02/13 17:56:18 wiz Exp $
2 .\"
3 .\" Copyright (c) 2001-2003 Wasabi Systems, Inc.
4 .\" All rights reserved.
5 .\"
6 .\" Written by Luke Mewburn for Wasabi Systems, Inc.
7 .\"
8 .\" Redistribution and use in source and binary forms, with or without
9 .\" modification, are permitted provided that the following conditions
10 .\" are met:
11 .\" 1. Redistributions of source code must retain the above copyright
12 .\"    notice, this list of conditions and the following disclaimer.
13 .\" 2. Redistributions in binary form must reproduce the above copyright
14 .\"    notice, this list of conditions and the following disclaimer in the
15 .\"    documentation and/or other materials provided with the distribution.
16 .\" 3. All advertising materials mentioning features or use of this software
17 .\"    must display the following acknowledgement:
18 .\"      This product includes software developed for the NetBSD Project by
19 .\"      Wasabi Systems, Inc.
20 .\" 4. The name of Wasabi Systems, Inc. may not be used to endorse
21 .\"    or promote products derived from this software without specific prior
22 .\"    written permission.
23 .\"
24 .\" THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND
25 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
26 .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
27 .\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL WASABI SYSTEMS, INC
28 .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 .\" POSSIBILITY OF SUCH DAMAGE.
35 .\"
36 .\" $FreeBSD$
37 .\"
38 .Dd March 30, 2003
39 .Dt MAKEFS 8
40 .Os
41 .Sh NAME
42 .Nm makefs
43 .Nd create a file system image from a directory tree
44 .Sh SYNOPSIS
45 .Nm
46 .Bk -words
47 .Op Fl t Ar fs-type
48 .Ek
49 .Bk -words
50 .Op Fl o Ar fs-options
51 .Ek
52 .Bk -words
53 .Op Fl d Ar debug-mask
54 .Ek
55 .Bk -words
56 .Op Fl B Ar byte-order
57 .Ek
58 .Bk -words
59 .Op Fl S Ar sector-size
60 .Ek
61 .Bk -words
62 .Op Fl M Ar minimum-size
63 .Ek
64 .Bk -words
65 .Op Fl m Ar maximum-size
66 .Ek
67 .Bk -words
68 .Op Fl s Ar image-size
69 .Ek
70 .Bk -words
71 .Op Fl b Ar free-blocks
72 .Ek
73 .Bk -words
74 .Op Fl f Ar free-files
75 .Ek
76 .Bk -words
77 .Op Fl F Ar specfile
78 .Ek
79 .Op Fl x
80 .Bk -words
81 .Op Fl N Ar userdb-dir
82 .Ek
83 .Ar image-file
84 .Ar directory
85 .Sh DESCRIPTION
86 The utility
87 .Nm
88 creates a file system image into
89 .Ar image-file
90 from the directory tree
91 .Ar directory .
92 No special devices or privileges are required to perform this task.
93 .Pp
94 The options are as follows:
95 .Bl -tag -width flag
96 .It Fl t Ar fs-type
97 Create an
98 .Ar fs-type
99 file system image.
100 The following file system types are supported:
101 .Bl -tag -width ffs -offset indent
102 .It Sy ffs
103 BSD fast file system (default).
104 .El
105 .It Fl o Ar fs-options
106 Set file system specific options.
107 .Ar fs-options
108 is a comma separated list of options.
109 Valid file system specific options are detailed below.
110 .It Fl d Ar debug-mask
111 Enable various levels of debugging, depending upon which bits are set
112 in
113 .Ar debug-mask .
114 XXX: document these
115 .It Fl B Ar byte-order
116 Set the byte order of the image to
117 .Ar byte-order .
118 Valid byte orders are
119 .Ql 4321 ,
120 .Ql big
121 or
122 .Ql be
123 for big endian, and
124 .Ql 1234 ,
125 .Ql little
126 or
127 .Ql le
128 for little endian.
129 Some file systems may have a fixed byte order; in those cases this
130 argument will be ignored.
131 .It Fl S Ar sector-size
132 Set the file system sector size to
133 .Ar sector-size .
134 Defaults to 512.
135 .It Fl M Ar minimum-size
136 Set the minimum size of the file system image to
137 .Ar minimum-size .
138 .It Fl m Ar maximum-size
139 Set the maximum size of the file system image to
140 .Ar maximum-size .
141 An error will be raised if the target file system needs to be larger
142 than this to accommodate the provided directory tree.
143 .It Fl s Ar image-size
144 Set the size of the file system image to
145 .Ar image-size .
146 .It Fl b Ar free-blocks
147 Ensure that a minimum of
148 .Ar free-blocks
149 free blocks exist in the image.
150 An optional
151 .Ql %
152 suffix may be provided to indicate that
153 .Ar free-blocks
154 indicates a percentage of the calculated image size
155 .It Fl f Ar free-files
156 Ensure that a minimum of
157 .Ar free-files
158 free files (inodes) exist in the image.
159 An optional
160 .Ql %
161 suffix may be provided to indicate that
162 .Ar free-blocks
163 indicates a percentage of the calculated image size
164 .It Fl F Ar specfile
165 Use
166 .Ar specfile
167 as an
168 .Xr mtree 8
169 .Sq specfile
170 specification.
171 .Pp
172 If a specfile entry exists in the underlying file system, its permissions and
173 modification time will be used unless specifically overridden by the specfile.
174 An error will be raised if the type of entry in the specfile conflicts
175 with that of an existing entry.
176 .Pp
177 In the opposite case
178 (where a specfile entry does not have an entry in the underlying file system)
179 the following occurs:
180 If the specfile entry is marked
181 .Sy optional ,
182 the specfile entry is ignored.
183 Otherwise, the entry will be created in the image,
184 and it is necessary to specify at least the following parameters
185 in the specfile:
186 .Sy type ,
187 .Sy mode ,
188 .Sy gname
189 or
190 .Sy gid ,
191 and
192 .Sy uname
193 or
194 .Sy uid ,
195 .Sy device
196 (in the case of block or character devices), and
197 .Sy link
198 (in the case of symbolic links).
199 If
200 .Sy time
201 isn't provided, the current time will be used.
202 If
203 .Sy flags
204 isn't provided, the current file flags will be used.
205 Missing regular file entries will be created as zero-length files.
206 .It Fl x
207 Exclude file system nodes not explcitly listed in the specfile.
208 .It Fl N Ar dbdir
209 Use the user database text file
210 .Pa master.passwd
211 and group database text file
212 .Pa group
213 from
214 .Ar dbdir ,
215 rather than using the results from the system's
216 .Xr getpwnam 3
217 and
218 .Xr getgrnam 3
219 (and related) library calls.
220 .El
221 .Pp
222 Where sizes are specified, a decimal number of bytes is expected.
223 Two or more numbers may be separated by an
224 .Dq x
225 to indicate a product.
226 Each number may have one of the following optional suffixes:
227 .Bl -tag -width 3n -offset indent -compact
228 .It b
229 Block; multiply by 512
230 .It k
231 Kilo; multiply by 1024 (1 KB)
232 .It m
233 Mega; multiply by 1048576 (1 MB)
234 .It g
235 Giga; multiply by 1073741824 (1 GB)
236 .It t
237 Tera; multiply by 1099511627776 (1 TB)
238 .It w
239 Word; multiply by the number of bytes in an integer
240 .El
241 .\"
242 .\"
243 .Ss FFS-specific options
244 .Sy ffs
245 images have ffs-specific optional parameters that may be provided.
246 Each of the options consists of a keyword, an equals sign
247 .Pq Ql = ,
248 and a value.
249 The following keywords are supported:
250 .Pp
251 .Bl -tag -width optimization -offset indent -compact
252 .It Sy avgfilesize
253 Expected average file size
254 .It Sy avgfpdir
255 Expected number of files per directory
256 .It Sy bsize
257 Block size
258 .It Sy density
259 Bytes per inode
260 .It Sy fsize
261 Fragment size
262 .It Sy maxbpg
263 Maximum blocks per file in a cylinder group
264 .It Sy minfree
265 Minimum % free
266 .It Sy optimization
267 Optimization preference; one of
268 .Ql space
269 or
270 .Ql time .
271 .It Sy extent
272 Maximum extent size
273 .It Sy maxbpcg
274 Maximum total number of blocks in a cylinder group
275 .It Sy version
276 UFS version. 1 for FFS (default), 2 for UFS2
277 .El
278 .Sh SEE ALSO
279 .Xr mtree 8 ,
280 .Xr newfs 8
281 .Sh HISTORY
282 The
283 .Nm
284 utility appeared in
285 .Nx 1.6 .
286 .Sh AUTHORS
287 .An Luke Mewburn
288 .Aq lukem@NetBSD.org .