Bcache

From HackerNet
Revision as of 21:51, 15 January 2016 by Helikopter (talk | contribs) (Created page with "Bcache är en Linux kernel block layer cache. =Installation= sudo add-apt-repository ppa:g2p/storage sudo apt-get update && sudo apt-get -y install bcache-tools =Konfigur...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Bcache är en Linux kernel block layer cache.

Installation

sudo add-apt-repository ppa:g2p/storage
sudo apt-get update && sudo apt-get -y install bcache-tools

Konfiguration

Först skapar man caching devices, SSDer.

sudo make-bcache -C /dev/sdc1

Sedan skapar man backing devices, HDDer.

sudo make-bcache -B /dev/sdb1

Registrera samtliga devices. (Endast om inte udev används på systemet)

sudo echo /dev/sdX1 > /sys/fs/bcache/register

Attach

ls /sys/fs/bcache
echo bcache-UUID > /sys/block/bcache0/bcache/attach

Skapa filsystem och mounta.

Writeback

Default är det read cache (writethrough), för att slå på write cache.

echo writeback > /sys/block/bcache0/bcache/cache_mode