On 02/03/2021 14:36, Frederick Gotham wrote: > > Hi everyone, > > I have an SDcard with one partition on it: /dev/mmcblk0p1 > > This partition is a LUKS volume, so I open it and give it the name 'z', and so I now have the node: /dev/mapper/z > > I then mount /dev/mapper/z to the directory /mnt/sdcard > > When doing testing on the SDcard, reading and writing data in a predeterimined elaborate pattern, the device "/dev/mapper/z" mysteriously becomes unmounted and this happens predicatably at the same point in the test every time. I don't know what's causing the unmounting. Next if I try to close the LUKS volume (either by using cryptsetup or dmsetup remove --force), it says Device Busy and it won't close (even though it's not mounted). > > Is there any way I can turn on verbose logging for LUKS to try figure out why the volume is being spontaneously unmounted? I was thinking that maybe the intense testing is causing a spike in CPU / RAM usage which might cause an internal 'ioctl' command within the kernel to fail with error code EAGAIN (Temporary Unavailable). I haven't been able to confirm this yet. > > With regard to the testing procedure I mentioned above, well I've done the same tests on an unencrypted SDcard, and they all work fine. I only get the spontaneous unmounting with a LUKS volume. > > I had considered that the device "/dev/mmcblk0p1" might be disappearing and that this might invoke the UDEV script "media-automount" to unmount the volume, however I haven't been able to confirm yet if this is happening -- I'm waiting for people to get back to me on that. > > For the time being I need to see verbose logging from LUKS to see if there's an error happening somewhere. There is no LUKS actually running in that moment - it only unlocks the device, then it is only kernel dm-crypt mapping. And this mapping is never removed by itself - it must be some external application doing it. So as the first step, check system log - there must be some event in the beginning. My guess is that there is some media/fs error, and some system daemon (udisks?) then tries to turn the device down because seems like it disappeared. So you need to enable log for this daemon. You can also boot into single user mode, then mount the device. I think it will remain mounted and you should see some error in the log. Milan _______________________________________________ dm-crypt mailing list dm-crypt@xxxxxxxx https://www.saout.de/mailman/listinfo/dm-crypt