Skip to content

Conversation

@145818
Copy link

@145818 145818 commented Jan 17, 2026

I noticed when installing Artix Linux with only home folder encryption (setup via /etc/conf.d/dmcrypt) the passphrase is correctly asked at boot for the encrypted home folder and decrypted if correct passphrase is given but the drive does not get mounted to /home. It was not a /etc/fstab issue because after logging in as root mount -a did mount the drive to /home correctly.

The fix was to add dmcrypt to /etc/conf.d/localmount under depend() after need fsck root. Would it be useful if this was added to localmount or is there a better way of doing it?

@navi-desu
Copy link
Member

need is not the right dependency here, since users that don't have encrypted partitions shouldn't have the dmcrypt service started, nor should localmount fail if dmcrypt fails

we should instead put it in the use line, as that does: "The service will attempt to start any services it uses that have been added to the runlevel."

could you move dmcrypt from need to use and check if it solves your issue?

@145818
Copy link
Author

145818 commented Jan 18, 2026

That sounded like a very good solution, unfortunately it does not work. Potential bug or something I can look on my end configuring wise? I can not find anything wrong personally with my fstab or dmcrypt configs. Makes sense though not to add dmcrypt to need when it's only needed if drive is encrypted, that is for me though the only one that works.

Scenario A: Using need

Having it in need works, after boot /home is mounted:

# lsblk
NAME          MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINTS
sda             8:0    0 111.8G  0 disk  
├─sda1          8:1    0     1G  0 part  /boot/efi
├─sda2          8:2    0     1G  0 part  /boot
├─sda3          8:3    0    50G  0 part  /
└─sda4          8:4    0  59.8G  0 part  
  └─crypthome 254:0    0  59.8G  0 crypt /home
nvme0n1       259:0    0 238.5G  0 disk  
├─nvme0n1p1   259:1    0   300M  0 part  
└─nvme0n1p2   259:2    0 238.2G  0 part  
# grep -B3 dmcrypt /etc/init.d/localmount
depend()
{
	need fsck root dmcrypt

Scenario B: Using use

After moving dmcrypt to use instead of need /home is not mounted after boot:

# lsblk
NAME          MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINTS
sda             8:0    0 111.8G  0 disk  
├─sda1          8:1    0     1G  0 part  /boot/efi
├─sda2          8:2    0     1G  0 part  /boot
├─sda3          8:3    0    50G  0 part  /
└─sda4          8:4    0  59.8G  0 part  
  └─crypthome 254:0    0  59.8G  0 crypt 
nvme0n1       259:0    0 238.5G  0 disk  
├─nvme0n1p1   259:1    0   300M  0 part  
└─nvme0n1p2   259:2    0 238.2G  0 part  
# grep -B4 dmcrypt /etc/init.d/localmount
depend()
{
	need fsck root
	use lvm modules dmcrypt

Manually running mount -a mounts /home:

# mount -a
# lsblk
NAME          MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINTS
sda             8:0    0 111.8G  0 disk  
├─sda1          8:1    0     1G  0 part  /boot/efi
├─sda2          8:2    0     1G  0 part  /boot
├─sda3          8:3    0    50G  0 part  /
└─sda4          8:4    0  59.8G  0 part  
  └─crypthome 254:0    0  59.8G  0 crypt /home
nvme0n1       259:0    0 238.5G  0 disk  
├─nvme0n1p1   259:1    0   300M  0 part  
└─nvme0n1p2   259:2    0 238.2G  0 part  

Senario C: Both use and after

Just for testing I tried adding dmcrypt to both use and after, but same problem, /home is not mounted after boot. Mounts fine with a manual mount -a:

# lsblk
NAME          MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINTS
sda             8:0    0 111.8G  0 disk  
├─sda1          8:1    0     1G  0 part  /boot/efi
├─sda2          8:2    0     1G  0 part  /boot
├─sda3          8:3    0    50G  0 part  /
└─sda4          8:4    0  59.8G  0 part  
  └─crypthome 254:0    0  59.8G  0 crypt 
nvme0n1       259:0    0 238.5G  0 disk  
├─nvme0n1p1   259:1    0   300M  0 part  
└─nvme0n1p2   259:2    0 238.2G  0 part  
# grep -B3 dmcrypt /etc/init.d/localmount
depend()
{
	need fsck root
	use lvm modules dmcrypt
	after clock lvm modules dmcrypt
# mount -a
# lsblk
NAME          MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINTS
sda             8:0    0 111.8G  0 disk  
├─sda1          8:1    0     1G  0 part  /boot/efi
├─sda2          8:2    0     1G  0 part  /boot
├─sda3          8:3    0    50G  0 part  /
└─sda4          8:4    0  59.8G  0 part  
  └─crypthome 254:0    0  59.8G  0 crypt /home
nvme0n1       259:0    0 238.5G  0 disk  
├─nvme0n1p1   259:1    0   300M  0 part  
└─nvme0n1p2   259:2    0 238.2G  0 part  

Maybe not relevant, but my rc-service and rc-status output (was same for all three tests):

# rc-service dmcrypt status
 * status: started
# rc-status boot
Runlevel: boot
 hwclock                                                           [  started  ]
 sysctl                                                            [  started  ]
 modules                                                           [  started  ]
 dmcrypt                                                           [  started  ]
 fsck                                                              [  started  ]
 root                                                              [  started  ]
 mtab                                                              [  started  ]
 swap                                                              [  started  ]
 localmount                                                        [  started  ]
 seedrng                                                           [  started  ]
 bootmisc                                                          [  started  ]
 net.lo                                                            [  started  ]
 etmpfiles-setup                                                   [  started  ]
 hostname                                                          [  started  ]
 metalog                                               [  started 00:03:24 (0) ]
 esysusers                                                         [  started  ]
 termencoding                                                      [  started  ]
 keymaps                                                           [  started  ]
 procfs                                                            [  started  ]
 loopback                                                          [  started  ]
 save-keymaps                                                      [  started  ]
 binfmt                                                            [  started  ]
 elogind                                               [  started 00:03:25 (0) ]
 save-termencoding                                                 [  started  ]

@navi-desu
Copy link
Member

are localmount and dmcrypt on the same runlevel? by the last paste it seems like they are

and if so, use should work, so this seems like a bug as use (or use + after) should enforce the order... i'll look into it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants