Comment 28 for bug 532898

Revision history for this message
TJ (tj) wrote : Re: [Bug 532898] Re: lucid: Failure to bring up cryptsetup devices by key files (when not using "splash")

I've found an alternative method for successfully using the USB key that
doesn't require a custom keyscript, and it is probably the recommended
solution too!

1. Ensure there is an entry for the USB key device in /etc/fstab:

# USB key
LABEL=USB /media/USB auto defaults 0 2

In my case the vfat file-system on the key has the label "USB" (defined
using mkfs.vfat ... -n USB ... when the file-system was created). The
fstab entry could use UUID= instead to match the file-system containing
the key-file.

2. Modify entries in /etc/crypttab so the key-file path includes the
mount-point set in fstab (in this example, "/media/USB"):

var /dev/mapper/Ubuntu-Lucid_var_encrypted /media/USB/home/tj/keyfile luks
home /dev/mapper/Ubuntu-home /media/USB/home/tj/keyfile luks

3. The IMPORTANT bit. Modify /etc/default/cryptdisks and set the
variable CRYPTDISKS_MOUNT to the mount-point defined in fstab:

CRYPTDISKS_MOUNT="/media/USB"

Now restart. There is no 'hiccup' "Waiting for /var [SM]", the splash
screen remains in place, and X starts quickly.

The only aspect of using CRYPTDISKS_MOUNT I haven't yet tested is for
the root file-system, since that will require the initrd image to be
updated, and may or may-not still need the custom keyscript. I'll test
that tomorrow and report back.