You are not logged in.
I recently installed Arch Linux and encrypted my home partition using LUKS.
I had already encrypted my partitions with LUKS and everything worked fine. However this time, before asking for the key, it mounts the home partition and then fails starting systemd-cryptsetup@home.service.
It actually unlocks the partition when I insert the key and recognizes whether the key is wrong but it gives me an error you can see in the log. (I think you might want to check from line 1188 to line 1227)
Here you can see the output of "systemctl status systemd-cryptsetup@home.service".
I just wanted to know if this can cause any problem and how can I fix it.
Thanks in advance!
Last edited by ciao_gio (2024-12-02 18:40:01)
Offline
Sorry for any errors and i am not sure if this is the problem, but it seems that your system is mounting the home partition before doing cryptsetup.
In the lines:
....
dic 02 17:55:35 bellnote-book systemd[1]: Mounting /home...
dic 02 17:55:35 bellnote-book kernel: EXT4-fs (dm-0): mounted filesystem ea5c80b0-c49c-41a6-aa6b-84fa57e599b1 r/w with ordered data mode. Quota mode: none.
dic 02 17:55:35 bellnote-book systemd[1]: Mounted /home.
....
dic 02 17:55:54 bellnote-book systemd-cryptsetup[535]: Cannot use device /dev/disk/by-diskseq/1-part3 which is in use (already mapped or mounted).
....
Maybe you missed a step in the process order, and again, i'm not sure if this is the cause of your problem since i do not use criptsetup to much, my answer may be useless.
And, please i have a small doubt, this is the first time you're using the /home with cryptsetup(right after preparing it) or you already used criptsetup in this partition and the error just happened?
What you can try:
If you have a live usb with the arch install(arch iso) i would recommend you to use it, see your system from another angle may help you to understand what's the problem.
In a live usb try to open your partition with criptsetup.
Note: Ignore the parenthesis in the code.
criptsetup open --type (your encryption type) /dev/(the partition of /home) name
If crypt setup do not return any error and you can access your partition with ls for example, then the problem is not with crypt setup but with the order your system is doing the encryption.
ls /dev/mapper/name
Then if you can see something with ls, you can check if your system /etc/mkinitcpio.conf has the argument encrypt betwen block and filesystens in the HOOKS line. And also check in /etc/default/grub
if the line GRUB_CMDLINE_LINUX_DEFAULT has the comand: cryptdevice=/dev/(the partition of home) preferably after the argument loglevel=3.(if you use grub, if not, search for the specific command
and how to add it to your bootloader).
I hope I helped, if not forgive me for any mistakes.
Last edited by John-Something-Something (2024-12-04 20:26:57)
Offline
I currenlty can't check whether cryptsetup gives any error because I need the USB stick I used, but I'll try asap. Anyway I also noticed it mounts the home partition before unlocking it and the encryption is working. I think you are right and the problem is the order it follows when booting.
I used LUKS with an equivalent installation of Arch, but it worked fine. This time it gave the error since the first boot.
I checked /etc/mkinitcpio.conf and it looks fine. I think my computer uses systemd-boot but I couldn't find something similar to /etc/default/grub. Do you know something about it?
Offline
In this case you need to find where is the loader configuration file, probably somewhere in /boot. Search for the directory /boot/loader/entries. Once there you need to find the .conf file (like: arch.conf) used by systemd bootloader in the start.
First you need to be sure your encrypted partition(s) are decripted in /dev/mapper and check if your fstab file has the correct info.
Then you can edit the file and check if there is the following:
Note: if there is already one line options, simply modify it to have criptsetup, do not add a new one. Do it Without parenthesis.
options cryptdevice=UUID=(Your home partition UUID):(Your home partition name in /dev/mapper) root=/dev/(Your root partition, if is encrypted then add the /dev/mapper/(your opened partition))
Example:
options cryptdevice=UUID=(a876-ashw767-i171twqt-81265):archhome root=/dev/root ....(You should have other default things after that like: quiet, rw,... )
And, I forgot to mention. In your mkinitcpio.conf the argument encrypt needs to be before the filesystems argument or your computer will mount the partitions first, possibly resulting in the error you see. You probably solved this in your installation, but i just wanted to make sure.
Last edited by John-Something-Something (2024-12-08 10:10:31)
Offline
If the partition Type is set to Linux Home, use fdisk to change partition type to 20 Linux Filesystem. Systemd will try to mount it, if TYPE /home ,despite already been mapped and mounted.
Last edited by eigennull (2025-10-09 14:41:52)
Offline