My linux fileserver has four LUKS-encrypted USB-3 disks. It's a bit confusing to mount them all: while they might get the same drive letters as last time, they might not, which leads to some trial and error.
To mount them, I would normally say something like this (typically for each of c, d, e, and f):
sudo cryptsetup open --type luks /dev/sdc d1
sudo mount /dev/mapper/d1 /d1
(Note that the threat scenario here is someone stealing my hardware. The goal is that when it powers down, it needs me to bring it up again. It is acceptable that the fileserver does not serve files in my absence.)
I can see UUID's in /dev/disk/by-uuid/
, though these are not the LUKS UUID's. I suspect they are stable.
I also see USB port info in /dev/disk/by-path/
(not so good, depends where it's plugged in) and WWID's in /dev/disk/by-id/
. In both cases, I could construct a short script (to run by hand) that scans for familiar names, uses sed
to pull out the drive number, and then executes the two lines above to open and mount the volume.
But perhaps this problem has a better solution. Any suggestions?