Home / Alt manpages / bcache-super-show(8)

  • bcache-super-show(8)
  • Admin command
  • linux

Inspect a bcache Superblock Safely with bcache-super-show

When a bcache device starts behaving oddly, bcache-super-show reads its superblock without attaching, formatting or touching cached data. You will confirm which package supplied the command, inspect the superblock on a block device, and handle an invalid CRC without mistaking damaged metadata for a healthy cache. Allow about ten minutes if you already know the device path.

  • The workflow is read-only, but choosing the wrong device can still lead to a serious diagnostic mistake, so identify the target before running the command.
  • Version used here: bcache-super-show from Ubuntu's bcache-tools package, 1.0.8-5build1.
  • Documented options: the installed manual page lists one only, -f, which tells the program to continue when the superblock CRC is invalid.

1. Check the installed command

$ command -v bcache-super-show
/usr/sbin/bcache-super-show
$ dpkg-query -W -f='${Package} ${Version}\n' bcache-tools
bcache-tools 1.0.8-5build1
$ bcache-super-show --help
bcache-super-show: invalid option -- '-'
Usage: bcache-super-show [-f] <device>

These are ordinary, unprivileged checks: they do not inspect or modify a device. The last result is expected for this installed version. The command has no long-form help option; its usage text is printed after the invalid-option diagnostic. Use the manual page for the documented interface rather than adding guessed options to a script.

Checkpoint

You should have a real executable path and a package version. If the command is missing, stop here and use your normal package-management process. Do not copy a binary from another host simply to inspect storage.

2. Identify the exact device

$ lsblk -o NAME,TYPE,SIZE,FSTYPE,MOUNTPOINTS
NAME    TYPE  SIZE FSTYPE MOUNTPOINTS
nvme0n1 disk  1.8T
└─nvme0n1p1 part 1.8T bcache
  /srv/data
  • The operand is a device, not a bcache UUID, a mount-point directory or an arbitrary label.
  • Your output will differ. Treat this as an example of the information to compare, not as output to reproduce.
  • Pick the right member. Use the path that represents the bcache member you intend to inspect, such as /dev/nvme0n1p1. If you cannot distinguish a backing device from its cache device, stop and check your storage design first.

Reading device metadata may need elevated privileges on your system. Try the inspection as your normal account first, and if access is denied, use the smallest privilege boundary available:

$ test -r /dev/EXAMPLE_DEVICE && echo readable
readable
$ sudo bcache-super-show /dev/EXAMPLE_DEVICE

Replace /dev/EXAMPLE_DEVICE with an actual path. The sudo command is the only elevated example here, and it is conditional on a permissions failure. Do not use sudo to compensate for uncertainty about which disk you selected.

3. Print the superblock normally

$ bcache-super-show /dev/EXAMPLE_DEVICE

For a readable, valid bcache superblock, the program prints its metadata to standard output and exits. The exact fields and values belong to the device, so record the complete output if you are comparing machines or preparing a support report. The command's purpose is to print the superblock; it is not a cache-creation or cache-attachment command.

Capture the output without losing the terminal status:

$ bcache-super-show /dev/EXAMPLE_DEVICE | tee /tmp/bcache-super-show.txt
$ status=${PIPESTATUS[0]}
$ printf 'bcache-super-show exit status: %s\n' "$status"
bcache-super-show exit status: 0

Checkpoint

Status 0 means this invocation completed successfully. It does not mean the cache is mounted, attached, healthy under load or suitable for a repair; those are separate operational questions. Keep the captured file private if its metadata reveals storage identifiers that should not be shared.

4. Treat a CRC failure as a warning

If the normal command reports the superblock CRC is invalid, do not immediately force it to continue and then treat every displayed value as trustworthy. A CRC failure says the integrity check did not pass. Preserve the original device and capture the diagnostic before doing anything else.

The manual documents -f for this narrow case:

$ bcache-super-show -f /dev/EXAMPLE_DEVICE

This asks the installed program to keep going despite the invalid CRC. It does not repair the superblock, recalculate the CRC, attach the cache or make the device safe. Label any output from this run as metadata read from a superblock whose integrity check failed, compare it with independent records, and do not use it alone to make a recovery or reinitialisation decision.

Safety warning

Do not follow a CRC warning with a guessed formatting, discard, wipe or recreate command. Those actions can destroy the remaining metadata or cached data and are outside this inspection workflow. If the device matters, make a recovery plan and obtain a verified backup or image before any write operation.

5. Diagnose the common distractions

  • No device given is incomplete and prints the usage line.
  • A misspelled option is not evidence of corruption. In particular, --help is not a documented option for the installed command; use the manual instead:
    $ man 8 bcache-super-show
  • Cannot open the target? Check the path and permissions without changing storage:
    $ ls -l /dev/EXAMPLE_DEVICE
    $ readlink -f /dev/EXAMPLE_DEVICE
    $ id
    

Confirm the resolved path is still the intended device before retrying with sudo. If output is absent or incomplete, preserve the exit status and terminal error. Do not infer that a blank result means an empty or safe device, and do not try random partitions until one produces recognisable output.

Done means

  • Command confirmed: executable and installed bcache-tools version checked.
  • Device matched: the chosen path checked against lsblk before reading it.
  • Superblock printed: normal command run and, where useful, output captured.
  • -f used sparingly: only after an explicit CRC failure, and that output labelled unverified.
  • No changes made: no cache, filesystem, partition or device changes.