xref: /netbsd-src/usr.sbin/makefs/makefs.8 (revision 9fbd88883c38d0c0fbfcbe66d76fe6b0fab3f9de)
1.\"	$NetBSD: makefs.8,v 1.5 2002/01/24 03:21:07 lukem Exp $
2.\"
3.\" Copyright (c) 2001-2002 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.Dd January 24, 2002
37.Dt MAKEFS 8
38.Os
39.Sh NAME
40.Nm makefs
41.Nd create a file system image from a directory tree
42.Sh SYNOPSIS
43.Nm ""
44.Bk -words
45.Op Fl t Ar fs-type
46.Ek
47.Bk -words
48.Op Fl o Ar fs-options
49.Ek
50.Bk -words
51.Op Fl d Ar debug-mask
52.Ek
53.Bk -words
54.Op Fl B Ar byte-order
55.Ek
56.Bk -words
57.Op Fl S Ar sector-size
58.Ek
59.Bk -words
60.Op Fl M Ar minimum-size
61.Ek
62.Bk -words
63.Op Fl m Ar maximum-size
64.Ek
65.Bk -words
66.Op Fl s Ar image-size
67.Ek
68.Bk -words
69.Op Fl b Ar free-blocks
70.Ek
71.Bk -words
72.Op Fl f Ar free-files
73.Ek
74.Bk -words
75.Op Fl F Ar specfile
76.Ek
77.Bk -words
78.Op Fl N Ar userdb-dir
79.Ek
80.Ar image-file
81.Ar directory
82.Sh DESCRIPTION
83The utility
84.Nm
85creates a file system image into
86.Ar image-file
87from the directory tree
88.Ar directory .
89No special devices or privileges are required to perform this task.
90.Pp
91The options are as follows:
92.Bl -tag -width flag
93.It Fl t Ar fs-type
94Create an
95.Ar fs-type
96file system image.
97The following file system types are supported:
98.Bl -tag -width ffs -offset indent
99.It Sy ffs
100BSD fast file system (default).
101.El
102.It Fl o Ar fs-options
103Set file system specific options.
104.Ar fs-options
105is a comma separated list of options.
106Valid file system specific options are detailed below.
107.It Fl d Ar debug-mask
108Enable various levels of debugging, depending upon which bits are set
109in
110.Ar debug-mask .
111XXX: document these
112.It Fl B Ar byte-order
113Set the byte order of the image to
114.Ar byte-order .
115Valid byte orders are
116.Ql big
117or
118.Ql be
119for big endian, and
120.Ql little
121or
122.Ql le
123for little endian.
124Some file systems may have a fixed byte order; in those cases this
125argument will be ignored.
126.It Fl S Ar sector-size
127Set the file system sector size to
128.Ar sector-size .
129Defaults to 512.
130.It Fl M Ar minimum-size
131Set the minimum size of the file system image to
132.Ar minimum-size .
133.It Fl m Ar maximum-size
134Set the maximum size of the file system image to
135.Ar maximum-size .
136An error will be raised if the target file system needs to be larger
137than this to accommodate the provided directory tree.
138.It Fl s Ar image-size
139Set the size of the file system image to
140.Ar image-size .
141.It Fl b Ar free-blocks
142Ensure that a minimum of
143.Ar free-blocks
144free blocks exist in the image.
145An optional
146.Ql %
147suffix may be provided to indicate that
148.Ar free-blocks
149indicates a percentage of the calculated image size
150.It Fl f Ar free-files
151Ensure that a minimum of
152.Ar free-files
153free files (inodes) exist in the image.
154An optional
155.Ql %
156suffix may be provided to indicate that
157.Ar free-blocks
158indicates a percentage of the calculated image size
159.It Fl F Ar specfile
160Use
161.Ar specfile
162as an
163.Xr mtree 8
164.Sq specfile
165specification.
166.Pp
167If a specfile entry exists in the underlying file system, its permissions and
168modification time will be used unless specifically overridden by the specfile.
169An error will be raised if the type of entry in the specfile conflicts
170with that of an existing entry.
171.Pp
172Otherwise, it is necessary to specify at least the following parameters
173in the specfile:
174.Sy type ,
175.Sy mode ,
176.Sy gname
177or
178.Sy gid ,
179and
180.Sy uname
181or
182.Sy uid ,
183.Sy device
184(in the case of block or character devices), and
185.Sy link
186(in the case of symbolic links).
187If
188.Sy time
189isn't provided, the current time will be used.
190If
191.Sy flags
192isn't provided, the current file flags will be used.
193.It Fl N Ar dbdir
194Use the user database text file
195.Pa master.passwd
196and group database text file
197.Pa group
198from
199.Ar dbdir ,
200rather than using the results from the system's
201.Xr getpwnam 3
202and
203.Xr getgrnam 3
204(and related) library calls.
205.El
206.Pp
207Where sizes are specified, a decimal number of bytes is expected.
208Two or more numbers may be separated by an
209.Dq x
210to indicate a product.
211Each number may have one of the following optional suffices:
212.Bl -tag -width 3n -offset indent -compact
213.It b
214Block; multiply by 512
215.It k
216Kilo; multiply by 1024 (1 KB)
217.It m
218Mega; multiply by 1048576 (1 MB)
219.It g
220Giga; multiply by 1073741824 (1 GB)
221.It t
222Tera; multiply by 1099511627776 (1 TB)
223.It w
224Word; multiply by the number of bytes in an integer
225.El
226.\"
227.\"
228.Ss FFS-specific options
229.Sy ffs
230images have ffs-specific optional parameters that may be provided.
231Each of the options consists of a keyword, an equals sign
232.Pq Ql = ,
233and a value.
234The following keywords are supported:
235.Pp
236.Bl -tag -width optimization -offset indent -compact
237.It Sy avgfilesize
238Expected average file size
239.It Sy avgfpdir
240Expected number of files per directory
241.It Sy bsize
242Block size
243.It Sy cpg
244Cylinders per group
245.It Sy density
246Bytes per inode
247.It Sy fsize
248Fragment size
249.It Sy maxbpg
250Maximum blocks per cylinder group
251.It Sy minfree
252Minimum % free
253.It Sy nsectors
254Number of sectors
255.It Sy ntracks
256Number of tracks
257.It Sy optimization
258Optimization preference; one of
259.Ql space
260or
261.Ql time .
262.It Sy rotdelay
263Rotational delay
264.It Sy rpm
265Revolutions per minute
266.It Sy nrpos
267Number of rotational positions
268.El
269.Sh SEE ALSO
270.Xr mtree 8 ,
271.Xr newfs 8
272.Sh HISTORY
273The
274.Nm
275utility appeared in
276.Nx 1.6 .
277.Sh AUTHORS
278.An Luke Mewburn Aq lukem@netbsd.org
279