BMAPTOOL(1)
π NAME
okay so bestie, welcome to bmaptool β the tool that creates a block map (bmap) for a file, or copies a file using one. two whole moods, one icon π
β¨ SYNOPSIS
bmaptool [--help] [--version] [--quiet] [--debug] <command> [<options>] <args>
π¦ DESCRIPTION
ngl, bmaptool is a generic tool for two things: creating the block map (bmap) for a file, and copying files using that block map. the whole β¨ideaβ¨ is that big files β think raw system image files β can be copied or flashed so much faster with bmaptool than with the old-school tools like dd or cp. it's giving glow-up, honestly π«Ά
bmaptool supports 2 commands:
copyβ copy a file to another file using bmap, or flash an image to a block devicecreateβ create a bmap for a file
please, find full documentation for the project online. (iykyk π)
πΈ OPTIONS
--versionβ print thebmaptoolversion and dip. bye! π-h,--helpβ print a short help text and exit.-q,--quietβ be quiet, do not print extra information. shhh π€«-d,--debugβ print debugging messages. for when you need to know everything π
π COMMANDS
π copy [options] IMAGE DEST
copy file IMAGE to the destination regular file or block device DEST using bmap. IMAGE may either be a local path or an URL. DEST may either be a regular file or a block device (only local). two different vibes, both valid β¨
unless the bmap file is explicitly specified with the --bmap option, bmaptool automatically discovers it by looking for a file with the same basename as IMAGE but with the .bmap extension. the bmap file is only looked for in IMAGE's directory (or base URL, in case IMAGE was specified as an URL). if the bmap file is not found, bmaptool fails. to copy without bmap, use the --nobmap option. periodt.
both IMAGE and the bmap file may be specified as an URL (http://, ftp://, https://, file://, ssh://). in order to make bmaptool use a proxy server, please, specify the proxy using the standard $http_proxy, $https_proxy, $ftp_proxy or $no_proxy environment variables. proxy slay π
if the server requires authentication, user name and password may be specified in the URL, for example https://user:password@my.server.org/image.raw.bz2, or ssh://user:password@host:path/to/image.raw. π
IMAGE may be compressed, in which case bmaptool decompresses it on-the-fly. the compression type is detected by the file extension and the following extensions are supported:
.gz,.gzip,.tar.gzand.tgzfor files and tar archives compressed withgzipprogram.bz2,tar.bz2,.tbz2,.tbz, and.tb2for files and tar archives compressed withbzip2program.xz,.tar.xz,.txzfor files and tar archives compressed withxzprogram.lzo,tar.lzo,.tzofor files and tar archives compressed withlzoprogram.lz4,tar.lz4,.tlz4for files and tar archives compressed withlz4program.zst,tar.zst,.tzstfor files and tar archives compressed withzstdprogram
IMAGE files with other extensions are assumed to be uncompressed. note, bmaptool uses pbzip2 and pigz programs for decompressing bzip2 and gzip archives faster, unless they are not available, in which case it falls-back to using bzip2 and gzip. furthermore, uncompressed IMAGE files can be piped to the standard input using -. π
if DEST is a block device node (e.g., /dev/sdg), bmaptool opens it in exclusive mode. this means that it will fail if any other process has IMAGE block device node opened. this also means that no other processes will be able to open IMAGE until bmaptool finishes the copying. please, see semantics of the O_EXCL flag of the open() syscall. it's giving main character energy, nobody else gets in π₯
the bmap file typically contains SHA-256 checksum for itself as well as SHA-256 checksum for all the mapped data regions, which makes it possible to guarantee data integrity. bmaptool verifies the checksums and exits with an error in case of a mismatch. checksum verification can be disabled using the --no-verify option. bmaptool does not verify that unmapped areas contain only zeroes, because these areas are anyway dropped and are not used for anything. π«Ά
the bmap file may be signed with OpenPGP (gpg). the signature may be either detached (a separate file) or "built into" the bmap file (so called "clearsign" signature).
the detached signature can be specified with the --bmap-sig option, otherwise bmaptool tries to automatically discover it by looking for a file with the same basename as the bmap file but with the .asc or .sig extension. this is very similar to the bmap file auto-discovery. so if a .asc or .sig file exists, bmaptool will verify the signature. β¨
the clearsign signature is part of the bmap file and bmaptool automatically detected and verifies it.
if the signature is bad, bmaptool exits with an error. bmap file signature verification can be disabled using the --no-sig-verify option.
π OPTIONS
-h,--helpβ print short help text about thecopycommand and exit.--bmap BMAPβ use bmap fileBMAPfor copying. if this option is not specified,bmaptooltries to automatically discover the bmap file.--bmap-sig SIGβ use a detached OpenPGP signature fileSIGfor verifying the bmap file integrity and publisher. if this option is not specified,bmaptooltries to automatically discover the signature file.--nobmapβ disable automatic bmap file discovery and force flashing the entireIMAGEwithout bmap.--no-sig-verifyβ do not verify the OpenPGP bmap file signature (not recommended). π--no-verifyβ do not verify data checksums when copying (not recommended). the checksums are stored in the bmap file, and normallybmaptoolverifies that the data inIMAGEmatches the checksums.--psplash-pipe PATHβ write periodic machine-readable progress reports to a fifo in the format used by psplash. each progress report consists ofPROGRESSfollowed by a space, an integer percentage and a newline. π
π« EXAMPLES
bmaptool copy image.raw.bz2 /dev/sdg
copy bz2-compressed local file image.raw.bz2 to block device /dev/sdg. the image file is uncompressed on-the-fly. the bmap file is discovered automatically. the OpenPGP signature is detected/discovered automatically too. literally one line, so iconic π
bmaptool copy http://my-server.com/files/image.raw.bz2 $HOME/tmp/file
copy bz2-compressed remote image.raw.bz2 to regular file $HOME/tmp/file. the image file is uncompressed on-the-fly. the bmap file is discovered automatically. the OpenPGP signature is detected/discovered automatically too. π
bmaptool copy --bmap image.bmap --bmap-sig image.bmap.asc image.raw /dev/sdg
copy non-compressed local file image.raw to block device /dev/sdg using bmap file image.bmap. verify the bmap file signature using a detached OpenPGP signature from imag.bmap.asc. π¦
cat image.raw | bmaptool copy --bmap image.bmap - /dev/sdg
copy non-compressed image from standard input to block device /dev/sdg using bmap file image.bmap. pipe girlie vibes π
β create [options] IMAGE
generate bmap for a regular file IMAGE. internally, this command uses the Linux FIEMAP ioctl to find out which IMAGE blocks are mapped. however, if FIEMAP is not supported, the SEEK_HOLE feature of the lseek system call is used instead. by default, the resulting bmap file is printed to stdout, unless the --output option is used. π
the IMAGE file is always synchronized before the block map is generated. and it is important to make sure that the IMAGE file is not modified when the bmap file is being generated, and after the bmap file has been generated. otherwise the bmap file becomes invalid and checksum verification will fail. π
the image file can further be signed using OpenPGP.
πΈ OPTIONS
-h,--helpβ print short help text about thecreatecommand and exit.-o,--output OUTPUTβ save the generated bmap in theOUTPUTfile (by default the bmap is printed to stdout).--no-checksumβ generate a bmap file without SHA1 checksums (not recommended). π
π§ EXAMPLES
bmaptool create image.raw
generate bmap for the image.raw file and print it to stdout.
bmaptool create -o image.bmap image.raw
generate bmap for the image.raw file and save it in image.bmap. ate and left no crumbs β¨
π AUTHOR
Artem Bityutskiy <artem.bityutskiy@linux.intel.com>. π«Ά
π REPORTING BUGS
please, report bugs to Artem Bityutskiy <artem.bityutskiy@linux.intel.com> or to the bmap-tools mailing list <bmap-tools@lists.infradead.org>. he'll fix it, fr fr π
and that's the whole page bestie β this one's from bmap-tools 3.2, dated February 2014, so it's vintage but still hits. mwah ππΈ
π¦ where this page comes from
- opensuse-leap 16.0: python313-bmap-tools 3.7-bp160.1.11 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms