LinuxCommandLibrary

imgtool

Sign firmware images

SYNOPSIS

imgtool command image [options]

PARAMETERS

create
    Create a new blank image file

format
    Format an existing image with filesystem

list
    List files and directories in image

cp
    Copy files between host and image (use : for root)

mkdir
    Create directory in image

rmdir
    Remove directory from image

rm
    Delete file from image

mv
    Move/rename file within image

info
    Display detailed image metadata

properties
    Show image properties and geometry

-f, --format <format>
    Specify image format (e.g., pc, a2, c64)

-t, --tracks <num>
    Set number of tracks (create/format)

-h, --heads <num>
    Set number of heads/sides

-s, --sectors <num>
    Sectors per track

-ss, --sector-size <size>
    Sector size in bytes

-v
    Verbose output (command-specific)

DESCRIPTION

Imgtool is a command-line tool from the MAME emulator project for creating, formatting, inspecting, and managing floppy disk and cartridge images in dozens of historical formats. It supports systems like IBM PC DOS, Apple DOS/ProDOS, Atari 8-bit/ST, Commodore 64/128, Amiga, Macintosh, ZX Spectrum, and more.

Acting like a cross-format filesystem client, imgtool enables operations such as listing directories (list), copying files to/from images (cp), creating directories (mkdir), deleting (rm, rmdir), and formatting without needing an emulator or loopback mount. It handles complex geometries (tracks, heads, sectors) transparently.

New images are created with specified size and format, e.g., 1.44MB PC floppy. Verification and property inspection ensure integrity. Essential for retro software archiving, MAME software lists, and emulator disk preparation.

Limited to read/write on floppy-like media; no native hard disk support. Compile from MAME source or use distro packages.

CAVEATS

Options vary by subcommand; use imgtool help <command>. Floppy/cart-only; build from MAME source or package. Formats must match image content.

SUPPORTED FORMATS

Use imgtool listformats for full list: pc, apple2_dos30, atari_dos, c64, amiga_adf, mac, sinclair, etc.
Custom formats via config files.

EXAMPLES

imgtool create -f pc -t 80 -h 2 -s 18 mydisk.img 1440 (1.44MB PC floppy)
imgtool format mydisk.img pc fat16
imgtool cp mydisk.img file.txt : (copy to root)
imgtool list -v mydisk.img

HISTORY

Developed by Nathan Woods starting 2003 as part of MAME tools for software list support. Expanded to 50+ formats by 2010s. Maintained in MAME repository; ports in some Linux distros via src/tools.

SEE ALSO

mcopy(1), mmount(1), mtools(1), qemu-img(1)

Copied to clipboard