1 .\" $NetBSD: makefs.8,v 1.53 2013/08/06 20:16:54 wiz Exp $
3 .\" Copyright (c) 2001-2003 Wasabi Systems, Inc.
4 .\" All rights reserved.
6 .\" Written by Luke Mewburn for Wasabi Systems, Inc.
8 .\" Redistribution and use in source and binary forms, with or without
9 .\" modification, are permitted provided that the following conditions
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.
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.
41 .Nd create a file system image from a directory tree
46 .Op Fl b Ar free-blocks
47 .Op Fl d Ar debug-mask
48 .Op Fl F Ar mtree-specfile
49 .Op Fl f Ar free-files
50 .Op Fl M Ar minimum-size
51 .Op Fl m Ar maximum-size
52 .Op Fl N Ar userdb-dir
54 .Op Fl o Ar fs-options
55 .Op Fl S Ar sector-size
56 .Op Fl s Ar image-size
60 .Op Ar extra-directory ...
64 creates a file system image into
66 from the directory tree
68 If any optional directory trees are passed in the
70 arguments, then the directory tree of each argument will be merged
75 No special devices or privileges are required to perform this task.
77 The options are as follows:
80 Set the byte order of the image to
93 Some file systems may have a fixed byte order; in those cases this
94 argument will be ignored.
95 .It Fl b Ar free-blocks
96 Ensure that a minimum of
98 free blocks exist in the image.
101 suffix may be provided to indicate that
103 indicates a percentage of the calculated image size.
104 .It Fl d Ar debug-mask
105 Enable various levels of debugging, depending upon which bits are
109 .It Fl F Ar mtree-specfile
117 If a specfile entry exists in the underlying file system, its
118 permissions and modification time will be used unless specifically
119 overridden by the specfile.
120 An error will be raised if the type of entry in the specfile
121 conflicts with that of an existing entry.
123 In the opposite case (where a specfile entry does not have an entry
124 in the underlying file system) the following occurs:
125 If the specfile entry is marked
127 the specfile entry is ignored.
128 Otherwise, the entry will be created in the image, and it is
129 necessary to specify at least the following parameters in the
141 (in the case of block or character devices), and
143 (in the case of symbolic links).
146 isn't provided, the current time will be used.
149 isn't provided, the current file flags will be used.
150 Missing regular file entries will be created as zero-length files.
151 .It Fl f Ar free-files
152 Ensure that a minimum of
154 free files (inodes) exist in the image.
157 suffix may be provided to indicate that
159 indicates a percentage of the calculated image size.
160 .It Fl M Ar minimum-size
161 Set the minimum size of the file system image to
163 .It Fl m Ar maximum-size
164 Set the maximum size of the file system image to
166 An error will be raised if the target file system needs to be larger
167 than this to accommodate the provided directory tree.
168 .It Fl N Ar userdb-dir
169 Use the user database text file
171 and group database text file
175 rather than using the results from the system's
179 (and related) library calls.
181 Instead of creating the filesystem at the beginning of the file, start
187 .It Fl o Ar fs-options
188 Set file system specific options.
190 is a comma separated list of options.
191 Valid file system specific options are detailed below.
193 When merging multiple directories replace duplicate files with the last found.
194 .It Fl S Ar sector-size
195 Set the file system sector size to
197 .\" XXX: next line also true for cd9660?
199 .It Fl s Ar image-size
200 Set the size of the file system image to
206 The following file system types are supported:
207 .Bl -tag -width cd9660 -offset indent
209 BSD fast file system (default).
211 ISO 9660 file system.
213 Chip flash file system.
215 FAT12, FAT16, or FAT32 file system.
217 7th Edition(V7) file system.
219 ISO/Ecma UDF file system.
222 Exclude file system nodes not explicitly listed in the specfile.
224 Create a sparse file for
226 This is useful for virtual machine images.
229 Where sizes are specified, a decimal number of bytes is expected.
230 Two or more numbers may be separated by an
232 to indicate a product.
233 Each number may have one of the following optional suffixes:
234 .Bl -tag -width 3n -offset indent -compact
236 Block; multiply by 512
238 Kibi; multiply by 1024 (1 KiB)
240 Mebi; multiply by 1048576 (1 MiB)
242 Gibi; multiply by 1073741824 (1 GiB)
244 Tebi; multiply by 1099511627776 (1 TiB)
246 Word; multiply by the number of bytes in an integer
250 .Ss FFS-specific options
252 images have ffs-specific optional parameters that may be provided.
253 Each of the options consists of a keyword, an equal sign
256 The following keywords are supported:
258 .Bl -tag -width optimization -offset indent -compact
260 Expected average file size.
262 Expected number of files per directory.
270 Label name of the image.
272 Maximum blocks per file in a cylinder group.
276 Optimization preference; one of
283 Maximum total number of blocks in a cylinder group.
286 1 for FFS (default), 2 for UFS2.
288 .Ss CD9660-specific options
290 images have ISO9660-specific optional parameters that may be
292 The arguments consist of a keyword and, optionally, an equal sign
295 The following keywords are supported:
297 .Bl -tag -width omit-trailing-period -offset indent -compact
298 .It Sy allow-deep-trees
299 Allow the directory structure to exceed the maximum specified in
301 .\" .It Sy allow-illegal-chars
303 .\" .It Sy allow-lowercase
305 .It Sy allow-max-name
306 Allow 37 instead of 33 characters for filenames by omitting the
308 .It Sy allow-multidot
309 Allow multiple dots in a filename.
311 Application ID of the image.
319 Write an MBR partition table to the image to allow older CHRP hardware to
321 .It Sy boot-load-segment
322 Set load segment for the boot image.
324 Filename of a boot image in the format
334 .It Sy generic-bootimage
335 Load a generic boot image into the first 32K of the cd9660 image.
336 .It Sy hard-disk-boot
337 Boot image is a hard disk image.
338 .It Sy keep-bad-images
339 Don't throw away images whose write was aborted due to an error.
340 For debugging purposes.
342 Label name of the image.
344 Boot image is not bootable.
349 .It Sy no-trailing-padding
350 Do not pad the image (apparently Linux needs the padding).
351 .\" .It Sy omit-trailing-period
354 Preparer ID of the image.
356 Publisher ID of the image.
358 Use RockRidge extensions (for longer filenames, etc.).
360 Volume set identifier of the image.
362 .Ss CHFS-specific options
364 images have chfs-specific optional parameters that may be provided.
365 Each of the options consists of a keyword, an equal sign
368 The following keywords are supported:
370 .Bl -tag -width optimization -offset indent -compact
374 Erase block size of the media.
379 .Ss msdos-specific options
382 for fs specific options.
383 .Ss V7FS-specific options
384 The following keywords are supported:
386 .Bl -tag -width optimization -offset indent -compact
390 Display a progress meter for the file system construction and file
393 .Ss UDF-specific options
395 images have udf-specific optional parameters that may be provided.
396 Each of the options consists of a keyword, an equal sign
399 The following keywords are supported:
401 .Bl -tag -width optimization -compact
403 This can have the following values:
404 .Bl -tag -width cdromXdvdromXbdromXXX -compact
405 .It Sy cdrom , Sy dvdrom , Sy bdrom
406 create a read-only fs
407 .It Sy dvdram , Sy bdre , Sy disk
408 create a rewritable fs without sparing for defective sectors
409 .It Sy cdr , Sy dvdr , Sy bdr
410 create a rewritable fs on once recordable media using a VAT
411 .It Sy cdrw , Sy dvdrw
412 create a rewritable fs with sparing for defective sectors
414 When an optical media is selected here, the sectorsize and the default disc
415 size is assumed unless given explicitly.
416 For rom images the disc size is the minimum needed.
418 Set the logical volume label of the disc to the specified argument.
420 Set the physical volume label of the disc to the specified argument.
421 Prepend the physical volume label with a volumeset label separated
422 with a ':' if wanted.
423 For strict conformance and interchange, don't set the volumeset label
424 manually unless it has an unique hex number in the first 8 character
427 Set the minimum UDF version to be used.
428 Choose UDF version numbers from 0x102, 0x150, 0x200, and 0x201.
429 Versions 0x250 and 0x260 are currently not supported
450 .An Alan Perez-Rathke ,