diskimage
Create an image for a partitioned medium, such as a hard drive, SD card, or MMC
Syntax:
diskimage -c configfile -o imgfile [-hMmpSvz]
[-b bootstrapfile] [-G number | -g] [-s number]
Runs on:
Linux, Microsoft Windows, QNX OS
Options:
- -b bootstrapfile
- Use the specified bootstrap file to write to the master boot record (MBR).
- -c configfile
- Use the specified configuration file.
- -G number
- Create a GPT disk image with number partitions. The minimum and default number of partitions is 128.
- -g
- Create a GUID partition table (GPT) disk image (by default, an MBR disk image is created).
- -h
- Display a help message showing diskimage usage information.
- -M
- Modify all Power-Safe filesystems, including non-bootable partitions.
- -m
- Don't modify Power-Safe (fs-qnx6.so) filesystems. The default is to patch all bootable Power-Safe filesystem partitions.
- -o imgfile
Write to the specified image file. The imgfile may also be a disk device.
On QNX OS systems, the disk-related configuration parameters (cylinders, head, sectors-per-track, sectors, sector size) are acquired directly from the device and need not be specified in the configuration file. On all other operating systems, you must specify the correct sector_size value. The values of heads, sectors_per_track, and cylinders must be specified to match the device's block count.
- -p
- (MBR disks only) Don't pad the image to the full disk size.
- -S
- Make sparse copies.
- -s number
- Read and write up to the specified number of bytes at a time. The default size is 65536.
- -v
- Increase the verbosity.
- -z
- Erase (zero-fill) unused disk image regions.
By default, diskimage will just seek() across unused regions of the output image file, to increase performance. If the output file already exists and has previously been written using a different configuration, then stale data may be retained in the image. This doesn't affect the functionality, but may be undesired. The -z option forces diskimage to actively zero-fill all unused regions in the output image.
Description:
The diskimage utility creates an image for a partitioned medium. The partitioned medium image can contain any number of filesystem images (for example, Power-Safe filesystems that were created using mkqnx6fsimg or mkqnx6fs). After an image is successfully created, it can be copied to a hard drive, SD card, MMC, USB stick, and so on. Options are available to adjust Power-Safe filesystems in the image so that they are bootable. With this command, you can also specify the IPL file to write into the master boot record (MBR).
You must use a configuration
file to specify the disk image content and layout. For details of the configuration
file contents, see diskimage configuration file.
Note that:
- Creating GPT images with diskimage may contravene the UEFI Specification because writing the image to more than one disk will result in duplicate GUIDs on disks and partitions.
- Creating a disk image in a new image file and creating a disk image over an existing disk image produce images that are functionally identical. However, when you examine the image created over an existing image, you will see the vestiges of the previous image; diskimage doesn't zero the image file before it creates the disk image.
License checking
The diskimage utility checks for a valid QNX license key before performing any operation. If the license check fails, the utility stops running and displays a diagnostic message. A license check may fail if the license key is expired, missing, or not currently activated, or if the key doesn’t contain the permissions needed to run the utility.
Examples:
Create an image:
diskimage –c mydisk.cfg –o mydisk.img
Create an image and specify a primary boot loader (IPL):
diskimage -c mydisk.cfg
-b target/qnx6/x86_64/boot/sys/ipl-diskpc1
-o mydiskipl.img
Create an image with a GUID partition table (GPT disk):
diskimage -g –c mydisk.cfg –o mydisk.img
Exit status:
- 0
- The command completed without errors.
- 1
- An error occurred while running the command. Possible errors include but aren't
limited to:
- the configuration file wasn't specified
- the configuration file couldn't be read
- there were syntax errors in the configuration file