DM-Crypt Archive mirror
 help / color / mirror / Atom feed
From: Milan Broz <gmazyland@gmail.com>
To: Frederick Gotham <thomas123@gmx.ca>, dm-crypt@saout.de
Subject: Re: [dm-crypt] Spontaneous Unmounting - LUKS Device Busy
Date: Tue, 2 Mar 2021 15:03:47 +0100	[thread overview]
Message-ID: <537c439c-0950-a1cd-a7f0-e6dee42d1be8@gmail.com> (raw)
In-Reply-To: <trinity-b3d0d2d3-5388-4d34-83a0-718db6e5f916-1614692163185@3c-app-mailcom-bs10>

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@saout.de
https://www.saout.de/mailman/listinfo/dm-crypt

      reply	other threads:[~2021-03-02 14:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-02 13:36 [dm-crypt] Spontaneous Unmounting - LUKS Device Busy Frederick Gotham
2021-03-02 14:03 ` Milan Broz [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=537c439c-0950-a1cd-a7f0-e6dee42d1be8@gmail.com \
    --to=gmazyland@gmail.com \
    --cc=dm-crypt@saout.de \
    --cc=thomas123@gmx.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).