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 a disk image"
44 .Op Fl p Ar partition ...
48 utility creates a disk image from the raw partition contents specified with
51 argument(s) and using the partitioning scheme specified with the
54 The disk image is written to
56 by default or the file specified with the
60 The disk image can be made bootable by specifying the scheme-specific boot
61 block contents with the
64 depending on the scheme,
65 with a boot partition.
66 The contents of such a boot partition is provided like any other partition
69 utility does not treat it any differently from other partitions.
71 Some partitioning schemes need a disk geometry and for those the
77 arguments, specifying the number of sectors per track and the number of
78 heads per cylinder (resp.)
80 Both the logical and physical sector size can be specified and for that the
90 argument is used to specify the logical sector size.
91 This is the sector size reported by a disk when queried for its capacity.
92 Modern disks use a larger sector size internally,
93 referred to as block size by the
95 utility and this can be specified by the
100 utility will use the (physical) block size to determine the start of
101 partitions and to round the size of the disk image.
105 option increases the level of output that the
109 For a complete list of supported partitioning schemes or for a detailed
110 description of how to specify partitions, run the
112 utility without any arguments.
114 To create a bootable disk image that is partitioned using the GPT scheme and
115 containing a root file system that was previously created using
117 and also containing a swap partition, run the
120 .Dl % mkimg -s gpt -b /boot/pmbr -p freebsd-boot:=/boot/gptboot \
121 -p freebsd-ufs:=root-file-system.ufs -p freebsd-swap::1G \
124 A nested partitioning scheme is created by running the
127 The output of the first will be fed as the contents of a partition to the
129 This can be done using a temporary file, like so:
130 .Dl % mkimg -s bsd -b /boot/boot -p freebsd-ufs:=root-file-system.ufs \
131 -p freebsd-swap::1G -o /tmp/bsd.img
132 .Dl % mkimg -s mbr -b /boot/mbr -p freebsd:=/tmp/bsd.img -o mbr-bsd.img
136 utility can be run in a cascaded fashion, whereby the output of the
137 first is fed directly into the second.
141 .Dl % mkimg -s mbr -b /boot/mbr -p freebsd:-'mkimg -s bsd -b /boot/boot \
142 -p freebsd-ufs:=root-file-system.ufs -p freebsd-swap::1G' -o mbr-bsd.img
144 For partitioning schemes that feature partition labels, the
146 utility supports assigning labels to the partitions specified.
147 In the following example the file system partition is labeled as 'backup':
148 .Dl % mkimg -s gpt -p freebsd-ufs/backup:=file-system.ufs -o gpt.img
162 utility and manpage were written by Marcel Moolenaar <marcelm@juniper.net>