9.22. Using the bximage tool

Bximage is an easy to use console based tool for creating, converting and resizing disk images, particularly for use with Bochs. It also supports committing redolog files to their base images. It is completely interactive if no command line arguments are used. It can be switched to a non-interactive mode if all required parameters are given in the command line.

When you run bximage without one of the following options, it will appear in interactive mode and ask for all required parameters to manipulate an image.

Usage: bximage [options] [filename1] [filename2]

Supported options:
  -func=...     operation to perform (create, convert, resize, commit, info)
  -fd=...       create: floppy image with size code
  -hd=...       create/resize: hard disk image with size in megabytes (M)
                or gigabytes (G)
  -imgmode=...  create/convert: hard disk image mode
  -b            convert/resize: create a backup of the source image
                commit: create backups of the base image and redolog file
  -q            quiet mode (don't prompt for user input)
  --help        display this help and exit

Other arguments:
  filename1     create:  new image file
                convert/resize: source image file
                commit:  base image file
  filename2     convert/resize: destination image file
                commit:  redolog (journal) file

Table 9-6. Bximage: supported disk images modes (formats)

ModeCreate / Resize / Convert targetConvert source / Commit base
flatYesYes
concatCreate onlyConvert source only
dllNoConvert source only
sparseYesYes
vmware3NoYes
vmware4YesYes
growingYesYes
vpcYesYes
vboxNoYes

Disk image mode autodetection does not work for the modes concat and dll. To use those images as convert source, you have to add a prefix ("concat:" or "dll:") to the image path.

9.22.1. Create image

This function can be used to create several disk image formats for the use with Bochs. See the table above for supported formats (modes). For an example of the usage, refer to Section 9.2.

9.22.2. Convert image

With this function a disk image can be converted from one mode (format) to another. The type of the source image is auto-detected. For the target format it supports the same disk image modes as the create function. If the name of the new image file is not specified or identical to the source one and you have enabled the backup switch, a backup of the source file will be created with its original name plus the suffix ".orig".

9.22.3. Resize image

This function can be used to increase the virtual disk size of an image. It supports the same disk image modes as the create function. Making a disk image smaller is not supported, since it may damage the disk and data will be lost. If the name of the new image file is not specified or identical to the source one and you have enabled the backup switch, a backup of the source file will be created with its original name plus the suffix ".orig".

9.22.4. Commit 'undoable' redolog to base image

The type of the base image is auto-detected. The name of the redolog file only needs to be specified if it is not based on the base image. If you have enabled the backup switch, backups of the original base and redolog files will still be created with their original name plus the suffix ".orig".

9.22.5. Disk image info

This function can be used to determine the disk image format, geometry and size. Note that Bochs can only detect the formats growing, sparse, vmware3, vmware4, vpc and vbox correctly. Other images with a file size multiple of 512 are treated as flat ones. If the image doesn't support returning the geometry, the cylinders are calculated based on 16 heads and 63 sectors per track.