1 |
On 16/11/2018 14:43, Rich Freeman wrote: |
2 |
> On Fri, Nov 16, 2018 at 12:15 PM Andrew Udvare <audvare@×××××.com> wrote: |
3 |
>> |
4 |
>> I am not sure if there is a way to move the systemd-cryptsetup@××××.service up the dependency tree once it's working, which would then remove the mnt-chuan.mount dependency. |
5 |
>> |
6 |
> |
7 |
> Ok, I did a bit more reading. You're using the cryptsetup generator |
8 |
> most likely. It sets up units to be oneshot+remainafterexit, which |
9 |
> means they're "active" whenever the LUKS device is mounted (without |
10 |
> any processes - but they show as active so that you can stop them and |
11 |
> unmount the device). It sets the RequiresMountsFor parameter for the |
12 |
> device the key file is contained on, which makes that mount service a |
13 |
> Required dependency. That means that it can't be unmounted while the |
14 |
> cryptsetup device is in use, and in theory attempting to unmount the |
15 |
> key file should make systemd attempt to unmount the cryptsetup device |
16 |
> (though busy filesystems could interfere with that). |
17 |
|
18 |
So it is a bit strange that /mnt/chuan was considered a dependency just |
19 |
because of mention in /etc/crypttab. However I found out that the reason |
20 |
has something to do with the /mnt/chuan entry in /etc/fstab in my real |
21 |
root, and this is not a necessary line (it is the only entry in the |
22 |
initrd fstab). I removed the line and now the dependency is still show |
23 |
with list-dependencies, but it is white instead of red. My system is |
24 |
still shown as running rather than degraded. |
25 |
|
26 |
Removing the line from /etc/fstab only partially solves the problem, as |
27 |
it's not explained what happens with the USB drive once the root is |
28 |
switched because after that it's not shown to be mounted. I am pretty |
29 |
sure it's not safely unmounted before the switch, which leaves it in a |
30 |
strange state requiring fsck. Don't know the best way around this other |
31 |
than wait till systemd supports the keyscript option in /etc/crypttab. |
32 |
|
33 |
-- |
34 |
Andrew |