Re: device-mapper: reload ioctl ... failed: No such file or directory

Milan Broz <[email protected]> Wed, 30 Oct 2024 08:10:43 +0100
Newsgroups dev.linux.lists.cryptsetup
Message-ID <[email protected]>
Hi,

On 10/30/24 5:12 AM, David J Iannucci wrote:
> Hello,
> 
> I'm using cryptsetup 2.7.5 on Gentoo to try to open an old TrueCrypt volume that I haven't
> looked at in at least a few years. Yes, I have the passphrase :=)  Below is a trace of what's
> happening. Without --debug, all I see is the error message:
> 
>    device-mapper: reload ioctl on coreswp (254:0) failed: No such file or directory
> 
> Any help in figuring this out would be much appreciated.

The log shows, that TrueCrypt part works, you have correct password.
The issue is only in the last step - activation through kernel dm-crypt.

I expect that you have device-mapper udev rules properly installed.

Is there anything in syslog? Kernel dm-crypt kernel module, is available?

Where it is mounted? (/mnt path) - some remote nfs/samba?

Could you try to copy the container to local fs and open it from there?
Also, try to open it read-only (-r flag).
(There were some issues with detecting direct-io, this tries to avoid them.)

Thanks,
Milan
...

> # Device-mapper backend running with UDEV support enabled.
> # dm status coreswp  [ opencount noflush ]   [16384] (*1)
> # Allocating a free loop device (block size: 512).
> # Trying to open and read device /dev/loop0 with direct-io.
> # Direct-io is supported and works.
> # Attached loop device block size is 512 bytes.
> # Calculated device size is 209714688 sectors (RW), offset 256.
> # Trying to activate TCRYPT device coreswp using cipher aes-xts-plain64.
> # DM-UUID is CRYPT-TCRYPT-coreswp
> # Udev cookie 0xd4dfe53 (semid 65598) created
> # Udev cookie 0xd4dfe53 (semid 65598) incremented to 1
> # Udev cookie 0xd4dfe53 (semid 65598) incremented to 2
> # Udev cookie 0xd4dfe53 (semid 65598) assigned to CREATE task(0) with flags DISABLE_LIBRARY_FALLBACK         (0x20)
> # dm create coreswp CRYPT-TCRYPT-coreswp [ opencount flush ]   [16384] (*1)
> # dm reload   (254:0) [ opencount flush securedata ]   [16384] (*1)
> device-mapper: reload ioctl on coreswp (254:0) failed: No such file or directory
> # Udev cookie 0xd4dfe53 (semid 65598) decremented to 1
> # Udev cookie 0xd4dfe53 (semid 65598) incremented to 2
> # Udev cookie 0xd4dfe53 (semid 65598) assigned to REMOVE task(2) with flags DISABLE_LIBRARY_FALLBACK       (0x20)
> # dm remove coreswp  [ opencount flush securedata ]   [16384] (*1)
> # Uevent not generated! Calling udev_complete internally to avoid process lock-up.
> # Udev cookie 0xd4dfe53 (semid 65598) decremented to 1
> # DM create task failed, dm_task errno: 0.
> # dm versions   [ opencount flush ]   [16384] (*1)
> # dm status coreswp  [ opencount noflush ]   [16384] (*1)
> # Device status returned -19.
> # Data device /mnt/disk1/core.swp is OK.
> # No referenced device missing, some device in use.
> # Udev cookie 0xd4dfe53 (semid 65598) decremented to 0
> # Udev cookie 0xd4dfe53 (semid 65598) waiting for zero
> # Udev cookie 0xd4dfe53 (semid 65598) destroyed
> # Releasing crypt device /mnt/disk1/core.swp context.
> # Releasing device-mapper backend.
> # Closing read only fd for /mnt/disk1/core.swp.
> # Closed loop /dev/loop0 (/mnt/disk1/core.swp).
> Command failed with code -5 (device already exists or device is busy).
> 
> ----end----
>