I recently bought a 240 GB SSD to speed up my computer with 1 TB HDD. I dual boot Windows and Linux. I want to use my new SSD in the most effective way. Reading through many sites led me to conclusion that, for Linux, bcache is the way to go. I want to make sure that my understanding of bcache is correct.

So, I wanted to put commonly used data on SSD and rest on HDD. However I play games on both Windows and Linux, so 240 GB is not quite enough for both (I also use several programs, that use several gigabytes of space). So I wanted to partition my SSD in two ~120 GB partitions, one for Intel Smart Response (for Windows) and second for caching partition for bcache. Now, here is what I've gathered about bcache:

  • Bcache acts as a layer between HDD and RAM
  • I can have many backing devices/partitions (that are on HDD) that are cached by caching partition (on SSD). Their size may be larger than caching partition.
  • Recently read data is put on SSD for later use
  • I mount only caching device and not any backing partitions and see files, that are on those backing partitions
  • Converting existing partitions to be used as backing partitions for bcache is troublesome but possible
  • Resizing backing partitions is also possible but troublesome

Now here are my questions:

  1. Is my knowledge about bcache correct?
  2. Sequential I/O is ignored by bcache. How does it work with loading games?
  3. Can I shuffle my partitions or move their beginnings? (does bcache use UUID or /dev/sdxx when selecting partitions?)
  4. I read, that it's not recommended to put partitions such as /tmp or /var on SSD, because constant read/writes will wear the SSD. Should I have those on separate partitions and not set them as backing partitions?
  5. What about swap? Should I put it on SSD?
  6. Is there any other solution, that would suit my needs better than bcache?

Last one is a little bit complicated. I tried to set up pci passthrough of my GPU to windows guest. I managed to boot in vm the system, that I have normally installed on my hdd. So I can boot same windows either natively or through VM. Since I wanted to make minimal changes to hardware that is seen by Windows I passed through entire HDD to VM. Windows only uses its NTFS partitions and my Linux uses remaining ones. Will there be any problems with bcache and that setup?

For the record, I use elementary OS (based on Ubuntu 16.04).

  • IMHO this question would fit at Super User (also) quite well. – phk Dec 24 '16 at 16:40
  • @phk Should I repost it there or would it be violation of some rules? – marmelada Dec 24 '16 at 23:52
  • Great question, but a little to complex. I'd split it into many separate problems. Don't do that just yet - let's first see, how the question turns out, but please number all those 6 questions you ask, so it will be easier to address them. – Adam Ryczkowski Dec 25 '16 at 10:52

Ad question 1.

I mount only caching device and not any backing partitions and see files, that are on those backing partitions

Not true - you mount the bcache device. It must internally be composed from at least one hdd device. The ssd cache is actually optional - so you still can access your data, even if your ssd is dead. At least if you use it with default settings.

Rest is True.

Ad question 2.

Yes, there is a heuristic in bcache module that tries to distinguish between sequential and random reads. But it works based on the level individual system calls - bcache is filesystem agnostic: It doesn't even know that it reads files. So it all boils down to how the game actually loads the data and what system calls are eventually used. If the game uses Name your game and see, if anyone did benchmark it. Or better yet: benchmark it yourself. Bcache did speed up my systems considerably, but I play no games on them.

Ad question 3.

Yes, the bcache use UUID when selecting partitions. Did you read its documentation? Please, do.

Ad questions 4 and 5.

It depends on how much you want to trade system's speed vs ssd degradation and how much RAM you have (/tmp is often tmpfs which is RAM-backed).

Ad question 6.

There are/were at least 2 viable alternatives to bcache which I systematically evaluated. I decided to invest in bcache - mostly for speed and compatibility and popularity. That was in 2014.

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.