You are not logged in.

#1 2018-07-06 12:26:35

robg
Member
Registered: 2015-03-05
Posts: 225

[SOLVED] Fstab in a dm-crypt setup

I have read the wiki article on disk encryption and set up my disk according to the simple layout with LUKS. Everything is working flawlessly, but I have a technical question concerning the fstab entry for the encrypted partition. As usual, during the installation process, I have run `genfstab -U` and hence the filesystem column entry for the encrypted partition reads

# <file system>
# /dev/mapper/cryptroot
UUID=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXX

where the repeated X string is a placeholder for the correct UUID of my device. If I understood the wiki articles correctly, then dm-crypt works by providing a virtual device in between the filesystem and the disk that abstracts away the encryption/decryption process. In my setup this device is `/dev/mapper/cryptroot`.

My question concerns the fstab entry: Why is it working correctly with root identified at the "lower" level (i.e. the partition identified by its UUID) which contains the encrypted data and not by the abstract `/dev/mapper/cryptroot` path (which incidentally is added as a comment)? In fact, searching through various threads, I have seen that seemingly either location can be provided. My guess (please excuse my laziness; I don't feel like searching for a document that elaborates on this question) would be that the kernel is able to figure out that the device located at UUID=... is encrypted and has been unlocked, so `/dev/mapper/cryptroot` is mounted instead. Can someone please provide insight on what is going on?

Solution: See post #5 here. The correct procedure is to add the UUID of the virtual node `/dev/mapper/cryptroot` in fstab. My confusion, similar to that of the author of the linked post, stemmed from the fact that I did not realize that the physical device `/dev/sdaX` where the encrypted data resides and `/dev/mapper/cryptroot` were assigned different UUIDs.

Last edited by robg (2018-07-08 22:21:02)

Offline

Board footer

Powered by FluxBB