BLKDEACTIVATE(8)

๐Ÿ’… BLKDEACTIVATE ๐Ÿ’…

okay so bestie, this is a page from the System Manager's Manual โ€” it's the blkdeactivate manual, section 8. she's a little utility but she's literally the cleanup crew of your block device world, no cap. let's get into it โœจ


๐ŸŒธ NAME ๐ŸŒธ

blkdeactivate โ€” the utility that deactivates block devices. yes she's that girl, and yes she says bye to your devices so they don't linger like an unread group chat ๐Ÿ’€


๐ŸŽ€ SYNOPSIS ๐ŸŽ€

blkdeactivate [-d|--dmoptions dm_options] [-e|--errors] [-h|--help]
              [-l|--lvmoptions lvm_options]
              [-r|--mdraidoptions mdraid_options]
              [-m|--mpathoptions mpath_options] [-u|--umount]
              [-o|--vdooptions vdo_options] [-v|--verbose] [device]

like, that's the whole vibe. one utility, a bunch of optional flags, and optionally one [device] to target ๐Ÿ‘‘


๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

so the blkdeactivate utility deactivates block devices. periodt.

for mounted block devices, she attempts to unmount them automatically before she tries to deactivate them โ€” she's polite like that, she doesn't just yank the cord ๐Ÿซถ

here's who she currently supports:

  • device-mapper devices (DM), including LVM volumes ๐Ÿ’œ
  • software RAID MD devices ๐ŸŒˆ

and here's the backstage crew handling the actual drama:

  • LVM volumes are handled directly using the lvm(8) command
  • the rest of device-mapper based devices are handled using the dmsetup(8) command
  • MD devices are handled using the mdadm(8) command

iykyk. she's basically the manager directing the talent โœจ


โœจ OPTIONS โœจ

  • -d|--dmoptions dm_options โ€” a comma separated list of device-mapper specific options. the accepted dmsetup(8) options are:
    • retry โ€” retry removal several times in case of failure. she's persistent fr fr ๐Ÿ’ช
    • force โ€” force device removal. no more negotiating ๐Ÿ˜ค
  • -e|--errors โ€” show errors reported from tools called by blkdeactivate. without this option, any error messages from these external tools are suppressed and blkdeactivate itself provides only a summary message to indicate the device was skipped. so like, silent treatment mode is the default ๐Ÿ™ˆ
  • -h|--help โ€” display the help text. classic.
  • -l|--lvmoptions lvm_options โ€” comma-separated list of LVM specific options:
    • retry โ€” retry removal several times in case of failure.
    • wholevg โ€” deactivate the whole LVM Volume Group when processing a Logical Volume. deactivating the Volume Group as a whole is quicker than deactivating each Logical Volume separately. efficiency queen ๐Ÿ‘‘
  • -r|--mdraidoptions mdraid_options โ€” comma-separated list of MD RAID specific options:
    • wait โ€” wait for MD device's resync, recovery or reshape action to complete before deactivation. sit still and let her cook ๐Ÿ“
  • -m|--mpathoptions mpath_options โ€” comma-separated list of device-mapper multipath specific options:
    • disablequeueing โ€” disable queueing on all multipath devices before deactivation. this avoids a situation where blkdeactivate may end up waiting if all the paths are unavailable for any underlying device-mapper multipath device. lowkey a lifesaver ๐Ÿงš
  • -u|--umount โ€” unmount a mounted device before trying to deactivate it. without this option, a device that is mounted is not deactivated. so if you want the unmount energy, you gotta ask for it ๐Ÿ’…
  • -o|--vdooptions vdo_options โ€” comma-separated list of VDO specific options:
    • configfile=file โ€” use specified VDO configuration file. bring your own config, main character move ๐Ÿ“
  • -v|--verbose โ€” run in verbose mode. use -vv for even more verbose mode. she will tell you everything ๐ŸŒŸ

๐ŸŒˆ EXAMPLES ๐ŸŒˆ

deactivate all supported block devices found in the system, skipping mounted devices.

blkdeactivate

deactivate all supported block devices found in the system, unmounting any mounted devices first, if possible.

blkdeactivate -u

deactivate the device /dev/vg/lvol0 together with all its holders, unmounting any mounted devices first, if possible.

blkdeactivate -u /dev/vg/lvol0

deactivate all supported block devices found in the system. if the deactivation of a device-mapper device fails, retry it. deactivate the whole Volume Group at once when processing an LVM Logical Volume.

blkdeactivate -u -d retry -l wholevg

deactivate all supported block devices found in the system. if the deactivation of a device-mapper device fails, retry it and force removal.

blkdeactivate -d force,retry

๐Ÿ’– SEE ALSO ๐Ÿ’–

lvm(8),

dmsetup(8),

lsblk(8), mdadm(8), multipathd(8), vdo(8), umount(8)


bestie reminder: this page is brought to you by Red Hat, Inc. โ€” LVM TOOLS 2.03.44(2) dated 2026-10-27. she's been around, she's iconic, and she's got the receipts ๐Ÿ’œโœจ slay, go deactivate responsibly ๐ŸŽ€
๐Ÿ“ฆ where this page comes from