Home / Alt manpages / cryptsetup-bitlkdump(8)

  • cryptsetup-bitlkdump(8)
  • Admin command
  • linux

Inspect a BitLocker Device Safely with cryptsetup bitlkDump

You will finish with a read-only inspection of a BitLocker-compatible device using cryptsetup bitlkDump. The normal command prints BITLK header information; it does not open the volume or change its on-disk data. Allow about ten minutes, plus time to identify the correct device. You need the cryptsetup-bin package and a readable block device or image.

1. Confirm the installed command and version

This guide follows cryptsetup 2.7.0, installed here from cryptsetup-bin version 2:2.7.0-1ubuntu4.2. Options and diagnostic wording can differ in another release, so check the binary on the machine that will perform the inspection:

$ command -v cryptsetup
/usr/sbin/cryptsetup
$ cryptsetup --version
cryptsetup 2.7.0 flags: UDEV BLKID KEYRING FIPS KERNEL_CAPI HW_OPAL
$ dpkg-query -W -f='${Package} ${Version}\n' cryptsetup-bin
cryptsetup-bin 2:2.7.0-1ubuntu4.2

The exact feature flags and package revision are host-specific. The useful check is that the command exists and reports the release you intend to use.

2. Check the option shape without touching a device

Ask for the short help text first. This is an ordinary, read-only command and normally needs no elevated privileges:

$ cryptsetup bitlkDump --help

The installed program uses this action form:

cryptsetup bitlkDump [options] <device>

For a non-destructive argument check, cryptsetup also accepts --test-args. It validates the command line and deliberately does not run the action:

$ cryptsetup --test-args bitlkDump /dev/example
No action taken. Invoked with --test-args option.

Checkpoint: replace /dev/example only after you have identified the real source device. The placeholder is intentionally not a path to copy into an inspection command.

3. Identify the correct device

Use your normal inventory process to map the BitLocker volume to a stable path. On a machine with lsblk, this read-only listing is a useful starting point:

$ lsblk -o NAME,PATH,SIZE,TYPE,FSTYPE,LABEL,UUID

Do not rely on a changing name such as /dev/sdb1 if the device can be reattached in a different order. Confirm the size, partition role, label or UUID against your records. If the device is a disk image, use its explicit image path instead of guessing a loop-device name.

Reading a block device can fail for an ordinary account even though the device is present. Start without sudo. If the error is an access denial, ask an administrator to grant the required read access or rerun the same command with the minimum privilege needed:

$ sudo cryptsetup bitlkDump /dev/REPLACE_WITH_CONFIRMED_DEVICE

Elevated privileges are not a fix for a wrong path. Check the device identity before using them.

4. Dump the BITLK header

Run the action against the confirmed device:

$ cryptsetup bitlkDump /dev/REPLACE_WITH_CONFIRMED_DEVICE

The command is intended to print header information for a BITLK, which is cryptsetup's name for a BitLocker-compatible device. The fields and their values belong to the device, so do not copy an example header into a report as if it were universal. A successful run should return to the shell without an error. Capture the output if you need to compare the header with recovery records, but handle it as potentially sensitive storage metadata.

Checkpoint: record the command's exit status immediately, before running another command:

$ status=$?
$ printf 'bitlkDump exit status: %s\n' "$status"
bitlkDump exit status: 0

Status 0 means the command completed successfully. It does not prove that the device can be unlocked, that its data is intact, or that you have a usable BitLocker recovery credential.

5. Keep passphrases and keys out of the terminal history

The basic header dump does not require you to put a passphrase on the command line. If cryptsetup asks for one in a workflow that needs authenticated access, enter it at the prompt rather than appending it as an argument. Command-line arguments can be exposed through shell history or process inspection.

For a key stored in a file, the documented option is --key-file (short form -d). The special name - reads the passphrase from standard input, but reading does not stop at newline characters. If you use a file, check its ownership and permissions first, and limit the read with --keyfile-size when trailing data must be excluded:

$ cryptsetup bitlkDump --key-file /path/to/REPLACE_WITH_PROTECTED_KEYFILE \
    --keyfile-size REPLACE_WITH_BYTE_COUNT \
    /dev/REPLACE_WITH_CONFIRMED_DEVICE

Do not put a real secret in the placeholder or in a shared transcript. The default maximum key-file size on this installation is 8192 kB; cryptsetup --help reports the compiled-in limit for the current build.

6. Treat volume-key options as an emergency boundary

Do not add --dump-volume-key to a routine header inspection. It prints the device volume key in the displayed information, and that key can bypass the passphrase. Anyone who obtains it may be able to decrypt the container without the original passphrase. The manpage warns that a compromised volume key requires erasing the whole device to prevent further access.

If a controlled recovery procedure genuinely requires the key, prefer --volume-key-file so it is written to a protected file rather than standard output:

$ cryptsetup bitlkDump --dump-volume-key \
    --volume-key-file /path/to/REPLACE_WITH_RESTRICTED_OUTPUT \
    --key-file /path/to/REPLACE_WITH_PROTECTED_KEYFILE \
    /dev/REPLACE_WITH_CONFIRMED_DEVICE

This creates or replaces the named output file. Stop and check your recovery policy before running it. If the file is no longer required, remove it using that policy and verify that no backup, shell transcript or diagnostic log retained a copy. There is no safe undo for disclosure of a volume key; deleting one copy does not recall copies already read.

7. Diagnose a failed inspection

A message that the device cannot be opened can mean a wrong path, insufficient read permission, an unsupported format or damaged metadata. Check the path without changing anything:

$ ls -l /dev/REPLACE_WITH_CONFIRMED_DEVICE
$ test -r /dev/REPLACE_WITH_CONFIRMED_DEVICE && echo readable
$ cryptsetup bitlkDump --debug /dev/REPLACE_WITH_CONFIRMED_DEVICE

Debug output can contain device details. Store it only where access is appropriate. The manpage recommends adding --debug when reporting a failure, but review the output before sending it outside the system. If a passphrase is requested and you are not certain that the device is the intended one, cancel rather than experimenting with credentials.

--timeout controls how long cryptsetup waits for an interactive passphrase prompt. Its default is zero, meaning wait forever; it has no effect when --key-file is used. A bounded prompt can prevent a maintenance shell from hanging:

$ cryptsetup bitlkDump --timeout 30 /dev/REPLACE_WITH_CONFIRMED_DEVICE

Use this only when a prompt is expected. It does not make an inaccessible or invalid device work.

Done means

  • cryptsetup and the installed cryptsetup-bin version were confirmed.
  • The real device was identified by more than an assumed device name.
  • bitlkDump completed without modifying the device.
  • The exit status was checked separately from the header text.
  • Passphrases stayed out of command arguments, history and shared logs.
  • --dump-volume-key was not used unless a documented recovery process accepted the disclosure risk.