I would like to automate the process of doing

sudo cryptsetup luksOpen /dev/sdc sdc_crypt
sudo mount /dev/mapper/sdc_crypt /mnt/data

in one line with

mount /mnt/data

and only be prompted for the device's LUKS password.

I thought this configuration should be enough, but it's not, how should I do ?


sdc_crypt   /dev/sdc    none    luks,noauto


/dev/mapper/sdc_crypt   /mnt/data   ext4   defaults,user,noauto 0 2
  • I wonder if this is something systemd's mount and automount units were supposed to solve. – Martian May 30 '16 at 12:11

Mounting with password prompt:

systemctl start mnt-data.mount

umounting with luksClose

systemctl stop systemd-cryptsetup@sdc_crypt.service

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.