public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: Ramon Fischer <Ramon_Fischer@hotmail.de>
To: Dale <rdalek1967@gmail.com>, Gentoo User <gentoo-user@lists.gentoo.org>
Subject: Re: [gentoo-user] cryptsetup close and device in use when it is not
Date: Mon, 9 Aug 2021 15:38:46 +0200	[thread overview]
Message-ID: <AM6PR10MB2440A2245501F594C7EA4443EFF69@AM6PR10MB2440.EURPRD10.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <6cb92a23-ba92-1cc6-5c9c-6d0d3e4b4349@gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 4539 bytes --]

Hi Dale,

>   So, something says it is busy but eventually
> releases it if left alone for a while.  I'd like to know what it is and
> if it is really in use or not.  Thing is, I can't find a way to know
> what it is that is using it.  The dmsetup command shows it is in use but
> no way to know what is using it.
I could reproduce this issue by killing my desktop process, unmounting 
the home partition and playing some "kill process" bingo. I could 
backtrace it to one unkillable process "kcryptd":

    1. Kill "awesomewm": <CTRL + ALT> + Backspace
    2. Kill other processes accessing "/home/"
    3. umount /home
    4. cryptsetup close crypthome
    Device crypthome is still in use
    5. dmsetup info /dev/mapper/crypthome
    Name:              crypthome
    State:             ACTIVE
    Read Ahead:        256
    Tables present:    LIVE
    Open count:        1
    Event number:      0
    Major, minor:      253, 1
    Number of targets: 1
    UUID: CRYPT-LUKS2-<some_uuid>-crypthome
    6. Kill any unnecessary process and try "cryptsetup close crypthome"
    7. Search for major, minor: ps aux | grep "253:1"
    root       150  0.2  0.0      0     0 ?        I    15:21   0:02
    [kworker/u16:5-kcryptd/253:1]
    8. Does not work: kill 150
    9. Does not work and could be dangerous: kill -9 150

So, there was still one "kcryptd" process left, accessing the hard 
drive, but I found no way to kill it.

Maybe this could be helpful?

-Ramon


On 02/08/2021 15:33, Dale wrote:
> Ramon Fischer wrote:
>> OK, if it could be "udev", you might want to try to check the following:
>>
>>     $ grep -rF "<part_of_uuid>" /etc/udev/rules.d/
>>     $ grep -rF "<part_of_uuid>" /lib/udev/rules.d/
>>     $ grep -rF "<part_of_uuid>" /etc
>>
>> You could also try to search for the partition device, maybe there
>> will be some interesting configuration files.
>>
>> If you are using "systemd", you might want to check every service unit
>> file as well:
>>
>>     $ systemctl
>>
>> Recently, I had a similar issue with "cryptsetup" on Raspbian, where
>> the "/etc/crypttab" was faulty, which may be applicable here. It had
>> the following entry:
>>
>>     # <accident_paste_with_uuid> # <target name> <source device> [...]
>>     <entry1>
>>     <entry2>
>>
>> Therefore, the systemd service unit
>> "systemd-cryptsetup@dev-disk-by\x2duuid-#<accident_paste_with_uuid> #
>> <target name> <source device> [...]" - if I remember correctly - failed.
>> It seems, that "systemd-cryptsetup-generator" only searches for
>> matching UUIDs in "/etc/crypttab", even, if they are commented and
>> creates service units for each match in "/run/systemd/generator/".
>> I remember, that I had issues to access the hard drive. Nevertheless,
>> I was able to mount it normally, due to the other correct entry(?).
>>
>> By removing the accidentally pasted UUID from "/etc/crypttab" and
>> rebooting, I was able to use the hard drive without issues again.
>>
>> Maybe this is something, where you could poke around? :)
>>
>> -Ramon
> I'm running openrc here.  I don't recall making any udev rules
> recently.  This is a list of what I have.
>
>
> root@fireball / # ls -al /etc/udev/rules.d/
> total 20
> drwxr-xr-x 2 root root 4096 Apr 27 15:07 .
> drwxr-xr-x 3 root root 4096 Jul 27 03:17 ..
> -rw-r--r-- 1 root root 2064 Apr 27 15:07 69-libmtp.rules
> -rw-r--r-- 1 root root 1903 Apr  4  2012 70-persistent-cd.rules
> -rw-r--r-- 1 root root  814 Jan  1  2008 70-persistent-net.rules
> -rw-r--r-- 1 root root    0 Mar 22  2015 80-net-name-slot.rules
> root@fireball / #
>
>
> One is for CD/DVD stuff.  I wonder if I can remove that now.  Two is for
> network cards and top one is something to do with my old Motorola cell
> phone, rest in peace.
>
> All this said, it did it again last night.  I tried a few things and
> went to bed while my updates were compiling.  When I got up a bit ago,
> it closed just fine.  So, something says it is busy but eventually
> releases it if left alone for a while.  I'd like to know what it is and
> if it is really in use or not.  Thing is, I can't find a way to know
> what it is that is using it.  The dmsetup command shows it is in use but
> no way to know what is using it.
>
> Dale
>
> :-)  :-)

