[dm-crypt] renaming of device

Milan Broz mbroz at redhat.com
Sun Jan 10 21:33:13 CET 2010


On 01/10/2010 08:49 PM, Arno Wagner wrote:
> Just found out why I did not notice this before:
> When the disk is not present at mount time, the 
> respective entry is not created in /dev/scsi/
> and you get the traditional output. I think
> "status" should always give the traditional one 
> as it has a fixed mapping between major/minor and 
> device (see Documentation/devices.txt in the 
> Linux sources), while the /dev/scsi/ entry has not.

Cryptsetup simple tries to map major:minor number back
to device name in /dev.
(device-mapper know only major:minor pair - see dmsetup table)

The algorithm is very simple (and was probably written before
udev was used so these special links in /dev did not exist).

So it need to add some preferred names and not print the first entry.

Please can you add an issue to project pages to not forget about this?
Probably good idea to fix it in next minor release.

p.s. while the major:minor pair is fixed to device name,
device name is not fixed to real disk drive.
You can add some hw, or initialise modules in different order
and disk name changes e.g. from /dev/sdb to /dev/sdd.

Usually it is better use UUID instead of device name and use blkid
to search for device (blkid supports LUKS header).

Milan


More information about the dm-crypt mailing list