a file system image from a directory tree
The utility makefs
creates a file system image into
from the directory tree
. No special devices or privileges
are required to perform this task.
The options are as follows:
- Set the byte order of the image to
byte-order. Valid byte orders are
be’ for big endian, and
le’ for little endian. Some file
systems may have a fixed byte order; in those cases this argument will be
- Ensure that a minimum of
free-blocks 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.
- Enable various levels of debugging, depending upon which
bits are set in debug-mask. XXX: document
- Use specfile as an
If a specfile entry exists in the underlying file system, its permissions
and modification time will be used unless specifically overridden by the
specfile. An error will be raised if the type of entry in the specfile
conflicts with that of an existing entry.
In the opposite case (where a specfile entry does not have an entry in the
underlying file system) the following occurs: If the specfile entry is
marked optional, the specfile entry is
ignored. Otherwise, the entry will be created in the image, and it is
necessary to specify at least the following parameters in the specfile:
gname, or gid,
and uname or
uid, device (in
the case of block or character devices), and
link (in the case of symbolic links). If
time isn't provided, the current time will be
used. If flags isn't provided, the current
file flags will be used. Missing regular file entries will be created as
- Ensure that a minimum of
free-files 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 directory tree.
- Use the user database text file
master.passwd and group database text file
dbdir, rather than using the results from
the system's getpwnam(3) and
getgrnam(3) (and related) library calls.
- Set file system specific options.
fs-options is a comma separated list of
options. Valid file system specific options are detailed below.
- Set the file system sector size to
sector-size. Defaults to 512.
- Set the size of the file system image to
- Create an fs-type file
system image. The following file system types are supported:
- BSD fast file system (default).
- ISO 9660 file system.
- Clamp superblock and file timestamps to
maximum-time seconds since the
- Exclude file system nodes not explicitly listed in the
Where sizes are specified, a decimal number of bytes is expected. Two or more
numbers may be separated by an “x” to indicate a product. Each
number may have one of the following optional suffixes:
- Block; multiply by 512
- Kibi; multiply by 1024 (1 KiB)
- Mebi; multiply by 1048576 (1 MiB)
- Gibi; multiply by 1073741824 (1 GiB)
- Tebi; multiply by 1099511627776 (1 TiB)
- Word; multiply by the number of bytes in an integer
images have ffs-specific optional parameters
that may be provided. Each of the options consists of a keyword, an equal sign
’), and a value. The following
keywords are supported:
- Expected average file size.
- Expected number of files per directory.
- Block size.
- Bytes per inode.
- Fragment size.
- Maximum blocks per file in a cylinder group.
- Minimum % free.
- Optimization preference; one of
- Maximum extent size.
- Maximum total number of blocks in a cylinder group.
- UFS version. 1 for FFS (default), 2 for UFS2.
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 spec.
- Allow 37 instead of 33 characters for filenames by omitting
the version id.
- Allow multiple dots in a filename.
- Application ID of the image.
- Use the ‘
extension to encode RISC OS metadata.
- Write a legacy 56-byte table at offset 8 into the boot
image (see below).
- Set load segment for the boot image.
- Filename of a boot image in the format
“sysid;filename”, where “sysid” is one of
- Override PVD creation date.
- Override PVD effective date.
- Override PVD expiration date.
- Load a generic boot image into the first 32K of the cd9660
- Boot image is a hard disk image.
- Assign the RR_MOVED directory
a rock ridge name of the empty string instead of the default
- Don't throw away images whose write was aborted due to an
error. For debugging purposes.
- Label name of the image.
- Override PVD modification date.
- Boot image is not bootable.
- Boot image is a “no emulation” ElTorito
- Do not pad the image (apparently Linux needs the
- Violate the standard, do not append a trailing period to
filenames without an extension.
- Preparer ID of the image.
- Publisher ID of the image.
- Use RockRidge extensions (for longer filenames, etc.).
- Force uid 0, gid 0, and rationalised permission bits for
- Volume set identifier of the image.
currently consists of the
following fields (all 7.3.1 numbers), offsets relative to the boot image:
- 8 bytes: kept as is, not part of checksum
- LBA of PVD
- LBA of boot image
- Size in bytes of boot image
- 32-bit additive sum of all 32-bit words of boot image
- 40 reserved bytes (MBZ)
- Begin of checksummed data, kept as is
Dates (to override) are in 18.104.22.168 format
) and Universal Time, i.e.
with zero offset from Greenwich Mean Time.
utility appeared in
Support for overriding PVD dates and the boot info table was added in
may be limited to images less than 2 GiB in
size due to internal use of the long type.