-- 
GPG public key: 5983 98DA 5F4D A464 38FD CF87 155B E264 13E6 99BF



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

  reply	other threads:[~2021-08-09 13:32 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-14  4:50 [gentoo-user] cryptsetup close and device in use when it is not Dale
2021-06-15 13:48 ` Ramon Fischer
2021-06-15 14:21   ` Dale
2021-06-15 14:52     ` Jack
2021-06-15 15:26       ` Dale
2021-06-15 19:04         ` Ramon Fischer
2021-06-21  4:18         ` Dale
2021-06-21  4:49           ` Dale
2021-06-21  5:41             ` Dale
2021-06-21  5:59               ` Dale
2021-06-28  3:35                 ` Dale
2021-07-05  3:19                   ` Dale
2021-07-06 18:40                     ` Ramon Fischer
2021-07-06 19:43                       ` Dale
2021-07-07 14:48                       ` Dr Rainer Woitok
2021-07-07 18:08                         ` Dale
2021-07-08  8:20                           ` Ramon Fischer
2021-07-12  8:31                             ` Dale
2021-07-12 13:14                               ` Ramon Fischer
2021-08-02 13:33                                 ` Dale
2021-08-09 13:38                                   ` Ramon Fischer [this message]
2021-09-19 11:55                                     ` Dale
2021-07-25 20:29                           ` Frank Steinmetzger
2021-07-25 23:10                             ` Dale
2021-07-26 21:00                               ` Frank Steinmetzger
2021-07-26 22:48                                 ` Dale
2021-07-29 16:46                                 ` Wols Lists
2021-07-29 20:55                                   ` [gentoo-user] [OT] SMR drives (WAS: cryptsetup close and device in use when it is not) Frank Steinmetzger
2021-07-29 21:31                                     ` Frank Steinmetzger
2021-07-30 12:48                                       ` Frank Steinmetzger
2021-07-30  5:14                                     ` William Kenworthy
2021-07-30 14:29                                       ` Rich Freeman
2021-07-30 16:50                                         ` antlists
2021-07-30 18:38                                           ` Rich Freeman
2021-07-31  3:14                                         ` William Kenworthy
2021-07-31  3:50                                           ` Wols Lists
2021-07-31  4:58                                             ` William Kenworthy
2021-07-31 12:12                                               ` Rich Freeman
2021-08-01  0:41                                                 ` Frank Steinmetzger
2021-08-01  0:56                                                   ` Rich Freeman
2021-07-31 16:38                                               ` antlists
2021-08-01  0:50                                               ` Frank Steinmetzger
2021-08-01  3:36                                                 ` William Kenworthy
2021-08-01  3:46                                                   ` William Kenworthy
2021-08-01 21:38                                                     ` Frank Steinmetzger
2021-08-02  5:38                                                       ` William Kenworthy
2021-08-02 21:52                                                         ` Frank Steinmetzger
2021-08-02 23:10                                                           ` William Kenworthy
2021-08-03  8:18                                                             ` Frank Steinmetzger
2021-08-05 20:40                                                               ` Frank Steinmetzger
2021-08-06  7:22                                                                 ` William Kenworthy
2021-08-01 21:55                                                   ` Frank Steinmetzger
2021-08-02  6:12                                                     ` William Kenworthy
2021-08-02 22:03                                                       ` Frank Steinmetzger
2021-08-02 23:35                                                         ` William Kenworthy
2021-08-01  3:41                                                 ` William Kenworthy
2021-08-01 21:41                                                   ` Frank Steinmetzger
2021-07-31 12:21                                             ` Rich Freeman
2021-07-31 12:59                                               ` William Kenworthy
2021-07-31 13:30                                                 ` Rich Freeman
2021-08-01  3:05                                                   ` William Kenworthy
2021-08-01 11:37                                                     ` Rich Freeman
2021-07-31  5:23                                           ` William Kenworthy
2021-06-15 17:48     ` [gentoo-user] Re: cryptsetup close and device in use when it is not Remy Blank

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=AM6PR10MB2440A2245501F594C7EA4443EFF69@AM6PR10MB2440.EURPRD10.PROD.OUTLOOK.COM \
    --to=ramon_fischer@hotmail.de \
    --cc=gentoo-user@lists.gentoo.org \
    --cc=rdalek1967@gmail.com \
    /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