.. | .. |
---|
5 | 5 | Say you've got a big slow raid 6, and an ssd or three. Wouldn't it be |
---|
6 | 6 | nice if you could use them as cache... Hence bcache. |
---|
7 | 7 | |
---|
8 | | -Wiki and git repositories are at: |
---|
| 8 | +The bcache wiki can be found at: |
---|
| 9 | + https://bcache.evilpiepirate.org |
---|
9 | 10 | |
---|
10 | | - - http://bcache.evilpiepirate.org |
---|
11 | | - - http://evilpiepirate.org/git/linux-bcache.git |
---|
12 | | - - http://evilpiepirate.org/git/bcache-tools.git |
---|
| 11 | +This is the git repository of bcache-tools: |
---|
| 12 | + https://git.kernel.org/pub/scm/linux/kernel/git/colyli/bcache-tools.git/ |
---|
| 13 | + |
---|
| 14 | +The latest bcache kernel code can be found from mainline Linux kernel: |
---|
| 15 | + https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/ |
---|
13 | 16 | |
---|
14 | 17 | It's designed around the performance characteristics of SSDs - it only allocates |
---|
15 | 18 | in erase block sized buckets, and it uses a hybrid btree/log to track cached |
---|
.. | .. |
---|
41 | 44 | to be flushed. |
---|
42 | 45 | |
---|
43 | 46 | Getting started: |
---|
44 | | -You'll need make-bcache from the bcache-tools repository. Both the cache device |
---|
| 47 | +You'll need bcache util from the bcache-tools repository. Both the cache device |
---|
45 | 48 | and backing device must be formatted before use:: |
---|
46 | 49 | |
---|
47 | | - make-bcache -B /dev/sdb |
---|
48 | | - make-bcache -C /dev/sdc |
---|
| 50 | + bcache make -B /dev/sdb |
---|
| 51 | + bcache make -C /dev/sdc |
---|
49 | 52 | |
---|
50 | | -make-bcache has the ability to format multiple devices at the same time - if |
---|
| 53 | +`bcache make` has the ability to format multiple devices at the same time - if |
---|
51 | 54 | you format your backing devices and cache device at the same time, you won't |
---|
52 | 55 | have to manually attach:: |
---|
53 | 56 | |
---|
54 | | - make-bcache -B /dev/sda /dev/sdb -C /dev/sdc |
---|
| 57 | + bcache make -B /dev/sda /dev/sdb -C /dev/sdc |
---|
| 58 | + |
---|
| 59 | +If your bcache-tools is not updated to latest version and does not have the |
---|
| 60 | +unified `bcache` utility, you may use the legacy `make-bcache` utility to format |
---|
| 61 | +bcache device with same -B and -C parameters. |
---|
55 | 62 | |
---|
56 | 63 | bcache-tools now ships udev rules, and bcache devices are known to the kernel |
---|
57 | 64 | immediately. Without udev, you can manually register devices like this:: |
---|
.. | .. |
---|
188 | 195 | If bcache is not available in the kernel, a filesystem on the backing |
---|
189 | 196 | device is still available at an 8KiB offset. So either via a loopdev |
---|
190 | 197 | of the backing device created with --offset 8K, or any value defined by |
---|
191 | | ---data-offset when you originally formatted bcache with `make-bcache`. |
---|
| 198 | +--data-offset when you originally formatted bcache with `bcache make`. |
---|
192 | 199 | |
---|
193 | 200 | For example:: |
---|
194 | 201 | |
---|
.. | .. |
---|
210 | 217 | |
---|
211 | 218 | After you boot back with bcache enabled, you recreate the cache and attach it:: |
---|
212 | 219 | |
---|
213 | | - host:~# make-bcache -C /dev/sdh2 |
---|
| 220 | + host:~# bcache make -C /dev/sdh2 |
---|
214 | 221 | UUID: 7be7e175-8f4c-4f99-94b2-9c904d227045 |
---|
215 | 222 | Set UUID: 5bc072a8-ab17-446d-9744-e247949913c1 |
---|
216 | 223 | version: 0 |
---|
.. | .. |
---|
318 | 325 | |
---|
319 | 326 | The default metadata size in bcache is 8k. If your backing device is |
---|
320 | 327 | RAID based, then be sure to align this by a multiple of your stride |
---|
321 | | - width using `make-bcache --data-offset`. If you intend to expand your |
---|
| 328 | + width using `bcache make --data-offset`. If you intend to expand your |
---|
322 | 329 | disk array in the future, then multiply a series of primes by your |
---|
323 | 330 | raid stripe size to get the disk multiples that you would like. |
---|
324 | 331 | |
---|