LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   luks img crypttab mounts as read only. (https://www.linuxquestions.org/questions/slackware-14/luks-img-crypttab-mounts-as-read-only-4175588739/)

khronosschoty 09-04-2016 09:08 PM

luks img crypttab mounts as read only.
 
Okay I'm trying to create a luks img to mount onto my /tmp directory so that my tmp directory is encrypted but for some reason it always mounts as read only.

The /etc/crypttab entry I have is tmp /root/tmp.img

and the fstab entry I have is /dev/mapper/tmp /tmp ext4 defaults 1 2

When I run cryptsetup luksOpen /root/tmp.img tmp and then mount -a it mounts in the manner I want. I added that to my rc.local script and it works but its less than ideal IMO. Any suggestions on how I could get this working via crypttab?

GazL 09-05-2016 03:04 AM

The problem is that the crypttab processing is done in rc.S before the rootfs get mounted read-write. Therefore your 'image' file is on a read-only filesystem when cryptsetup tries to open it and thus can only open it read-only. I've also hit this issue before, but for /home on an image rather than /tmp.

You could try moving the appropriate section of rc.S to after the rw,remount of rootfs.


All times are GMT -5. The time now is 04:15 AM.