| MAKEFS(8) | System Manager's Manual | MAKEFS(8) |
makefs — create a
file system image from a directory tree
makefs |
[-LrxZ] [-B
endian] [-b
free-blocks] [-d
debug-mask] [-F
mtree-specfile] [-f
free-files] [-M
minimum-size] [-m
maximum-size] [-N
userdb-dir] [-O
offset] [-o
fs-options] [-S
sector-size] [-s
image-size] [-T
timestamp] [-t
fs-type] image-file
directory [extra-directory
...] |
The utility makefs creates a file system
image into image-file from the directory tree
directory. If any optional directory trees are passed
in the extra-directory arguments, then the directory
tree of each argument will be merged into the
directory first before creating
image-file. No special devices or privileges are
required to perform this task.
The options are as follows:
-B
endian4321’,
‘big’, or
‘be’ for big endian, and
‘1234’,
‘little’, or
‘le’ for little endian. Some file
systems may have a fixed byte order; in those cases this argument will be
ignored.-b
free-blocks%’
suffix may be provided to indicate that free-blocks
indicates a percentage of the calculated image size.-d
debug-mask |
comma-separated-debug-optiondebug_dump_fsnodes is
enabled.-x special file exclusion.-F
mtree-specfileIf 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: type, mode, 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 zero-length files.
-f
free-files%’ suffix may be provided to
indicate that free-files indicates a percentage of
the calculated image size.-L-M
minimum-size-m
maximum-size-N
userdb-dir-O
offset-o
fs-options-r-S
sector-size-s
image-size-M) and the maximum (-m)
sizes to image-size. For ffs and
msdos the offset is not included
on that size.-T
timestamp-t
fs-type-xmakefs to print a warning for
each missing system nodes and exit with an error code if there are any
missing.-ZWhere 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:
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=num,
a=numavgfpdir=num,
n=numbsize=num,
b=numdensity=num,
d=numextattr=num,
e=numextent=num,
x=numfsize=num,
f=numlabel=str,
l=strmaxbpcg=num,
g=nummaxbpg=num,
M=numminfree=num,
m=numoptimization=str,
o=strspace’ or
‘time’.version=num,
v=num-O
option of newfs(8). One of: 0
for FFSv1 with the old level 1 format, 1 for FFSv1 (default, level 4), or
2 for FFSv2 (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,
Dallow-illegal-chars,
iallow-lowercaseallow-max-name,
aallow-multidot,
mapplicationid=str,
A=strarchimedesARCHIMEDES’ extension to
encode RISC OS metadata.boot-load-segment=strbootimage=str,
B=strefi’,
‘i386’,
‘mac68k’,
‘macppc’, or
‘powerpc’.bootimagedir=strchrp-boot,
Cfollow-symlinks,
Sgeneric-bootimage=str,
G=strhard-disk-boothelp,
hisolevel=num,
l=numkeep-bad-images,
Klabel=str,
L=strno-bootno-emul-bootno-trailing-paddingomit-trailing-periodplatformid=strpreparer=str,
p=strpublisher=str,
P=strrockridge,
Rverbose=num,
v=numvolumeid=str,
V=strchfs images have chfs-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:
erasesize=num,
e=nummediatype=num,
m=numpagesize=num,
p=nummsdos 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 (see
newfs_msdos(8) for more
details):
backup_sector=num,
k=numblock_size=num,
b=numbootstrap=str,
B=strbytes_per_sector=num,
S=numcreate_size=num,
C=numdirectory_entries=num,
e=numdrive_heads=num,
h=numfat_type=num,
F=numfloppy=str,
f=strinfo_sector=num,
i=nummedia_descriptor=num,
m=numno_create,
Nnum_FAT=num,
n=numOEM_string=str,
O=stroffset=num,
@=numreserved_sectors=num,
r=numsectors_per_cluster=num,
c=numsectors_per_fat=num,
a=numsectors_per_track=num,
u=numsize=num,
s=numutf8volume_id=num,
I=numvolume_label=str,
L=strThe following keywords are supported:
makefs supports besides writing to image
files also direct formatting of disc partitions and optical media. Optical
media will auto configure settings. The following udf-specific optional
parameters may be provided. Each of the options consists of a keyword, an
equal sign (‘=’), and a value. The
following keywords are supported:
checksurface,
cdiscid=str,
P=strdisctype=str,
T=strforceformat,
Floglabel=str,
L=strmaxver=str,
V=strmakefs.metaperc=num,
p=numminver=str,
v=strmakefs.tz=num,
t=numThe makefs utility appeared in
NetBSD 1.6.
Luke Mewburn (original program),
Daniel Watt,
Walter Deignan,
Ryan Gabrys,
Alan Perez-Rathke,
Ram Vedam (cd9660 support),
UCHIYAMA Yasushi (v7fs support),
Tamas Toth (chfs support),
Christos Zoulas (msdos support),
Reinoud Zandijk (udf support).
| May 6, 2026 | NetBSD 11.99 |