Possible to link Disk UUID to /dev/sdX?

Latest response

Looking to automate the decryption of a RAID1 device by using systemd and keyfiles. There are two SSDs that I am encrypting with LUKS, and so each disk has its own keyfile. The problem I am running into is that disk 1 and disk 2 do not always respectively map to /dev/sdb and /dev/sdc, so the standard cryptsetup decryption doesn't work consistently (basically it's a 50/50 shot).

It looks like there is a way to perform luksFormat/Close/Open on a UUID device path, but it seems a little confusing. Before I go down that path, is there a way to "reserve" /dev/sdb for disk 1 and /dev/sdc for disk 2, if they are present? I do not want to mount to the filesystem as there is hardware-level encryption and a few system checks to perform first.

Responses