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