Gentoo Archives: gentoo-user

From: Dale <rdalek1967@×××××.com>
To: gentoo-user@l.g.o
Subject: [gentoo-user] cryptsetup close and device in use when it is not
Date: Mon, 14 Jun 2021 04:50:30
1 Howdy,
3 As some may recall, I use external drives as backups.  They are
4 encrypted and I use cryptsetup to open and close them.  Open works fine
5 but close gives me trouble at times.  It doesn't always do this but it
6 does it more often than not.  It's getting annoying. 
8 Drive one.  It's a 6TB drive and when it gave this error a few minutes
9 ago, I restarted udev-trigger to correct it.  When I try to close it, it
10 says it is in use.  But restarting udev-trigger reset it so I could
11 close it. 
13 Drive two, when I tried to close it, it gives me this:
16 root@fireball / # cryptsetup close 8tb
17 Device 8tb is still in use.
18 root@fireball / # mount | grep 8tb
19 root@fireball / #
22 As you can tell, it is not mounted.  When I mount, I do it manually from
23 a fstab entry.  I just do mount /mnt/8tb and it mounts it.  I use umount
24 to unmount it.  Old school but it works.  Thing is, for some reason it
25 shows it is in use even tho it is not mounted.  Even restarting
26 udev-trigger didn't work this time.  I can't figure out what is doing it
27 exactly and think it is something besides cryptsetup having a problem. 
28 I'm actually thinking udev for this reason.  I do my backups while I'm
29 updating the OS.  When I do my updates, all my firefox profiles are
30 closed and I'm not downloading new files.  So that is when I do my
31 backups.  Last time it did this, I went to boot runlevel and restarted
32 udev itself.  That reset it so I could close the drive and cut it off. 
33 Thing is, I'd like a proper fix for this or a good sound way to reset it
34 without having to do all that.  Sometimes all I need is to logout and
35 back in after updates.  Restarting udev and such shouldn't be required.
37 If it matters, both drives are in identical enclosures and use the same
38 cable and power source.  One is a SMR and the other a CMR.  One is 6TB
39 and one is 8TB.  Both are encrypted the same way.  Both use eSATA, not
40 USB.  I used USB before and it may have been the enclosure but it ruined
41 drives.  I could never depend on it so I switched to eSATA. 
43 So, anyone else run into this and have a solution for it?  Do I have
44 something set up wrong or is this a bug in some package somewhere?  I've
45 googled and seen where others have the problem but their solutions don't
46 seem to work and most are very old posts. 
48 Need some ideas and thoughts here.
50 Thanks.
52 Dale
54 :-)  :-) 
56 P. S.  I took some meds so I hope the above makes sense.  The meds are
57 working well right now but I need to close the drive so I can put it
58 back in the safe.  :/


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