Skip to main content
Topic: /etc/crypttab doesn't work and other drives issue (Read 995 times) previous topic - next topic
0 Members and 3 Guests are viewing this topic.

/etc/crypttab doesn't work and other drives issue

I just switched from Arch to Artix with runit, and I have few issues with my setup. I have luks-encrypted SSD as my main drive, and 2TB HDD as my secondary drive. Half of HDD is unencrypted, and second partiton is encrypted just like SSD. I've added first partition to fstab, but it doesn't mount because there is no /run/media/username folder where I always mount them. It was created by default in Arch. On Artix it doesn't even work when I created this directory by hand. It just got deleted after reboot. How to deal with that without moving mount point?

Other issue I have is that it doesn't unlock my second partition, even though I have it with working key in /etc/crypttab. It's just not getting unlocked on boot as it should, no idea why

Last issue is that I don't see my drives in nautilus. I mean, they are there when I mount them by hand, but I can't mount them in gui file manager. I just can't see them there in any gui file manager

Re: /etc/crypttab doesn't work and other drives issue

Reply #1
Hi,
Do you have cryptsetup and cryptsetup-runit installed?
Also, the partions probably got mounted on arch using systemd's automount, but on artix there is no systemd.
Is the location of the key available during boot? To test the unlocking you might update /etc/cryptab with a line like:
# data1        /dev/sda3                                    none
and you should be prompted but the password during boot.
With a line for this partition in the fstab file for a mount point like ie /home you should be able to get it mounted automatically

Re: /etc/crypttab doesn't work and other drives issue

Reply #2
Do you have cryptsetup and cryptsetup-runit installed?

I have cryptsetup, otherwise I wouldn't be able to boot my system. Root partition is encrypted too

Also, the partions probably got mounted on arch using systemd's automount, but on artix there is no systemd.
Is the location of the key available during boot? To test the unlocking you might update /etc/cryptab with a line like:
# data1        /dev/sda3                                    none

Use of systemd automount explains much. Location is available. It's in /etc/luks-keys/ and I have one big encrypted partition for everything (except /boot). So if it can read cryptab, it can read key. Output of my lsblk may visualize  it better:
Code: [Select]
sda               8:0    0 238,5G  0 disk
├─sda1            8:1    0     1M  0 part
├─sda2            8:2    0     4G  0 part  /boot
├─sda3            8:3    0   230G  0 part
│ └─data        254:0    0   230G  0 crypt
│   └─data-root 254:1    0   230G  0 lvm   /
└─sda4            8:4    0     4G  0 part
sdb               8:16   0   1,8T  0 disk
├─sdb1            8:17   0 931,5G  0 part  /run/media/beniamin/HDD
└─sdb2            8:18   0 931,5G  0 part
  └─luks-hdd    254:2    0 931,5G  0 crypt /run/media/beniamin/HDD_ENCRYPTED

That's with HDD manually mounted. I'll check crypttab with line you wrote, and come back soon with result


With a line for this partition in the fstab file for a mount point like ie /home you should be able to get it mounted automatically

I'd rather keep location, as few configs depend of it. But if there is no other way, I'll just mount those drives in /home and edit them


EDIT. I checked this line and it works just as it should. But with key it gave me error "failed to connect with lvmetad". But I have it enabled in runit. I guess it's starting later. Can I change it?

EDIT2. It actually works, the issue was nofail option in crypttab I also managed to workaround mounting via udiskie so it mounts in the paths I want