Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save rmi1974/2f940092b57a3a5a0f84899a801cbf51 to your computer and use it in GitHub Desktop.
Save rmi1974/2f940092b57a3a5a0f84899a801cbf51 to your computer and use it in GitHub Desktop.
How to automatically mount an encrypted volume at boot #commandlinefu #mount #lucks #encrypted #volume

How to automatically mount an encrypted volume at boot

Courtesy of ask.fedoraproject.org

NOTE: To have this work, one of your passphrases of your LUKS encrypted disk must be the same then your login password!

Prerequisite:

$ sudo dnf install pam_mount

Find the right UUID of the encrypted disk you would like to automount after login.

$ sudoedit /etc/security/pam_mount.conf.xml

Insert following row after comment row: <!-- Volume definitions -->

<volume user="your_login_user" fstype="crypt" path="/dev/disk/by-uuid/the_uuid_of_encrypted_disk" 
        mountpoint="path_to_your_mount_point" options="relatime" />

Also:

$ sudoedit /etc/pam.d/gdm-password

Add follwing line:

auth optional pam_mount.so try_first_pass

Add following line in session text block:

session optional pam_mount.so

Reboot.


Links

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