eternaltyro / cryptsetup

Since Google code is shuttering...
http://code.google.com/p/cryptsetup
GNU General Public License v2.0
0 stars 0 forks source link

encrypting tmp can fail when disk device name changes #138

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
Add an encrypted tmp partition to system:
1. In /etc/crypttab, add the line:
tmp /dev/sdc6 /dev/urandom tmp
...where the /tmp partition is /dev/sdc6 (change as necessary)

2. In /etc/fstab, add the line:
/dev/mapper/tmp /tmp ext2 defaults 0 2

3. Reboot several times, adding and removing USB flash drives before booting.

What is the expected output? What do you see instead?

Most times, the same drive will be /dev/sdc, but sometimes it may change to 
/dev/sdd in which case the boot fails.
This is the reason why we are encouraged to use UUIDs. 

However, plain encrypted (non-LUKS) partitions don't have UUIDs. When the 
device path changes on boot, we're screwed. 

What version of the product are you using? On what operating system?
cryptsetup-1.5.0 on Fedora 17

Please provide any additional information below.
Solution:
Add support for ID=... as seen in /dev/disk/by-id
similar to how UUID=... can be mapped from /dev/disk/by-uuid

Original issue reported on code.google.com by duane-t...@shaw.ca on 10 Nov 2012 at 5:41

GoogleCodeExporter commented 9 years ago
But you can use this /dev/disk/by-id/ link in crypttap directly...

And yes, kernel names (/dev/sdX) are not persistent.

It is trivial to add, but ID mapping is not supported neither for fstab nor 
mount, moreover device by-id naming is not standardized (UUIDs have at least 
defined format).

(UUID= in cryptsetup was extension to be complementary to mount UUID, it should 
not add anything new here.)

Original comment by gmazyl...@gmail.com on 10 Nov 2012 at 10:01