You are not logged in.

#1 2016-01-06 13:12:06

EdeWolf
Member
Registered: 2016-01-06
Posts: 79

[solved] How to avoing automounting of encrypted partitions?

Hello and only few bugs for 2016,

I am having an encrypted /home partition, that I want to mount manually, however, systemd already tries to mount that at boot, asking for a password, which is not possible, as it is encrypted via key. So I have to enter an invalid password three times to get into kinda single user mode, because local-fs.target fails.

The really annoying part is, that /home is neither listed in fstab nor in crypttab at all. In fact, crypttab is empty alltogether and I do not know why it wants to mount it in first place. I am afraid I made the mistake of giving it the partition type: 8302 without being aware of its consequences concerning systemd. Not sure, but this is the only explanation so far.

But still, I do not want that automagic and would like to disable this behavior. No boot shall ever fail if a partition that is not in fstab (or set to noauto) is not available. Never.
There is a workaround, simply create an empty directory below /home, and it boots fine, but I consider this as an ugly hack and would prefer a clean solution, so that even with an emtpy /home the system boots as it is supposed to.

However, I have not found a way to disable or at least configure the cryptsetup.target nor find the failig service systemd-cryptsetup@home.service, which seems to be created on demand.

Any ideas? I do not have enough space to create another partition with code 8300 to copy over the data and test, so a changing of partition type is really a last resort. And basically: Not in fstab? Shouldn't be part of local-fs.target then.


Thanks

Ede

Last edited by EdeWolf (2016-01-06 18:16:46)

Offline

#2 2016-01-06 15:15:12

respiranto
Member
Registered: 2015-05-15
Posts: 479
Website

Re: [solved] How to avoing automounting of encrypted partitions?

Possibly, amount unit has been created in another way, please post the output of:

systemctl status home.mount

EDIT: As a workaround, you could add /home to your fstab with the 'noauto' option.

Last edited by respiranto (2016-01-06 15:16:08)

Offline

#3 2016-01-06 16:59:08

EdeWolf
Member
Registered: 2016-01-06
Posts: 79

Re: [solved] How to avoing automounting of encrypted partitions?

Thanks, that indeed does get us a little bit closer! systemd-gpt-auto-generator is the one to blame. Have not yet had time to investigate in how to get rid of that sucker, but it is a first clue.

And here the reqeusted outputs:

1. When the error occurs:

● home.mount - Home Partition
   Loaded: loaded (/run/systemd/generator.late/home.mount; bad; vendor preset: disabled)
   Active: inactive (dead)
    Where: /home
     What: /dev/mapper/home
     Docs: man:systemd-gpt-auto-generator(8)

Jan 06 17:50:10 kaperfahrt systemd[1]: Dependency failed for Home Partition.

2. When there is an empty directory in /home

● home.mount
   Loaded: not-found (Reason: No such file or directory)
   Active: inactive (dead)

3. And when it has been mounted manually after it came up cleanly (as result of 2)

 
● home.mount - /home
   Loaded: loaded (/proc/self/mountinfo)
   Active: active (mounted) since Mi 2016-01-06 17:51:58 CET; 3s ago
    Where: /home
     What: /dev/mapper/CrHOME
    Tasks: 0 (limit: 512)                                     

Offline

#4 2016-01-06 18:11:24

respiranto
Member
Registered: 2015-05-15
Posts: 479
Website

Re: [solved] How to avoing automounting of encrypted partitions?

According to the reported manpage systemd-gpt-auto-generator(8), it does actually automount filesystems relying on the partition type.
I don't know much about encrypted partitions, but can't you use gdisk's 't' command?

If not, you could completely disable the generator by deleting it ('/usr/lib/systemd/system-generators/systemd-gpt-auto-generator') and adding it to NoExtract in pacman.conf, though this is probably not the best option.

Offline

#5 2016-01-06 18:13:14

EdeWolf
Member
Registered: 2016-01-06
Posts: 79

Re: [solved] How to avoing automounting of encrypted partitions?

As a sidenote: Adding /home to fstab does not work. Or only half. I still get asked for a decryption password for /home, but contrary to the boot without the fstab entry, the boot finishes cleanly

For sake of completenes:

● home.mount - /home
   Loaded: loaded (/etc/fstab; bad; vendor preset: disabled)
   Active: inactive (dead)
    Where: /home
     What: /dev/disk/by-uuid/00a8d4a2-a6d3-435b-b392-d11230ab56b9
     Docs: man:fstab(5)
           man:systemd-fstab-generator(8)

And maybe we have a solution, will test and report back

Offline

#6 2016-01-06 18:20:23

EdeWolf
Member
Registered: 2016-01-06
Posts: 79

Re: [solved] How to avoing automounting of encrypted partitions?

Thanks respiranto, but there is a more elegant way found here:

https://bugs.freedesktop.org/show_bug.cgi?id=87230

Basically just create a system-generators folder below /etc/systemd and create a link for the offending name to /dev/null

$ ls -l /etc/systemd/system-generators/                                                      
insgesamt 0                                                                                                        
lrwxrwxrwx 1 root root 9  6. Jan 19:12 systemd-gpt-auto-generator -> /dev/null  

Works! Thanks all for your help!

Last edited by EdeWolf (2016-01-06 18:21:07)

Offline

#7 2016-01-06 18:23:36

respiranto
Member
Registered: 2015-05-15
Posts: 479
Website

Re: [solved] How to avoing automounting of encrypted partitions?

EdeWolf wrote:

Thanks respiranto, but there is a more elegant way found here:

https://bugs.freedesktop.org/show_bug.cgi?id=87230

Basically just create a system-generators folder below /etc/systemd and create a link for the offending name to /dev/null

$ ls -l /etc/systemd/system-generators/                                                      
insgesamt 0                                                                                                        
lrwxrwxrwx 1 root root 9  6. Jan 19:12 systemd-gpt-auto-generator -> /dev/null  

Works! Thanks all for your help!

Shouldn't it rather be a link to an executable like /usr/bin/true?


EDIT: Having read this, I have to agree with you.
/dev/null is used as a special 'masking' value. Though /bin/true should also work.

Last edited by respiranto (2016-01-06 18:33:10)

Offline

Board footer

Powered by FluxBB