Gentoo Archives: gentoo-user

From: Dale <rdalek1967@×××××.com>
To: Ramon Fischer <Ramon_Fischer@×××××××.de>, Gentoo User <gentoo-user@l.g.o>
Subject: Re: [gentoo-user] cryptsetup close and device in use when it is not
Date: Mon, 02 Aug 2021 13:33:15
Message-Id: 6cb92a23-ba92-1cc6-5c9c-6d0d3e4b4349@gmail.com
In Reply to: Re: [gentoo-user] cryptsetup close and device in use when it is not by Ramon Fischer
1 Ramon Fischer wrote:
2 > OK, if it could be "udev", you might want to try to check the following:
3 >
4 >    $ grep -rF "<part_of_uuid>" /etc/udev/rules.d/
5 >    $ grep -rF "<part_of_uuid>" /lib/udev/rules.d/
6 >    $ grep -rF "<part_of_uuid>" /etc
7 >
8 > You could also try to search for the partition device, maybe there
9 > will be some interesting configuration files.
10 >
11 > If you are using "systemd", you might want to check every service unit
12 > file as well:
13 >
14 >    $ systemctl
15 >
16 > Recently, I had a similar issue with "cryptsetup" on Raspbian, where
17 > the "/etc/crypttab" was faulty, which may be applicable here. It had
18 > the following entry:
19 >
20 >    # <accident_paste_with_uuid> # <target name> <source device> [...]
21 >    <entry1>
22 >    <entry2>
23 >
24 > Therefore, the systemd service unit
25 > "systemd-cryptsetup@dev-disk-by\x2duuid-#<accident_paste_with_uuid> #
26 > <target name> <source device> [...]" - if I remember correctly - failed.
27 > It seems, that "systemd-cryptsetup-generator" only searches for
28 > matching UUIDs in "/etc/crypttab", even, if they are commented and
29 > creates service units for each match in "/run/systemd/generator/".
30 > I remember, that I had issues to access the hard drive. Nevertheless,
31 > I was able to mount it normally, due to the other correct entry(?).
32 >
33 > By removing the accidentally pasted UUID from "/etc/crypttab" and
34 > rebooting, I was able to use the hard drive without issues again.
35 >
36 > Maybe this is something, where you could poke around? :)
37 >
38 > -Ramon
39
40 I'm running openrc here.  I don't recall making any udev rules
41 recently.  This is a list of what I have.
42
43
44 root@fireball / # ls -al /etc/udev/rules.d/
45 total 20
46 drwxr-xr-x 2 root root 4096 Apr 27 15:07 .
47 drwxr-xr-x 3 root root 4096 Jul 27 03:17 ..
48 -rw-r--r-- 1 root root 2064 Apr 27 15:07 69-libmtp.rules
49 -rw-r--r-- 1 root root 1903 Apr  4  2012 70-persistent-cd.rules
50 -rw-r--r-- 1 root root  814 Jan  1  2008 70-persistent-net.rules
51 -rw-r--r-- 1 root root    0 Mar 22  2015 80-net-name-slot.rules
52 root@fireball / #
53
54
55 One is for CD/DVD stuff.  I wonder if I can remove that now.  Two is for
56 network cards and top one is something to do with my old Motorola cell
57 phone, rest in peace. 
58
59 All this said, it did it again last night.  I tried a few things and
60 went to bed while my updates were compiling.  When I got up a bit ago,
61 it closed just fine.  So, something says it is busy but eventually
62 releases it if left alone for a while.  I'd like to know what it is and
63 if it is really in use or not.  Thing is, I can't find a way to know
64 what it is that is using it.  The dmsetup command shows it is in use but
65 no way to know what is using it. 
66
67 Dale
68
69 :-)  :-) 

Replies

Subject Author
Re: [gentoo-user] cryptsetup close and device in use when it is not Ramon Fischer <Ramon_Fischer@×××××××.de>