1881e506bSEd Maste.\" $NetBSD: makefs.8,v 1.33 2011/05/22 21:51:39 christos Exp $ 2d347a0daSSam Leffler.\" 3d347a0daSSam Leffler.\" Copyright (c) 2001-2003 Wasabi Systems, Inc. 4d347a0daSSam Leffler.\" All rights reserved. 5d347a0daSSam Leffler.\" 6d347a0daSSam Leffler.\" Written by Luke Mewburn for Wasabi Systems, Inc. 7d347a0daSSam Leffler.\" 8d347a0daSSam Leffler.\" Redistribution and use in source and binary forms, with or without 9d347a0daSSam Leffler.\" modification, are permitted provided that the following conditions 10d347a0daSSam Leffler.\" are met: 11d347a0daSSam Leffler.\" 1. Redistributions of source code must retain the above copyright 12d347a0daSSam Leffler.\" notice, this list of conditions and the following disclaimer. 13d347a0daSSam Leffler.\" 2. Redistributions in binary form must reproduce the above copyright 14d347a0daSSam Leffler.\" notice, this list of conditions and the following disclaimer in the 15d347a0daSSam Leffler.\" documentation and/or other materials provided with the distribution. 16d347a0daSSam Leffler.\" 3. All advertising materials mentioning features or use of this software 17d347a0daSSam Leffler.\" must display the following acknowledgement: 18d347a0daSSam Leffler.\" This product includes software developed for the NetBSD Project by 19d347a0daSSam Leffler.\" Wasabi Systems, Inc. 20d347a0daSSam Leffler.\" 4. The name of Wasabi Systems, Inc. may not be used to endorse 21d347a0daSSam Leffler.\" or promote products derived from this software without specific prior 22d347a0daSSam Leffler.\" written permission. 23d347a0daSSam Leffler.\" 24d347a0daSSam Leffler.\" THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND 25d347a0daSSam Leffler.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 26d347a0daSSam Leffler.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 27d347a0daSSam Leffler.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC 28d347a0daSSam Leffler.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 29d347a0daSSam Leffler.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 30d347a0daSSam Leffler.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 31d347a0daSSam Leffler.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 32d347a0daSSam Leffler.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 33d347a0daSSam Leffler.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 34d347a0daSSam Leffler.\" POSSIBILITY OF SUCH DAMAGE. 35d347a0daSSam Leffler.\" 36d8f3e878SMark Johnston.Dd July 19, 2025 37d347a0daSSam Leffler.Dt MAKEFS 8 38d347a0daSSam Leffler.Os 39d347a0daSSam Leffler.Sh NAME 40d347a0daSSam Leffler.Nm makefs 41484b5c25SMarcel Moolenaar.Nd create a file system image from a directory tree or a mtree manifest 42d347a0daSSam Leffler.Sh SYNOPSIS 43d347a0daSSam Leffler.Nm 449ab90e8aSGlen Barber.Op Fl DxZ 4593c2e800SEnji Cooper.Op Fl B Ar endian 4601a0f853SOlivier Houchard.Op Fl b Ar free-blocks 4701a0f853SOlivier Houchard.Op Fl d Ar debug-mask 4893c2e800SEnji Cooper.Op Fl F Ar mtree-specfile 4901a0f853SOlivier Houchard.Op Fl f Ar free-files 5001a0f853SOlivier Houchard.Op Fl M Ar minimum-size 5101a0f853SOlivier Houchard.Op Fl m Ar maximum-size 52d347a0daSSam Leffler.Op Fl N Ar userdb-dir 53b79f050aSEd Maste.Op Fl O Ar offset 5401a0f853SOlivier Houchard.Op Fl o Ar fs-options 5578d2334fSEnji Cooper.Op Fl R Ar roundup-size 5601a0f853SOlivier Houchard.Op Fl S Ar sector-size 5701a0f853SOlivier Houchard.Op Fl s Ar image-size 587b03d164SEd Maste.Op Fl T Ar timestamp 5901a0f853SOlivier Houchard.Op Fl t Ar fs-type 60d347a0daSSam Leffler.Ar image-file 61484b5c25SMarcel Moolenaar.Ar directory | manifest 62688aaa09SJung-uk Kim.Op Ar extra-directory ... 63d347a0daSSam Leffler.Sh DESCRIPTION 64d347a0daSSam LefflerThe utility 65d347a0daSSam Leffler.Nm 66d347a0daSSam Lefflercreates a file system image into 67d347a0daSSam Leffler.Ar image-file 68d347a0daSSam Lefflerfrom the directory tree 69484b5c25SMarcel Moolenaar.Ar directory 70484b5c25SMarcel Moolenaaror from the mtree manifest 71484b5c25SMarcel Moolenaar.Ar manifest . 7293c2e800SEnji CooperIf any optional directory trees are passed in the 73688aaa09SJung-uk Kim.Ar extra-directory 7493c2e800SEnji Cooperarguments, then the directory tree of each argument will be merged 75688aaa09SJung-uk Kiminto the 76688aaa09SJung-uk Kim.Ar directory 77688aaa09SJung-uk Kimor 78688aaa09SJung-uk Kim.Ar manifest 79688aaa09SJung-uk Kimfirst before creating 80688aaa09SJung-uk Kim.Ar image-file . 81d347a0daSSam LefflerNo special devices or privileges are required to perform this task. 82d347a0daSSam Leffler.Pp 83d347a0daSSam LefflerThe options are as follows: 84d347a0daSSam Leffler.Bl -tag -width flag 8593c2e800SEnji Cooper.It Fl B Ar endian 86d347a0daSSam LefflerSet the byte order of the image to 8793c2e800SEnji Cooper.Ar endian . 88d347a0daSSam LefflerValid byte orders are 89d347a0daSSam Leffler.Ql 4321 , 9001a0f853SOlivier Houchard.Ql big , 91d347a0daSSam Leffleror 92d347a0daSSam Leffler.Ql be 93d347a0daSSam Lefflerfor big endian, and 94d347a0daSSam Leffler.Ql 1234 , 9501a0f853SOlivier Houchard.Ql little , 96d347a0daSSam Leffleror 97d347a0daSSam Leffler.Ql le 98d347a0daSSam Lefflerfor little endian. 99d347a0daSSam LefflerSome file systems may have a fixed byte order; in those cases this 100d347a0daSSam Lefflerargument will be ignored. 101d347a0daSSam Leffler.It Fl b Ar free-blocks 102d347a0daSSam LefflerEnsure that a minimum of 103d347a0daSSam Leffler.Ar free-blocks 104d347a0daSSam Lefflerfree blocks exist in the image. 105d347a0daSSam LefflerAn optional 106d347a0daSSam Leffler.Ql % 107d347a0daSSam Lefflersuffix may be provided to indicate that 108d347a0daSSam Leffler.Ar free-blocks 10901a0f853SOlivier Houchardindicates a percentage of the calculated image size. 110b0d9addeSBrooks Davis.It Fl D 111b0d9addeSBrooks DavisTreat duplicate paths in an mtree manifest as warnings not error. 112e0deb850SMark JohnstonIf this flag is specified more than once, warnings about duplicate paths 113e0deb850SMark Johnstonare not printed at all. 11401a0f853SOlivier Houchard.It Fl d Ar debug-mask 11501a0f853SOlivier HouchardEnable various levels of debugging, depending upon which bits are 11601a0f853SOlivier Houchardset in 11701a0f853SOlivier Houchard.Ar debug-mask . 118915af883SGreg LeheyThis option is intended for source debugging. 119915af883SGreg Lehey.Ar debug-mask 120915af883SGreg Leheyis a bit map defined in the header file 121915af883SGreg Lehey.Ar makefs.h . 122915af883SGreg LeheySee the source for usage, and look for defines starting with 123915af883SGreg Lehey.Ar DEBUG_ . 12493c2e800SEnji Cooper.It Fl F Ar mtree-specfile 12508069ae6SBrooks Davis.Em This is almost certainly not the option you are looking for. 12608069ae6SBrooks DavisTo create an image from a list of files in an mtree format manifest, 12708069ae6SBrooks Davisspecify it as the last argument on the command line, not as a the 12808069ae6SBrooks Davisargument to 12908069ae6SBrooks Davis.Fl F . 13008069ae6SBrooks Davis.Pp 131d347a0daSSam LefflerUse 13293c2e800SEnji Cooper.Ar mtree-specfile 133d347a0daSSam Leffleras an 134d347a0daSSam Leffler.Xr mtree 8 135d347a0daSSam Leffler.Sq specfile 136d347a0daSSam Lefflerspecification. 137484b5c25SMarcel MoolenaarThis option has no effect when the image is created from a mtree manifest 138484b5c25SMarcel Moolenaarrather than a directory. 139d347a0daSSam Leffler.Pp 14001a0f853SOlivier HouchardIf a specfile entry exists in the underlying file system, its 14101a0f853SOlivier Houchardpermissions and modification time will be used unless specifically 14201a0f853SOlivier Houchardoverridden by the specfile. 14301a0f853SOlivier HouchardAn error will be raised if the type of entry in the specfile 14401a0f853SOlivier Houchardconflicts with that of an existing entry. 145d347a0daSSam Leffler.Pp 14601a0f853SOlivier HouchardIn the opposite case (where a specfile entry does not have an entry 14701a0f853SOlivier Houchardin the underlying file system) the following occurs: 148d347a0daSSam LefflerIf the specfile entry is marked 149d347a0daSSam Leffler.Sy optional , 150d347a0daSSam Lefflerthe specfile entry is ignored. 15101a0f853SOlivier HouchardOtherwise, the entry will be created in the image, and it is 15201a0f853SOlivier Houchardnecessary to specify at least the following parameters in the 15301a0f853SOlivier Houchardspecfile: 154d347a0daSSam Leffler.Sy type , 155d347a0daSSam Leffler.Sy mode , 15601a0f853SOlivier Houchard.Sy gname , 157d347a0daSSam Leffleror 158d347a0daSSam Leffler.Sy gid , 159d347a0daSSam Lefflerand 160d347a0daSSam Leffler.Sy uname 161d347a0daSSam Leffleror 162d347a0daSSam Leffler.Sy uid , 1636b15a26aSEitan Adlerand 164d347a0daSSam Leffler.Sy link 165d347a0daSSam Leffler(in the case of symbolic links). 166d347a0daSSam LefflerIf 167d347a0daSSam Leffler.Sy time 1684d393b6cSEd Masteis not provided, the current time will be used. 169d347a0daSSam LefflerIf 170d347a0daSSam Leffler.Sy flags 1714d393b6cSEd Masteis not provided, the current file flags will be used. 172d347a0daSSam LefflerMissing regular file entries will be created as zero-length files. 17301a0f853SOlivier Houchard.It Fl f Ar free-files 17401a0f853SOlivier HouchardEnsure that a minimum of 17501a0f853SOlivier Houchard.Ar free-files 17601a0f853SOlivier Houchardfree files (inodes) exist in the image. 17701a0f853SOlivier HouchardAn optional 17801a0f853SOlivier Houchard.Ql % 17901a0f853SOlivier Houchardsuffix may be provided to indicate that 18001a0f853SOlivier Houchard.Ar free-files 18101a0f853SOlivier Houchardindicates a percentage of the calculated image size. 18201a0f853SOlivier Houchard.It Fl M Ar minimum-size 18301a0f853SOlivier HouchardSet the minimum size of the file system image to 18401a0f853SOlivier Houchard.Ar minimum-size . 18501a0f853SOlivier Houchard.It Fl m Ar maximum-size 18601a0f853SOlivier HouchardSet the maximum size of the file system image to 18701a0f853SOlivier Houchard.Ar maximum-size . 18801a0f853SOlivier HouchardAn error will be raised if the target file system needs to be larger 18901a0f853SOlivier Houchardthan this to accommodate the provided directory tree. 19093c2e800SEnji Cooper.It Fl N Ar userdb-dir 191d347a0daSSam LefflerUse the user database text file 192d347a0daSSam Leffler.Pa master.passwd 193d347a0daSSam Lefflerand group database text file 194d347a0daSSam Leffler.Pa group 195d347a0daSSam Lefflerfrom 19693c2e800SEnji Cooper.Ar userdb-dir , 197d347a0daSSam Lefflerrather than using the results from the system's 198d347a0daSSam Leffler.Xr getpwnam 3 199d347a0daSSam Lefflerand 200d347a0daSSam Leffler.Xr getgrnam 3 201d347a0daSSam Leffler(and related) library calls. 202b79f050aSEd Maste.It Fl O Ar offset 203b79f050aSEd MasteInstead of creating the filesystem at the beginning of the file, start 204b79f050aSEd Masteat offset. 205b79f050aSEd MasteValid only for 20698dc8da5SEd Maste.Sy ffs 20798dc8da5SEd Masteand 20898dc8da5SEd Maste.Sy msdos . 20901a0f853SOlivier Houchard.It Fl o Ar fs-options 21001a0f853SOlivier HouchardSet file system specific options. 21101a0f853SOlivier Houchard.Ar fs-options 21201a0f853SOlivier Houchardis a comma separated list of options. 21301a0f853SOlivier HouchardValid file system specific options are detailed below. 21499c841b1SHiroki Sato.It Fl p 2159ab90e8aSGlen BarberDeprecated. 216b7b78000SGreg LeheyCreate a sparse file for 217b7b78000SGreg Lehey.Sy ffs . 218b7b78000SGreg LeheyThis is the same as the preferred 2199ab90e8aSGlen Barber.Fl Z 2209ab90e8aSGlen Barberflag. 22178d2334fSEnji Cooper.It Fl R Ar roundup-size 22278d2334fSEnji CooperRound the image up to 22378d2334fSEnji Cooper.Ar roundup-size . 22478d2334fSEnji Cooper.Ar roundup-size 22578d2334fSEnji Coopershould be a multiple of the file system block size. 22678d2334fSEnji CooperThis option only applies to the 22778d2334fSEnji Cooper.Sy ffs 22878d2334fSEnji Cooperfile system type. 22901a0f853SOlivier Houchard.It Fl S Ar sector-size 23001a0f853SOlivier HouchardSet the file system sector size to 23101a0f853SOlivier Houchard.Ar sector-size . 23201a0f853SOlivier Houchard.\" XXX: next line also true for cd9660? 23301a0f853SOlivier HouchardDefaults to 512. 23401a0f853SOlivier Houchard.It Fl s Ar image-size 23501a0f853SOlivier HouchardSet the size of the file system image to 23601a0f853SOlivier Houchard.Ar image-size . 2375059f7c3SEd MasteThis is equivalent to setting both the minimum 2385059f7c3SEd Maste.Fl ( M ) 2395059f7c3SEd Masteand the maximum 2405059f7c3SEd Maste.Fl ( m ) 2415059f7c3SEd Mastesizes to the same value. 2425059f7c3SEd MasteFor 2435059f7c3SEd Maste.Sy ffs 24498dc8da5SEd Masteand 24598dc8da5SEd Maste.Sy msdos 2465059f7c3SEd Mastethe 2475059f7c3SEd Maste.Ar image-size 2485059f7c3SEd Mastedoes not include the 2495059f7c3SEd Maste.Ar offset . 25098dc8da5SEd Maste.Ar offset 25198dc8da5SEd Masteis not included in that size. 2527b03d164SEd Maste.It Fl T Ar timestamp 2537b03d164SEd MasteSpecify a timestamp to be set for all filesystem files and directories 2547b03d164SEd Mastecreated so that repeatable builds are possible. 2557b03d164SEd MasteThe 2567b03d164SEd Maste.Ar timestamp 2577b03d164SEd Mastecan be a 2587b03d164SEd Maste.Pa pathname , 2597b03d164SEd Mastewhere the timestamps are derived from that file, or an integer 2607b03d164SEd Mastevalue interpreted as the number of seconds from the Epoch. 261fba91af3SBojan NovkovićTimestamps in a 2627b03d164SEd Maste.Xr mtree 5 263fba91af3SBojan Novkovićspecfile (specified with 264fba91af3SBojan Novković.Fl F ) 265fba91af3SBojan Novkovićare used even if a default timestamp is specified. 266fba91af3SBojan NovkovićHowever, the timestamps in an mtree manifest are ignored 267fba91af3SBojan Novkovićif a default timestamp is specified. 26801a0f853SOlivier Houchard.It Fl t Ar fs-type 26901a0f853SOlivier HouchardCreate an 27001a0f853SOlivier Houchard.Ar fs-type 27101a0f853SOlivier Houchardfile system image. 27201a0f853SOlivier HouchardThe following file system types are supported: 27301a0f853SOlivier Houchard.Bl -tag -width cd9660 -offset indent 27401a0f853SOlivier Houchard.It Sy ffs 27501a0f853SOlivier HouchardBSD fast file system (default). 27601a0f853SOlivier Houchard.It Sy cd9660 27701a0f853SOlivier HouchardISO 9660 file system. 27898dc8da5SEd Maste.It Sy msdos 27998dc8da5SEd MasteFAT12, FAT16, or FAT32 file system. 280240afd8cSMark Johnston.It Sy zfs 281240afd8cSMark JohnstonZFS pool containing one or more file systems. 28201a0f853SOlivier Houchard.El 28301a0f853SOlivier Houchard.It Fl x 28401a0f853SOlivier HouchardExclude file system nodes not explicitly listed in the specfile. 2859ab90e8aSGlen Barber.It Fl Z 28693c2e800SEnji CooperCreate a sparse file for 28793c2e800SEnji Cooper.Sy ffs . 28893c2e800SEnji CooperThis is useful for virtual machine images. 289d347a0daSSam Leffler.El 290d347a0daSSam Leffler.Pp 291d347a0daSSam LefflerWhere sizes are specified, a decimal number of bytes is expected. 292d347a0daSSam LefflerTwo or more numbers may be separated by an 293d347a0daSSam Leffler.Dq x 294d347a0daSSam Lefflerto indicate a product. 295d347a0daSSam LefflerEach number may have one of the following optional suffixes: 296d347a0daSSam Leffler.Bl -tag -width 3n -offset indent -compact 297d347a0daSSam Leffler.It b 298d347a0daSSam LefflerBlock; multiply by 512 299d347a0daSSam Leffler.It k 30001a0f853SOlivier HouchardKibi; multiply by 1024 (1 KiB) 301d347a0daSSam Leffler.It m 30201a0f853SOlivier HouchardMebi; multiply by 1048576 (1 MiB) 303d347a0daSSam Leffler.It g 30401a0f853SOlivier HouchardGibi; multiply by 1073741824 (1 GiB) 305d347a0daSSam Leffler.It t 30601a0f853SOlivier HouchardTebi; multiply by 1099511627776 (1 TiB) 307d347a0daSSam Leffler.It w 308d347a0daSSam LefflerWord; multiply by the number of bytes in an integer 309d347a0daSSam Leffler.El 310d347a0daSSam Leffler.\" 311d347a0daSSam Leffler.\" 312d347a0daSSam Leffler.Ss FFS-specific options 313d347a0daSSam Leffler.Sy ffs 314d347a0daSSam Lefflerimages have ffs-specific optional parameters that may be provided. 31501a0f853SOlivier HouchardEach of the options consists of a keyword, an equal sign 316d347a0daSSam Leffler.Pq Ql = , 317d347a0daSSam Lefflerand a value. 318d347a0daSSam LefflerThe following keywords are supported: 319d347a0daSSam Leffler.Pp 320d347a0daSSam Leffler.Bl -tag -width optimization -offset indent -compact 321d347a0daSSam Leffler.It Sy avgfilesize 32201a0f853SOlivier HouchardExpected average file size. 323d347a0daSSam Leffler.It Sy avgfpdir 32401a0f853SOlivier HouchardExpected number of files per directory. 325d347a0daSSam Leffler.It Sy bsize 32601a0f853SOlivier HouchardBlock size. 327d347a0daSSam Leffler.It Sy density 328afb6a168SNathan WhitehornBytes per inode. If unset, will allocate the minimum number of inodes to 329afb6a168SNathan Whitehornrepresent the filesystem if no free space has been requested (free blocks 330afb6a168SNathan Whitehornor minimum size set); otherwise the larger of the newfs defaults or what 331afb6a168SNathan Whitehornis required by the free inode parameters if set. 332d347a0daSSam Leffler.It Sy fsize 33301a0f853SOlivier HouchardFragment size. 334703d6e3eSNathan Whitehorn.It Sy label 335703d6e3eSNathan WhitehornLabel name of the image. 336d347a0daSSam Leffler.It Sy maxbpg 33701a0f853SOlivier HouchardMaximum blocks per file in a cylinder group. 338d347a0daSSam Leffler.It Sy minfree 33901a0f853SOlivier HouchardMinimum % free. 340d347a0daSSam Leffler.It Sy optimization 341d347a0daSSam LefflerOptimization preference; one of 342d347a0daSSam Leffler.Ql space 343d347a0daSSam Leffleror 344d347a0daSSam Leffler.Ql time . 345d347a0daSSam Leffler.It Sy extent 34601a0f853SOlivier HouchardMaximum extent size. 347d347a0daSSam Leffler.It Sy maxbpcg 34801a0f853SOlivier HouchardMaximum total number of blocks in a cylinder group. 349d347a0daSSam Leffler.It Sy version 35001a0f853SOlivier HouchardUFS version. 35101a0f853SOlivier Houchard1 for FFS (default), 2 for UFS2. 352d91e6117SEmmanuel Vadot.It Sy softupdates 353d91e6117SEmmanuel Vadot0 for disable (default), 1 for enable 35401a0f853SOlivier Houchard.El 35501a0f853SOlivier Houchard.Ss CD9660-specific options 35601a0f853SOlivier Houchard.Sy cd9660 35701a0f853SOlivier Houchardimages have ISO9660-specific optional parameters that may be 35801a0f853SOlivier Houchardprovided. 35901a0f853SOlivier HouchardThe arguments consist of a keyword and, optionally, an equal sign 36001a0f853SOlivier Houchard.Pq Ql = , 36101a0f853SOlivier Houchardand a value. 36201a0f853SOlivier HouchardThe following keywords are supported: 36301a0f853SOlivier Houchard.Pp 36401a0f853SOlivier Houchard.Bl -tag -width omit-trailing-period -offset indent -compact 36501a0f853SOlivier Houchard.It Sy allow-deep-trees 36601a0f853SOlivier HouchardAllow the directory structure to exceed the maximum specified in 36701a0f853SOlivier Houchardthe spec. 3686dbfd3d6SEnji Cooper.It Sy allow-illegal-chars 3694d393b6cSEd MasteAllow illegal characters in filenames. 3704d393b6cSEd MasteThis option is not implemented. 3716dbfd3d6SEnji Cooper.It Sy allow-lowercase 3724d393b6cSEd MasteAllow lowercase characters in filenames. 3734d393b6cSEd MasteThis option is not implemented. 37401a0f853SOlivier Houchard.It Sy allow-max-name 37501a0f853SOlivier HouchardAllow 37 instead of 33 characters for filenames by omitting the 37601a0f853SOlivier Houchardversion id. 37701a0f853SOlivier Houchard.It Sy allow-multidot 37801a0f853SOlivier HouchardAllow multiple dots in a filename. 37901a0f853SOlivier Houchard.It Sy applicationid 38001a0f853SOlivier HouchardApplication ID of the image. 3816dbfd3d6SEnji Cooper.It Sy bootimagedir 3824d393b6cSEd MasteBoot image directory. 3834d393b6cSEd MasteThis option is not implemented. 384df73c41aSNathan Whitehorn.It Sy chrp-boot 385df73c41aSNathan WhitehornWrite an MBR partition table to the image to allow older CHRP hardware to 386df73c41aSNathan Whitehornboot. 38701a0f853SOlivier Houchard.It Sy boot-load-segment 38801a0f853SOlivier HouchardSet load segment for the boot image. 38901a0f853SOlivier Houchard.It Sy bootimage 39001a0f853SOlivier HouchardFilename of a boot image in the format 39101a0f853SOlivier Houchard.Dq sysid;filename , 39201a0f853SOlivier Houchardwhere 39301a0f853SOlivier Houchard.Dq sysid 39401a0f853SOlivier Houchardis one of 395ec3c01aeSEd Maste.Ql efi , 39601a0f853SOlivier Houchard.Ql i386 , 39701a0f853SOlivier Houchard.Ql mac68k , 39801a0f853SOlivier Houchard.Ql macppc , 39901a0f853SOlivier Houchardor 400ec3c01aeSEd Maste.Ql powerpc . 40101a0f853SOlivier Houchard.It Sy generic-bootimage 40201a0f853SOlivier HouchardLoad a generic boot image into the first 32K of the cd9660 image. 40301a0f853SOlivier Houchard.It Sy hard-disk-boot 40401a0f853SOlivier HouchardBoot image is a hard disk image. 405eac300b8SEnji Cooper.It Sy isolevel 4066dbfd3d6SEnji CooperAn integer representing the ISO 9660 interchange level where 4076dbfd3d6SEnji Cooper.Dq level 4086dbfd3d6SEnji Cooperis either 4096dbfd3d6SEnji Cooper.Ql 1 4106dbfd3d6SEnji Cooperor 4116dbfd3d6SEnji Cooper.Ql 2 . 4126dbfd3d6SEnji Cooper.Dq level 4136dbfd3d6SEnji Cooper.Ql 3 4146dbfd3d6SEnji Cooperis not implemented. 41501a0f853SOlivier Houchard.It Sy keep-bad-images 416daf5e000SEnji CooperDo not discard images whose write was aborted due to an error. 41701a0f853SOlivier HouchardFor debugging purposes. 41801a0f853SOlivier Houchard.It Sy label 41901a0f853SOlivier HouchardLabel name of the image. 42001a0f853SOlivier Houchard.It Sy no-boot 42101a0f853SOlivier HouchardBoot image is not bootable. 42201a0f853SOlivier Houchard.It Sy no-emul-boot 42301a0f853SOlivier HouchardBoot image is a 42401a0f853SOlivier Houchard.Dq no emulation 42501a0f853SOlivier HouchardElTorito image. 42601a0f853SOlivier Houchard.It Sy no-trailing-padding 42701a0f853SOlivier HouchardDo not pad the image (apparently Linux needs the padding). 4286dbfd3d6SEnji Cooper.It Sy omit-trailing-period 4296dbfd3d6SEnji CooperOmit trailing periods in filenames. 430756e49c3SBenno Rice.It Sy platformid 431756e49c3SBenno RiceSet platform ID of section header entry of the boot image. 43201a0f853SOlivier Houchard.It Sy preparer 43301a0f853SOlivier HouchardPreparer ID of the image. 43401a0f853SOlivier Houchard.It Sy publisher 43501a0f853SOlivier HouchardPublisher ID of the image. 43601a0f853SOlivier Houchard.It Sy rockridge 43701a0f853SOlivier HouchardUse RockRidge extensions (for longer filenames, etc.). 4386dbfd3d6SEnji Cooper.It Sy verbose 4396dbfd3d6SEnji CooperTurns on verbose output. 44001a0f853SOlivier Houchard.It Sy volumeid 44101a0f853SOlivier HouchardVolume set identifier of the image. 442d347a0daSSam Leffler.El 44398dc8da5SEd Maste.Ss msdos-specific options 44498dc8da5SEd Maste.Sy msdos 44598dc8da5SEd Masteimages have MS-DOS-specific optional parameters that may be 44698dc8da5SEd Masteprovided. 44798dc8da5SEd MasteThe arguments consist of a keyword, an equal sign 44898dc8da5SEd Maste.Pq Ql = , 44998dc8da5SEd Masteand a value. 45098dc8da5SEd MasteThe following keywords are supported (see 45198dc8da5SEd Maste.Xr newfs_msdos 8 45298dc8da5SEd Mastefor more details): 45398dc8da5SEd Maste.Pp 45498dc8da5SEd Maste.Bl -tag -width omit-trailing-period -offset indent -compact 45598dc8da5SEd Maste.It Cm backup_sector 45698dc8da5SEd MasteLocation of the backup boot sector. 45798dc8da5SEd Maste.It Cm block_size 45898dc8da5SEd MasteBlock size. 45998dc8da5SEd Maste.It Cm bootstrap 46098dc8da5SEd MasteBootstrap file. 46198dc8da5SEd Maste.It Cm bytes_per_sector 46298dc8da5SEd MasteBytes per sector. 46398dc8da5SEd Maste.It Cm create_size 46498dc8da5SEd MasteCreate file size. 46598dc8da5SEd Maste.It Cm directory_entries 46698dc8da5SEd MasteDirectory entries. 46798dc8da5SEd Maste.It Cm drive_heads 46898dc8da5SEd MasteDrive heads. 46998dc8da5SEd Maste.It Cm fat_type 47098dc8da5SEd MasteFAT type (12, 16, or 32). 47198dc8da5SEd Maste.It Cm floppy 47298dc8da5SEd MastePreset drive parameters for standard format floppy disks 47398dc8da5SEd Maste(160, 180, 320, 360, 640, 720, 1200, 1232, 1440, or 2880). 47498dc8da5SEd Maste.It Cm hidden_sectors 47598dc8da5SEd MasteHidden sectors. 47698dc8da5SEd Maste.It Cm info_sector 47798dc8da5SEd MasteLocation of the info sector. 47898dc8da5SEd Maste.It Cm media_descriptor 47998dc8da5SEd MasteMedia descriptor. 48098dc8da5SEd Maste.It Cm num_FAT 48198dc8da5SEd MasteNumber of FATs. 48298dc8da5SEd Maste.It Cm OEM_string 48398dc8da5SEd MasteOEM string. 48498dc8da5SEd Maste.It Cm offset 48598dc8da5SEd MasteOffset in device. 48698dc8da5SEd MasteThis option will be ignored if 48798dc8da5SEd Maste.Fl O 48898dc8da5SEd Masteis set to a positive number. 48998dc8da5SEd Maste.It Cm reserved_sectors 49098dc8da5SEd MasteReserved sectors. 49198dc8da5SEd Maste.It Cm sectors_per_cluster 49298dc8da5SEd MasteSectors per cluster. 49398dc8da5SEd Maste.It Cm sectors_per_fat 49498dc8da5SEd MasteSectors per FAT. 49598dc8da5SEd Maste.It Cm sectors_per_track 49698dc8da5SEd MasteSectors per track. 49798dc8da5SEd Maste.It Cm size 49898dc8da5SEd MasteFile System size. 49998dc8da5SEd Maste.It Cm volume_id 50098dc8da5SEd MasteVolume ID. 50198dc8da5SEd Maste.It Cm volume_label 50298dc8da5SEd MasteVolume Label. 50398dc8da5SEd Maste.El 504240afd8cSMark Johnston.Ss zfs-specific options 505240afd8cSMark JohnstonThe image created by 506240afd8cSMark Johnston.Nm 507240afd8cSMark Johnstoncontains a ZFS pool with a single vdev of type 508240afd8cSMark Johnston.Ql disk . 509240afd8cSMark JohnstonThe root dataset is always created implicitly and contains the entire input 510240afd8cSMark Johnstondirectory tree unless additional datasets are specified using the options 511240afd8cSMark Johnstondescribed below. 512240afd8cSMark Johnston.Pp 513a2024944SMark JohnstonTo keep images reproducible, the pool GUID and other random identifiers will 514a2024944SMark Johnstonalways be the same across runs of 515a2024944SMark Johnston.Nm . 516a2024944SMark JohnstonThis means that when a pool is first imported, its GUID should be reset 517a2024944SMark Johnstonusing 518a2024944SMark Johnston.Xr zpool-reguid 8 519a2024944SMark Johnstonto avoid conflicting with other pools also generated by 520a2024944SMark Johnston.Nm ; 521a2024944SMark Johnstonotherwise, it will not be possible to import other pools. 522a2024944SMark JohnstonThis can be configured from 523a2024944SMark Johnston.Pa /etc/rc.conf 524a2024944SMark Johnstonusing the 525a2024944SMark Johnston.Va zpool_reguid 526a2024944SMark Johnstonvariable. 527a2024944SMark Johnston.Pp 528240afd8cSMark JohnstonThe arguments consist of a keyword, an equal sign 529240afd8cSMark Johnston.Pq Ql = , 530240afd8cSMark Johnstonand a value. 531240afd8cSMark JohnstonThe following keywords are supported: 532240afd8cSMark Johnston.Pp 533240afd8cSMark Johnston.Bl -tag -width omit-trailing-period -offset indent -compact 534240afd8cSMark Johnston.It ashift 535240afd8cSMark JohnstonThe base-2 logarithm of the minimum block size. 536240afd8cSMark JohnstonTypical values are 9 (512B blocks) and 12 (4KB blocks). 537240afd8cSMark JohnstonThe default value is 12. 538240afd8cSMark Johnston.It bootfs 539240afd8cSMark JohnstonThe name of the bootable dataset for the pool. 540240afd8cSMark JohnstonSpecifying this option causes the 541240afd8cSMark Johnston.Ql bootfs 542240afd8cSMark Johnstonproperty to be set in the created pool. 543240afd8cSMark Johnston.It mssize 544240afd8cSMark JohnstonThe size of metaslabs in the created pool. 545240afd8cSMark JohnstonBy default, 546240afd8cSMark Johnston.Nm 547240afd8cSMark Johnstonallocates large (up to 512MB) metaslabs with the expectation that 548240afd8cSMark Johnstonthe image will be auto-expanded upon first use. 549240afd8cSMark JohnstonThis option allows the default heuristic to be overridden. 5504e15366cSMark Johnston.It verify-txgs 5514e15366cSMark JohnstonPrompt OpenZFS to verify pool metadata during import. 5524e15366cSMark JohnstonThis is disabled by default as it may significantly increase import times. 553*cd4b9dacSMark Johnston.It poolguid 554*cd4b9dacSMark JohnstonUse the specified 64-bit integer as the pool GUID. 555*cd4b9dacSMark JohnstonIf this option is not specified, the pool GUID will be random but fixed 556*cd4b9dacSMark Johnstonacross multiple identical invocations of 557*cd4b9dacSMark Johnston.Nm . 558*cd4b9dacSMark JohnstonThis option is useful for testing but not required for reproducibility. 559240afd8cSMark Johnston.It poolname 560240afd8cSMark JohnstonThe name of the ZFS pool. 561240afd8cSMark JohnstonThis option must be specified. 562240afd8cSMark Johnston.It rootpath 563240afd8cSMark JohnstonAn implicit path prefix added to dataset mountpoints. 564240afd8cSMark JohnstonBy default it is 565240afd8cSMark Johnston.Pa /<poolname> . 566240afd8cSMark JohnstonFor creating bootable pools, the 567240afd8cSMark Johnston.Va rootpath 568240afd8cSMark Johnstonshould be set to 569240afd8cSMark Johnston.Pa / . 570240afd8cSMark JohnstonAt least one dataset must have a mountpoint equal to 571240afd8cSMark Johnston.Va rootpath . 572240afd8cSMark Johnston.It fs 573240afd8cSMark JohnstonCreate an additional dataset. 574240afd8cSMark JohnstonThis option may be specified multiple times. 575240afd8cSMark JohnstonThe argument value must be of the form 576240afd8cSMark Johnston.Ar <dataset>[;<prop1=v1>[;<prop2=v2>[;...]]] , 577240afd8cSMark Johnstonwhere 578240afd8cSMark Johnston.Ar dataset 579240afd8cSMark Johnstonis the name of the dataset and must belong to the pool's namespace. 580240afd8cSMark JohnstonFor example, with a pool name of 581240afd8cSMark Johnston.Ql test 582240afd8cSMark Johnstonall dataset names must be prefixed by 583240afd8cSMark Johnston.Ql test/ . 584240afd8cSMark JohnstonA dataset must exist at each level of the pool's namespace. 585240afd8cSMark JohnstonFor example, to create 586240afd8cSMark Johnston.Ql test/foo/bar , 587240afd8cSMark Johnston.Ql test/foo 588240afd8cSMark Johnstonmust be created as well. 589240afd8cSMark Johnston.Pp 590240afd8cSMark JohnstonThe dataset mountpoints determine how the datasets are populated with 591240afd8cSMark Johnstonfiles from the staged directory tree. 592240afd8cSMark JohnstonConceptually, all datasets are mounted before any are populated with files. 593240afd8cSMark JohnstonThe root of the staged directory tree is mapped to 594240afd8cSMark Johnston.Va rootpath . 595240afd8cSMark Johnston.Pp 596240afd8cSMark JohnstonDataset properties, as described in 597518a1fd7SJose Luis Duran.Xr zfsprops 7 , 598240afd8cSMark Johnstonmay be specified following the dataset name. 599240afd8cSMark JohnstonThe following properties may be set for a dataset: 600240afd8cSMark Johnston.Pp 601240afd8cSMark Johnston.Bl -tag -compact -offset indent 602240afd8cSMark Johnston.It atime 603240afd8cSMark Johnston.It canmount 604d8f3e878SMark Johnston.It compression 605240afd8cSMark Johnston.It exec 606240afd8cSMark Johnston.It mountpoint 607240afd8cSMark Johnston.It setuid 608240afd8cSMark Johnston.El 609d8f3e878SMark JohnstonNote that 610d8f3e878SMark Johnston.Nm 611d8f3e878SMark Johnstondoes not implement compression of files included in the image, 612d8f3e878SMark Johnstonregardless of the value of the 613d8f3e878SMark Johnston.Dv compression 614d8f3e878SMark Johnstonproperty. 615240afd8cSMark Johnston.El 616d347a0daSSam Leffler.Sh SEE ALSO 617484b5c25SMarcel Moolenaar.Xr mtree 5 , 618a2024944SMark Johnston.Xr rc.conf 5 , 619518a1fd7SJose Luis Duran.Xr zfsconcepts 7 , 620518a1fd7SJose Luis Duran.Xr zfsprops 7 , 621518a1fd7SJose Luis Duran.Xr zpoolprops 7 , 622d347a0daSSam Leffler.Xr mtree 8 , 623a2024944SMark Johnston.Xr newfs 8 , 624a2024944SMark Johnston.Xr zpool-reguid 8 625d347a0daSSam Leffler.Sh HISTORY 626d347a0daSSam LefflerThe 627d347a0daSSam Leffler.Nm 628d347a0daSSam Lefflerutility appeared in 629d347a0daSSam Leffler.Nx 1.6 . 63035284c22SEd MasteIt was ported to 63135284c22SEd Maste.Fx 63235284c22SEd Masteand first appeared in 63335284c22SEd Maste.Fx 8.0 . 634d347a0daSSam Leffler.Sh AUTHORS 635298d081cSEd Maste.An Luke Mewburn 636298d081cSEd Maste.Aq Mt lukem@NetBSD.org 63793c2e800SEnji Cooper(original program), 63893c2e800SEnji Cooper.An Daniel Watt , 63993c2e800SEnji Cooper.An Walter Deignan , 64093c2e800SEnji Cooper.An Ryan Gabrys , 64193c2e800SEnji Cooper.An Alan Perez-Rathke , 64201a0f853SOlivier Houchard.An Ram Vedam 64335284c22SEd Maste(cd9660 support), 64435284c22SEd Maste.An Christos Zoulas 645240afd8cSMark Johnston(msdos support), 646240afd8cSMark Johnston.An Mark Johnston 647240afd8cSMark Johnston(zfs support). 648