Skip to contentSkip to conversation

Cancel of "btrfs dev delete" not working

DISCUSSION Roman Mamedov 1 participant 1 message Jan 5 Btrfs file system

lore
Share & tools
lore
#0 lore raw

Hello,

# btrfs dev delete --help
usage: btrfs device delete <device>|<devid> [<device>|<devid>...] <path>

Remove a device from a filesystem (alias of "btrfs device remove")

Remove a device from a filesystem, specified by a path to the device or as a device id in the filesystem. The btrfs signature is removed from the device.
If 'missing' is specified for <device>, the first device that is described by the filesystem metadata, but not present at the mount time will be removed. (only in degraded mode)
If 'cancel' is specified as the only device to delete, request cancellation of a previously started device deletion and wait until kernel finishes any pending work. This will not delete the device and the size will be restored to previous state. When deletion is not running, this will fail.

--enqueue wait if there's another exclusive operation
running, otherwise continue

# btrfs dev delete cancel /mnt/dir/
Request to cancel running device deletion
ERROR: error removing device 'cancel': Operation canceled

The ongoing deletion is not cancelled and carries on.

# btrfs --version
btrfs-progs v6.14
-EXPERIMENTAL -INJECT -STATIC +LZO +ZSTD +UDEV +FSVERITY +ZONED CRYPTO=builtin
Signature · 2 lines
With respect,
Roman