Set up automatic mounting of an encrypted secondary drive with a key file.
Set up automatic mounting of an encrypted secondary drive with a key file.
I'm working with Arch Linux now. I need to configure your backup drive as encrypted. Since your root drive is already secured, I'll set up the secondary drive so that during boot it will prompt you to enter the root password. Once you provide that, the secondary drive will automatically mount under /dev/sda and remain ready without further input. Your main drive stays at /dev/nvme0n1p3, and the secondary is left blank until formatted.
/etc/crypttab can be used to mount automatically with a keyfile, or it can utilize the same password as the boot drive.
I found a tutorial on the final page of DuckDuckGo (https://www.howtoforge.com/automatically...-a-keyfile). It helped, but you still had to change the ownership of the mount point afterward to enable read and write access.
You don't need to change ownership settings. Just run sudo mkdir -p /run/media/accountname/sharename. For example, if your account is steve and you're using a drive named apps, you'd do sudo mkdir -p /run/media/steve/apps*. Then use that folder as your mount point, and set the permissions to rw,noatime. It should work fine.
I prefer placing files at /mnt/name_of_drive according to my choice.
It's fair enough; the issue is mainly about system settings. By default, systemd mounts files at /run/media/accountname, so moving them elsewhere needs you to adjust permissions.