LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

bmaptool

Flash disk images efficiently using block maps

TLDR

Copy an image to a device using bmap
$ sudo bmaptool copy [image.img] [/dev/sdX]
copy
Copy a compressed image
$ sudo bmaptool copy [image.img.xz] [/dev/sdX]
copy
Copy with explicit bmap file
$ sudo bmaptool copy --bmap [image.bmap] [image.img] [/dev/sdX]
copy
Copy without bmap (falls back to dd-like behavior)
$ sudo bmaptool copy --nobmap [image.img] [/dev/sdX]
copy
Create a bmap file for an image
$ bmaptool create -o [image.bmap] [image.img]
copy
Copy from a URL
$ sudo bmaptool copy [https://example.com/image.img.xz] [/dev/sdX]
copy

SYNOPSIS

bmaptool command [options] [arguments]

DESCRIPTION

bmaptool is a utility for creating block maps (bmap) and copying images to block devices efficiently. It only writes data blocks, skipping empty or zero-filled areas, making it significantly faster than dd for sparse images.The tool provides integrity verification using SHA256 checksums and includes safety features to prevent accidental writes to mounted devices. It supports compressed images and can decompress on-the-fly during copy operations.

PARAMETERS

--bmap file

Path to the bmap file (auto-detected if not specified)
--nobmap
Copy without using bmap (entire image is written)
-o, --output file
Output file for create command
--no-verify
Skip SHA256 checksum verification
--no-sig-verify
Skip OpenPGP signature verification

SUBCOMMANDS

copy

Copy an image file to a block device using bmap
create
Generate a bmap file for an image

INSTALL

nix profile install nixpkgs#bmaptool
copy

CAVEATS

Requires root privileges for writing to block devices. The bmap file must match the image file; mismatches cause verification failures. Protection mechanisms prevent writing to mounted devices. Without a bmap file, the tool falls back to copying the entire image like dd.

HISTORY

bmaptool was originally developed by Intel for efficient embedded Linux image deployment, addressing the slow and unsafe nature of using dd for flashing large disk images, particularly those with significant empty space. The project moved to the Yocto Project in 2024; the original Intel repository is now archived.

SEE ALSO

dd(1), pv(1), xzcat(1)

RESOURCES

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid