1 .\" Copyright (c) 2013, 2014 Juniper Networks, Inc.
2 .\" All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\" notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\" notice, this list of conditions and the following disclaimer in the
12 .\" documentation and/or other materials provided with the distribution.
14 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
15 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
16 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
17 .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
18 .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19 .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20 .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21 .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 .Nd "utility to make disk images"
45 .Op Fl s Ar scheme Op Fl p Ar partition ...
47 .Ar --formats | --schemes | --version
51 utility creates a disk image from the raw partition contents specified with
54 argument(s) and using the partitioning scheme specified with the
57 The disk image is written to
59 by default or the file specified with the
62 The image file is a raw disk image by default, but the format of the
63 image file can be specified with the
67 The disk image can be made bootable by specifying the scheme-specific boot
68 block contents with the
71 depending on the scheme,
72 with a boot partition.
73 The contents of such a boot partition is provided like any other partition
76 utility does not treat it any differently from other partitions.
78 Some partitioning schemes need a disk geometry and for those the
84 arguments, specifying the number of sectors per track and the number of
85 heads per cylinder (resp.)
87 Both the logical and physical sector size can be specified and for that the
97 argument is used to specify the logical sector size.
98 This is the sector size reported by a disk when queried for its capacity.
99 Modern disks use a larger sector size internally,
100 referred to as block size by the
102 utility and this can be specified by the
107 utility will use the (physical) block size to determine the start of
108 partitions and to round the size of the disk image.
112 option can be used to specify a minimal capacity for the disk image.
113 Use this option without the
117 options to create an empty disk image with the given (virtual) size.
118 An empty partition table can be written to the disk when specifying a
119 partitioning scheme with the
121 option, but without specifying any partitions.
122 When the size required to for all the partitions is larger than the
123 given capacity, then the disk image will be larger than the capacity
128 option increases the level of output that the
134 option is used for testing purposes only and is not to be used in production.
137 utility will generate predictable values for Universally Unique Identifiers
138 (UUIDs) and time stamps so that consecutive runs of the
140 utility will create images that are identical.
142 A set of long options exist to query about the
145 Options in this set should be given by themselves because the
147 utility exits immediately after providing the requested information.
150 utility is printed when the
153 The list of supported output formats is printed when the
155 option is given and the list of supported partitioning schemes is printed
159 Both the format and scheme lists a space-separated lists for easy handling
162 For a more descriptive list of supported partitioning schemes or supported
163 output format, or for a detailed description of how to specify partitions,
166 utility without any arguments.
167 This will print a usage message with all the necessary details.
169 .Bl -tag -width "TMPDIR" -compact
171 Directory to put temporary files in; default is
175 To create a bootable disk image that is partitioned using the GPT scheme and
176 containing a root file system that was previously created using
178 and also containing a swap partition, run the
181 .Dl % mkimg -s gpt -b /boot/pmbr -p freebsd-boot:=/boot/gptboot \
182 -p freebsd-ufs:=root-file-system.ufs -p freebsd-swap::1G \
185 The command line given above results in a raw image file.
186 This is because no output format was given.
187 To create a VMDK image for example, add the
191 utility and name the output file accordingly.
193 A nested partitioning scheme is created by running the
196 The output of the first will be fed as the contents of a partition to the
198 This can be done using a temporary file, like so:
199 .Dl % mkimg -s bsd -b /boot/boot -p freebsd-ufs:=root-file-system.ufs \
200 -p freebsd-swap::1G -o /tmp/bsd.img
201 .Dl % mkimg -s mbr -b /boot/mbr -p freebsd:=/tmp/bsd.img -o mbr-bsd.img
205 utility can be run in a cascaded fashion, whereby the output of the
206 first is fed directly into the second.
210 .Dl % mkimg -s mbr -b /boot/mbr -p freebsd:-'mkimg -s bsd -b /boot/boot \
211 -p freebsd-ufs:=root-file-system.ufs -p freebsd-swap::1G' -o mbr-bsd.img
213 To accomodate the need to have partitions named or numbered in a certain
216 utility allows for the specification of empty partitions.
217 For example, to create an image that is compatible with partition layouts
220 the 'd' partition often needs to be skipped.
221 This is accomplished by inserting an unused partition after the first 2
222 partition specifications.
223 It is worth noting at this time that the BSD scheme will automatically
224 skip the 'c' partition by virtue of it referring to the entire disk.
225 To create an image that is compatible with the qp120at disk, use the
228 .Dl % mkimg -s bsd -b /boot/boot -p freebsd-ufs:=root-file-system.ufs \
229 -p freebsd-swap::20M -p- -p- -p- -p- -p freebsd-ufs:=usr-file-system.ufs \
232 For partitioning schemes that feature partition labels, the
234 utility supports assigning labels to the partitions specified.
235 In the following example the file system partition is labeled as 'backup':
236 .Dl % mkimg -s gpt -p freebsd-ufs/backup:=file-system.ufs -o gpt.img
245 utility first appeared in
250 utility and manpage were written by Marcel Moolenaar <marcelm@juniper.net>