bcache

Bcache is a caching method which can be used to utilize the power and speed of SSDs to speed up HDDs.

  • Backingdevice has to be a block device (no nfs or other networkfs)

  • raid is possible

There are multiple methods how the cache is populated:

  • wirte to disk and cache

  • write to disk only (writearound)

  • write only to cache

bcache needs to be enabled because its not a default setting.

zypper in bcache-tools

modprobe bcache

reboot?

now there are two files in /sys/fs/bcache/

-register -register_quiet

man make-bcache

to circumvent the process of matching the backing device with the caching device manually its recommended to create them simultaniously.

also make sure you unmounted the partitions you want to associate

umount /dev/sdXn

now we are ready for creation

make-bache -C /dev/sdXn -B /dev/sdXn

-C is caching device

-B is backingdevice obv..

i case theres an error use wipefs -a /dev/sdXn (the caching device) to clear the remaining filesystem

now there is a UUID in /sys/fs/bcache which represents the caching device by its UUID

you can also check in /proc/partitions if you find your bcache device(its a file => cat)

now you can set a filesystem for your newly created bcache device

mkfs -t btrfs -f /dev/bcache0

you can also use ext4 or xfs etc..

to make changes persistent put

/dev/bcache0 /home fstype defaults 1 2

in your fstab

remount your destination e.g mount /home

aaand you are DONE

Leave a Reply

Your email address will not be published. Required fields are marked *

To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four 
    spaces will be stripped off, but all other whitespace
    will be preserved.
    
    Markdown is turned off in code blocks:
     [This is not a link](http://example.com)

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see http://daringfireball.net/projects/markdown/syntax

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>