Dear slackers,
For a year or so now (well, since the release of 14.1 I guess) I have had my main work system as slackware 14.1 on a portable usb 3.0 drive. Since it's easy to lose this it is encrypted according to the section "Combining LUKS and LVM" on
README_CRYPT.TXT from the top directory of the slackware tree.
A few extra things were needed which are summarised in the mkinitrd command I used:
Code:
mkinitrd -c -k 3.10.17-smp -f ext4 -r /dev/cryptvg/root -m hid_generic:usb-storage:xhci-hcd:ehci-hcd:ehci-pci:ext4:hid-logitech-dj:hid-microsoft:uhci-hcd:usbhid -C /dev/sdb2 -w 5 -h /dev/cryptvg/swap -L -u -o /boot/initrd-5sec.gz
I've included extra modules there for usb keyboards so I can enter the passphrase etc. But the thing I'm mainly concerned with is the
part. That's what tells it to unlock /dev/sdb2 using cryptsetup so the root filesystem can be accessed.
This works fine, although luckily all the machines I boot it with only have a single disk, so the usb disk is always allocated /dev/sdb.
What I would *ideally* like to do is refer to the disk by its uuid instead of /dev/sdb. However I haven't been able to work out how to do this. There are various threads discussing doing this with an unencrypted usb disk (by adding things to /etc/fstab) but in the encrypted case I believe it has to happen at this stage.
It was a while ago since I tried this, but from memory one problem was that in the initrd filesystem there was no /dev/disk/by-uuid (although from memory I think there was /dev/disk/by-label, although the funny characters in the labels disagreed with mkinitrd I think); this I found out by exploring at the prompt that was offered during boot when the root filesystem couldn't be found. I tried putting a larger -w value on the mkinitrd command line but it was never populated no matter how long I asked it to wait.
A workaround is to create a different initrd for each possibility (sdb,sdc,sdd, etc) and then (hopefully) select the right one at the boot screen. However it would be nicer to use uuid (my current motivation is that I've just ordered a machine with 4 disks).
Does anyone know if this is (or isn't) possible?
Many thanks,
Michael