У меня есть установка Ubuntu, которая не может закрыть устройство LUKS после размонтирования.
ядро: 5.3.0-42-общий
cryptsetup: 2.2.0
root@pc:~# cryptsetup --debug close sdbackup
# cryptsetup 2.2.0 processing "cryptsetup --debug close sdbackup"
# Running command close.
# Locking memory.
# Installing SIGINT/SIGTERM handler.
# Unblocking interruption on signal.
# Allocating crypt device context by device sdbackup.
# Initialising device-mapper backend library.
# dm version [ opencount flush ] [16384] (*1)
# dm versions [ opencount flush ] [16384] (*1)
# Detected dm-ioctl version 4.40.0.
# Detected dm-crypt version 1.19.0.
# Device-mapper backend running with UDEV support enabled.
# dm status sdbackup [ opencount noflush ] [16384] (*1)
# Releasing device-mapper backend.
# Allocating context for crypt device (none).
# Initialising device-mapper backend library.
Underlying device for crypt device sdbackup disappeared.
# Deactivating volume sdbackup.
# dm versions [ opencount flush ] [16384] (*1)
# dm status sdbackup [ opencount noflush ] [16384] (*1)
# dm versions [ opencount flush ] [16384] (*1)
# dm table sdbackup [ opencount flush securedata ] [16384] (*1)
Device sdbackup is still in use.
# Releasing crypt device (null) context.
# Releasing device-mapper backend.
# Unlocking memory.
Command failed with code -5 (device already exists or device is busy)
Поиск в Google дал следующие решения, но все они терпят неудачу
kpartx -d /dev/mapper/sdbackup
partprobe
dmsetup ls
nvme0n1p3_crypt (253:0)
sdbackup (253:2)
another_disk (253:1)
sudo lsof |grep 253,2 # produces no results, so nothing to kill
Вывод при монтировании больше не содержит раздела ...
Как я могу безопасно удалить зашифрованное устройство?