OpenBSD manual page server

Manual Page Search Parameters

MAKEFS(8) System Manager's Manual MAKEFS(8)

makefscreate a file system image from a directory tree

makefs [-b free-blocks] [-f free-files] [-M minimum-size] [-m maximum-size] [-O offset] [-o fs-options] [-S sector-size] [-s image-size] [-T timestamp] [-t fs-type] image-file directory

The utility 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:

free-blocks
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.
free-files
Ensure that a minimum of free-files (inodes) exist in the image. An optional ‘%’ suffix may be provided to indicate that free-files indicates a percentage of the calculated image size.
minimum-size
Set the minimum size of the file system image to minimum-size.
maximum-size
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.
offset
Instead of creating the file system at the beginning of the file, start at offset. Valid only for ffs and msdos.
fs-options
Set file system specific options. fs-options is a comma separated list of options. Valid file system specific options are detailed below.
sector-size
Set the file system sector size to sector-size. Defaults to 512.
image-size
Set the size of the file system image to image-size.
timestamp
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.
fs-type
Create an fs-type file system image. The following file system types are supported:

cd9660
ISO 9660 file system.
ffs
BSD Fast File System (the default).
msdos
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 sign (‘=’), and a value. The following keywords are supported:

avgfilesize
Expected average file size.
avgfpdir
Expected number of files per directory.
bsize
Block size.
density
Bytes per inode.
disklabel
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.
extent
Maximum extent size.
fsize
Fragment size.
label
Label name of the image.
maxbpcg
Maximum total number of blocks in a cylinder group.
maxbpg
Maximum blocks per file in a cylinder group.
minfree
Minimum % free.
optimization
Optimization preference: one of ‘space’ (default) or ‘time’.
version
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-deep-trees
Allow the directory structure to exceed the maximum specified in the spec.
allow-multidot
Allow multiple dots in a filename.
applicationid
Application ID of the image.
boot-load-segment
Set load segment for the boot image.
bootimage
Filename of a boot image in the format “sysid;filename”, where “sysid” is one of ‘i386’, ‘macppc’, ‘powerpc’, or ‘efi’.
generic-bootimage
Load a generic boot image into the first 32K of the CD9660 image.
hard-disk-boot
Boot image is a hard disk image.
isolevel
ISO Level.
label
Label name of the image.
no-boot
Boot image is not bootable.
no-emul-boot
Boot image is a “no emulation” ElTorito image.
no-trailing-padding
Do not pad the image (apparently Linux needs the padding).
omit-trailing-period
Omit trailing periods in filenames.
preparer
Preparer ID of the image.
publisher
Publisher ID of the image.
rockridge
Use RockRidge extensions (for longer filenames, etc.).
volumeid
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.

scan_scaled(3), installboot(8), newfs(8)

The makefs utility appeared in NetBSD 1.6.

Luke Mewburn ⟨lukem@NetBSD.org⟩ (original program), Daniel Watt, Walter Deignan, Ryan Gabrys, Alan Perez-Rathke, Ram Vedam (cd9660 support), and Christos Zoulas (msdos support).

November 7, 2017 OpenBSD-current