bcache not working as expected with ramdisk as cache device
3
votes
1
answer
3483
views
I was trying out bcache but i don't have an SSD so wanted to use free memory as a substitute. As ramdisk is listed in
/proc/devices
as block device i assumed this would work OK but with below simple test i can't get it working.
This is on Ubuntu 15.10 with latest 4.5 kernel installed and i'm using the default /dev/ram
devices as my SSD substitute.
losetup -f
dd if=/dev/zero of=/tmp/bcache_origin bs=1M count=200
losetup /dev/loop2 /tmp/bcache_origin
make-bcache -B /dev/loop2 -C /dev/ram9
No error or output was given from make-bcache
. At this point i expect for the new bcache device to be listed in below paths either by UUID or name but there is nothing.
ls -al /sys/fs/bcache/
ls -al /sys/block/bcache*
Here is outputs from cache-super-show
for cache
bcache-super-show /dev/ram9
sb.magic ok
sb.first_sector 8 [match]
sb.csum 53EDD9C169F73E1B [match]
sb.version 0 [cache device]
dev.label (empty)
dev.uuid 2189aa3b-67e7-4296-bb25-6b5ba886befa
dev.sectors_per_block 1
dev.sectors_per_bucket 1024
dev.cache.first_sector 1024
dev.cache.cache_sectors 130048
dev.cache.total_sectors 131072
dev.cache.ordered no
dev.cache.discard no
dev.cache.pos 0
dev.cache.replacement 0 [lru]
cset.uuid 0a6b3824-72c1-489e-9d96-d976cb49e8a9
and origin
bcache-super-show /dev/loop2
sb.magic ok
sb.first_sector 8 [match]
sb.csum ECBC84E42E6F52B9 [match]
sb.version 1 [backing device]
dev.label (empty)
dev.uuid aff690a4-7ee1-4b62-85cc-ad41c775d7d8
dev.sectors_per_block 1
dev.sectors_per_bucket 1024
dev.data.first_sector 16
dev.data.cache_mode 0 [writethrough]
dev.data.cache_state 0 [detached]
cset.uuid 0a6b3824-72c1-489e-9d96-d976cb49e8a9
I also tried using loop devices for both but that failed even worse. Running below command results in nasty kernel BUG
dump in dmesg.
losetup -f
dd if=/dev/zero of=/tmp/bcache_data bs=1M count=200
dd if=/dev/zero of=/tmp/bcache_cache bs=1M count=200
losetup /dev/loop5 /tmp/bcache_data
losetup /dev/loop6 /tmp/bcache_cache
make-bcache -B /dev/loop5 -C /dev/loop6
ll /sys/fs/bcache/
Has anyone successfully got a ramdisk to work as caching device with bcache ? Without any sort of stdout/err to indicate where it's failing i'm not sure if this is my miss-configuration or a bug.
Thanks
fLo
Asked by Flo Woo
(243 rep)
Feb 17, 2016, 09:18 AM
Last activity: Nov 14, 2023, 12:15 PM
Last activity: Nov 14, 2023, 12:15 PM