0

I'm fairly new to luks and cryptsetup tool and trying to use them on a Beaglebone to encrypt a partition. I'm able successfully encrypt a partition and then access it and mount the mapped device manually using the instructions here.

However, when I try to put the partition in /etc/crypttab file to make it automatically mount at boot, the mapped device doesn't seem to get populated in /dev/mapper directory. The system log has no indication of an error so it's like it just ignored crypttab entirely. Based on my what I've found online so far, I've tried several ways to declare the encrypted partition in crypttab but nothing has worked yet.

Here're the contents of my /etc/crypttab file (I've tried all these options but neither has worked):

config_partition   /dev/mmcblk0p5  /key
#config_partition /dev/mmcblk0p5  /home/root/encrypted_partition/key      luks
#config_partition /dev/mmcblk0p5
#config_partition /dev/disk/by-uuid/98173545-ef9f-47de-93a2-d0ac5aed7fad  /home/root/encrypted_partition/key      luks
#config_partition UUID=98173545-ef9f-47de-93a2-d0ac5aed7fad /home/root/encrypted_partition/key

Do I need to enable any service or a config option anywhere? I'd appreciate any suggestions or ideas to try to avoid having to come up with a script to manually mount it on every boot.

Thanks & Regards,

Rohit

  • What Linux distribution are you using (and which init system, if it offers a choice)? Crypttab is not actually handled by cryptsetup itself. – grawity Jun 13 at 16:12
  • I'm using an image I build myself using Yocto (based on openembedded) and using Systemd as init manager. I tried to look up if there's a specific package or service I need to include for crypttab but didn't find much beyond references to cryptsetup. – Rohit Jun 13 at 16:20
0

Have you tried enabling "cryptsetup" in PACKAGECONFIG for the systemd package? (see here for all available systemd packageconfig options in the latest Yocto release).

Also this post maybe related.

  • Thanks for responding, yes, this is exactly what I needed! However, adding cryptsetup to PACKAGECONFIG for systemd leads to a circular dependency, similar to the issue described here: lists.openembedded.org/pipermail/openembedded-devel/…. I'll continue trying get this working and mark it as an answer if I succeed. Please comment if you have any ideas to get around the circular dependency. – Rohit Jun 14 at 14:05

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.