4

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?
Anthon
  • 78,313
  • 42
  • 165
  • 222
molgaard
  • 53
  • 5
  • If you get this going, I'm interested in a benchmark. My guess is that it won't help you any. If LUKS is your bottleneck, caching does next to nothing (not without making the encryption useless). If the disk is the bottleneck, on a desktop/laptop you're most likely better off putting the system and /home onto the SSD directly and leave the disk for the big and slow things. Also has the advantage that you can send the disk to sleep entirely while not in use, whereas a cache will always use the disk. – frostschutz May 24 '13 at 18:04
  • Thank you for the suggestions! As stated, the SSD is only 16Gb, so I don't really think putting / and /home on there is a viable option. Mostly, I just wanted to see if anything good would come of it, but I guess both / and the SSD partition will need to be encrypted, so I hope LUKS won't turn out to be that much of a bottleneck (I seem to remember reading that 3.10 contains some speedups in this regard as well). I shall experiment when I get the time, and do some benchmarks before and after as well when I do. – molgaard Jun 24 '13 at 07:46

2 Answers2

2

I've put a quick intro to bcache conversion on AskUbuntu. You can use lsblk to figure out which stacked device to convert, which should be the partition that contains LUKS data.

Gabriel
  • 789
  • 5
  • 9
  • This procedure doesn't work any more on Ubuntu 15.04; see http://askubuntu.com/questions/252140/how-do-i-install-and-use-flashcache-bcache-to-cache-hdd-to-ssd#comment922725_340059 – Jean Jordaan Jul 03 '15 at 18:06
0

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.

enigmaticPhysicist
  • 1,333
  • 1
  • 11
  • 17