It's been a while since I've been toying with Arch, but I have managed to get myself in trouble again.
On my laptop I'm trying to run Arch partially encrypted. Everything works out fine, encryption (dmcrypt/luks) works as expected.
Now the part I'm having troubles with:
I map my encrypted partitions with a keyfile, which I want to store on a CF (Compact Flash) card in a PCMCIA cardreader. This means if the card is not present some of my partitions cannot be mounted. The flash card is recognized out of the box and is assigned /dev/sdb1 (which I mounted ro at /mnt/flash), so I thought I could get away with just putting my keyfile on the card, adjust my crypttab and go with it. Problem is, the flash drive is mounted later than the rest of my partitions, which means my encrypted partitions will fail to mount.
How can I prioritise the mounting of my cf card so I can get my encrypted partitions to mount properly? I've toyed with the order in the fstab file and lowered the number of the PCMCIA stuff in udev, but so far no luck. Anybody any tips?
Last edited by Olli (2008-05-24 15:25:56)
The order of records in fstab is important because fsck(8), mount(8), and umount(8) sequentially iterate through fstab doing their thing.
But have a look at /etc/rc.sysinit: Crypttab is processed before any mounting is done (even before / is remounted rw), so I think if you want to use the CFcard you need to edit rc.sysinit to get it mounted before crypttab is processed.
Ah yes, nice one, well spotted, works like a charm now
Just a quick note: upgrading initscript will (of course) overwrite rc.sysinit.