You are not logged in.

#1 2017-04-17 16:07:31

nticompass
Member
From: /home/nticompass/
Registered: 2009-12-08
Posts: 55
Website

Cannot attach bcache cache device to backing device

I have an LVM and I wanted to use bcache to cache one of its LVs.  (Yes, I know I could use lvmcache, but I was having issues booting and I gave up using it.)

First, I used blocks to convert the LV to a bcache backing device (this seemed to actually work!):

blocks to-bcache /dev/my_vg/my_lv

I created a caching device on my SSD:

make-bcacke --block 4k --bucket 2M -C /dev/sdc4

I then attempted to attach the cache to the backing device:

bcache-super-show /dev/sdc4 | grep cset.uuid
echo 'above_uuid' > /sys/block/bcache0/bcache/attach

I then rebooted my machine (after adding `/dev/bcache0` to `/etc/fstab`) and realized that the cache wasn't running.

# cat /sys/block/bcache0/bcache/state
no cache

# bcache-super-show /dev/my_vg/my_lv | grep cache_state
dev.data.cache_state	0 [detached]

Am I missing something?  Is there another command I need to use to enable caching?

Why does bcache not like my cache device and not letting me attach it to my backing device?  Did I use the wrong values for `--block` and `--bucket`?

Offline

Board footer

Powered by FluxBB