Skip to content

Cannot close after partprobe (Device or resource busy)

**Error: **

# cryptsetup luksClose test
device-mapper: remove ioctl on test failed: Device or resource busy
...
Device test is still in use.

(... -> first line of output repeated 25 times)

Steps to re-produce: reproduce-cryptsetup-partprobe-busy.sh or https://pastebin.com/raw/hCL5FGjm

Attempted solution (for above example):

# delpart /dev/mapper/test 1
delpart /dev/mapper/test 1 delpart: failed to remove partition: No such device or address

**Working solution (for above example): **

# dmsetup remove test1
# cryptsetup luksClose test

Version information:

# uname -a
Linux Celmor-PC 4.8.14-1-MANJARO #1 SMP PREEMPT Sat Dec 10 23:58:26 UTC 2016 x86_64 GNU/Linux
# cryptsetup --version
cryptsetup 1.7.3
# dmsetup --version
Library version:   1.02.137 (2016-11-30)
Driver version:    4.35.0
# pacman -Q cryptsetup device-mapper libgcrypt
cryptsetup 1.7.3-1
device-mapper 2.02.168-1
libgcrypt 1.7.3-1