How to automatically decrypt and mount volume after boot

Hello!
First post here. I am new-ish to openSUSE regarding my topic: I have a data drive that I want to decrypt and mount AFTER boot/login with a kwallet/keepassxc, but I have no idea how I do that.
It doesn’t have system relevant data on it just archives and personal data… pics/documents/videos etc. so I know it’s not relevant to the boot up.

I got it so that the drive doesn’t decrypt and mount on boot via /etc/fstab and /etc/crypttab. And i can manually mount it with cryptsetup luksOpen and an ordinary mount. But I want to automate it after login. I have to enter a PW for my kdewallet after login and I want to use that to unlock my drive. I guess that can be done with systemd but that is a topic I haven’t meddled with, yet. I would very much appreciate a guide or a pointer to the documentary/wiki where i can find how I can do that correctly.
Additionally: I have a keepass(/xc) database that I use alongside if that would make password input easier I could use that, too.

Thanks in advance!

The login a a certain user?

I only have one account other than root/su. My normal user cren automatically logs in. Edit: so it can be just me or generally, whatever would be easier/more convenient.

My main purpose is to reduce the number of passwords I have to enter.

Btw I use KDE Plasma.

What about user cren creating something (script, command to be executed at login? KDE System Settings → Work space → Start and stop → Autostart (sorry, I do not have an English KDE here, but I assume you may find this).

You said

Just do the same?

BTW root is a user, but su is not, it is a command.
And you definitely have more users then root and cren (look in /etc/passwd).
Better try to understand that Unix/Linux is a multi-user, multi-session operating system. Thus, even if you think you only have one user that is ever active, you better think you have, say, five. That will make understanding many things easier.

I re-read your first post and understand that you think that you can unlock the file system by using the KDE Wallet of a user that is logged in. I do not use file system encryption, so I may be wrong, but as mounting is done by a root owned process that has nothing to do with any user’s running desktop, I do not thing that will work.

I want to automate the process of typing the cryptsetup line, the 2 required passwords and the mount command, if possible. This is supposed to happen after the system has booted. I can, for example, open a keepass file using the command line by handing over a password from kdewallet. Basically I’m asking in the first instance to automate the password insertion in a script that uses my kdewallet for the password.

I just tested inserting USB stick with filesystem on the encrypted LUKS partition in KDE desktop and I got prompted to unlock this LUKS partition and filesystem was automatically mounted. If it does not happen for you, you probably need to provide more details about what happens.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.