makefs — create a
file system image from a directory tree
makefs creates a file system
image into image-file from the directory tree
directory. No special devices or privileges are
required to perform this task.
The options are as follows:
- Ensure that a minimum of free-blocks exist in the
image. An optional ‘
%’ suffix may be
provided to indicate that free-blocks indicates a
percentage of the calculated image size.
- Ensure that a minimum of free-files (inodes) exist
in the image. An optional ‘
may be provided to indicate that free-files
indicates a percentage of the calculated image size.
- Set the minimum size of the file system image to
- Set the maximum size of the file system image to
maximum-size. An error will be raised if the target
file system needs to be larger than this to accommodate the provided
- Instead of creating the file system at the beginning of the file, start at
offset. Valid only for ffs and
- Set file system specific options. fs-options is a
comma separated list of options. Valid file system specific options are
- Set the file system sector size to sector-size.
Defaults to 512.
- Set the size of the file system image to
- Specify a timestamp to be set for all file system files and directories
created so that repeatable builds are possible. The
timestamp is an integer value interpreted as the
number of seconds from the Epoch.
- Create an fs-type file system image. The following
file system types are supported:
- ISO 9660 file system.
- BSD Fast File System (the default).
- FAT12, FAT16, or FAT32 file system.
Sizes are specified as a decimal number of bytes and may use a
multiplier, as documented in
scan_scaled(3). Two or more numbers
may be separated by an ‘x’ to indicate a product.
ffs images have ffs-specific optional parameters
that may be provided. Each of the options consists of a keyword, an equal
=’), and a value. The following
keywords are supported:
- Expected average file size.
- Expected number of files per directory.
- Block size.
- Bytes per inode.
- Name of a disk described in
disktab(5). A disklabel with the
information will be written at a machine dependent location in the image.
The size of the file system image, the sector size and the
bsize and fsize parameters are
inferred from the disklabel.
- Maximum extent size.
- Fragment size.
- Label name of the image.
- Maximum total number of blocks in a cylinder group.
- Maximum blocks per file in a cylinder group.
- Minimum % free.
- Optimization preference: one of
space’ (default) or
- UFS version. 1 for FFS (default) or 2 for UFS2.
cd9660 images have ISO9660-specific optional
parameters that may be provided. The arguments consist of a keyword and,
optionally, an equal sign (‘
=’), and a
value. The following keywords are supported:
- Allow the directory structure to exceed the maximum specified in the
- Allow multiple dots in a filename.
- Application ID of the image.
- Set load segment for the boot image.
- Filename of a boot image in the format “sysid;filename”,
where “sysid” is one of
- Load a generic boot image into the first 32K of the CD9660 image.
- Boot image is a hard disk image.
- ISO Level.
- Label name of the image.
- Boot image is not bootable.
- Boot image is a “no emulation” ElTorito image.
- Do not pad the image (apparently Linux needs the padding).
- Omit trailing periods in filenames.
- Preparer ID of the image.
- Publisher ID of the image.
- Use RockRidge extensions (for longer filenames, etc.).
- Volume set identifier of the image.
msdos images have MS-DOS-specific optional
parameters that may be provided. The arguments consist of a keyword, an
equal sign (‘
=’), and a value. The
following keywords are supported:
- Location of the backup boot sector.
- Block size.
- Bootstrap file.
- Bytes per sector.
- Create file size.
- Directory entries.
- Drive heads.
- FAT type (12, 16, or 32).
- Preset drive parameters for standard format floppy disks (160, 180, 320,
360, 640, 720, 1200, 1232, 1440, or 2880).
- Hidden sectors.
- Location of the info sector.
- Media descriptor.
- Number of FATs.
- OEM string.
- Offset in device.
- Reserved sectors.
- Sectors per cluster.
- Sectors per FAT.
- Sectors per track.
- File System size.
- Volume ID.
- Volume Label.
makefs utility appeared in
⟨lukem@NetBSD.org⟩ (original program), Daniel
Watt, Walter Deignan, Ryan
Gabrys, Alan Perez-Rathke,
Ram Vedam (cd9660 support), and
Christos Zoulas (msdos support).