mount LUKS drive at user login

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
virtualshawn
Level 1
Level 1
Posts: 2
Joined: Wed Oct 15, 2014 4:18 pm

mount LUKS drive at user login

Post by virtualshawn »

Hi all, thanks in advance for any help here.

I have two drives, SSD for boot and a SATA Data drive. Both are encrypted with LUKS. Seeing that I must login to load the OS I'd like to auto-mount the SATA drive. I used the disk tool at have the SATA drive decrypt automatically which add an entry to /etc/crypttab. When i log on I can click on the encrypted drive and it opens. I also used the disk utility to auto mount that LUKS partition/drive which added an entry to fstab which it fails does not work.

What I'm hoping to find is what command I can just add at startup so it mounts the drive as if I were clicking on it in cinnamon which ends up in /media. I've tried via UUID as well as /dev/sdb3

...does anyone know what command I can run via terminal to mount the drive that's set to auto decrypt via crypttab?

thanks!
virtualshawn
Level 1
Level 1
Posts: 2
Joined: Wed Oct 15, 2014 4:18 pm

Re: mount LUKS drive at user login

Post by virtualshawn »

bump
trope
Level 4
Level 4
Posts: 302
Joined: Tue Feb 19, 2013 1:10 pm

Re: mount LUKS drive at user login

Post by trope »

Have the exact same question as the above. I am prompted to enter a password to decrypt the partition during boot, but when I log-in to Mint, the partition is not mounted. Is there a way to get the partition to mount before I login?

In Disks, it is already set to "Mount at system startup". I have not checked fstab.

Also was I supposed to make a new post or is it okay to reply to the above seeing it is the same question?
trope
Level 4
Level 4
Posts: 302
Joined: Tue Feb 19, 2013 1:10 pm

[SOLVED] Re: mount LUKS drive at user login

Post by trope »

I figured out how to do it. Followed the instructions at:
https://averagelinuxuser.com/auto-mount ... s-at-boot/

Basically modify the file /etc/crypttab to be:

name_of_encrypted partition /dev/disk/by-uuid/UUID_of_encrypted_partition none luks


and add the following line to /etc/fstab:

/dev/mapper/name_of_encrypted_partition desired_mount_point ext4 defaults 0 0
Post Reply

Return to “Newbie Questions”