Ubuntu – BCache and disk encryption

bcachelinuxluksUbuntu

I recently bought a new laptop with a 16Gb mSATA SSD cache drive. I haven't used that one yet.

I have, however, opted for Ubuntu 13.04 with "Full Disk Encryption" for the main partition (is that what's called LUKS?).

With bcache making it's way into 3.10, I'd like to take advantage of the aforementioned cache drive.

According to this, one has to format one's backing and cache drives in order to take advantage of bcache.

My questions are:

  1. Which order do I proceed in? Set up bcache, then (re)setup LUKS or the other way around?
  2. Except for the few files pertaining to the encrypted setup (incl. /etc/fstab), can I tar/rsync/whatever the rest of the existing fs to another disk, set up bcache and LUKS and then tar/rsync/whatever back and expect things to work?
  3. Are there other things I should know about?

Best Answer

To answer 1., the most sensible thing to do is to put bcache on top of two LUKS virtual devices. LUKS-encrypting a bcache device might work, but there's no guarantee LUKS will consistently put the same virtual sector in the same physical sector every time. You can encrypt both LUKS devices with the same keyfile and unlock both at the same time.

Related Question