Skip to content

Leaked Kernel Devices

When a daemon dies, it leaves its ublk device quiesced in the kernel so the next start can recover it. Usually that is exactly what you want. Sometimes it is not:

  • You want different geometry or write durability than the leftover device was created with.
  • The device belongs to a volume that no longer exists.

In those cases the leftover device makes start refuse, and the refusal says why (for example, a leftover device with different geometry, exit code 9).

reap removes a ublk device by id. It touches only the kernel’s registration of the device: nothing on the cache device or in the bucket. Ids are bare numbers, so reap 0 acts on /dev/ublkb0.

Terminal window
ls /dev/ublkb*
sudo flexblock reap 0

Then run start again.

If the point is only to change geometry or write durability for the same volume, start --replace-ublk does the same job in one step. Either way, the in-flight requests the kernel was holding are not reissued.

FlagMeaning
--allow-liveReap a device a daemon is still serving. Prompts unless -y is given.
--dry-runPrint what would be reaped and exit.
-y, --yesSkip the confirmation prompt.

reap refuses a device a daemon is serving (exit code 12). --allow-live overrides that and prompts, but it pulls the block device out from under its users.