Auto-mounting crypted LUKS partitions to custom mount point

I’ve been strugglig with the Gnome environment of my Debian testing to be able to mount automatically a LUKS crypted partition on my USB key to the same mount point each time, instead of using the next /media/usbdisk-* available (if several USB drives are plugged).

It appears that even if the ext3 filesystem inside the crypted LUKS partition has a label, it won’t be used by the mount tools (here pmount-hal / pmount launched by gnome-volume-manager, in Debian) : see wishlist ticket #379799 (now closed apparently).

Indeed, the volume must be mounted in order to decrypt its content, and be able to read the volume. So the behaviour cannot be the same as for an unencrypted volume.

I think I’ve found the way it should be modified (see a comment on the ticket), but in the meantime, using fdi files, it’s possible to set a desired mount point for a specific volume (see another comment on the ticket).

Hal and its friends are nice tools, but documentation is hard to find 🙁 … I hope this helps a bit.

3 thoughts on “Auto-mounting crypted LUKS partitions to custom mount point”

  1. Hi Olivier,
    nice tips but I was not able to make it working because it seems that the UUID in the entryped file system cannot be read until the partition will be decrypted (in practice I was able to read the UUID of the mapped logical partition: /dev/mapper/sdc1 and not /dev/sdc1). How did you made it working?
    So it seems to me that I am with the same problem of the file system label that cannot be read until the file system is not mounted…

    Thanks
    Franco Fiorese

  2. Hi Olivier,
    I have found the reason. I made an error in retrieving the UUID from the LUKS USB drive. I should have used the:

    cryptsetup –verbose luksUUID /dev/sdb1

    command to print out the UUID.

    Now it works!
    Regards
    Franco

Leave a Reply

Your email address will not be published.