Skip to main content
4 votes

Cannot attach cache device to backing device

I had the same problem: make-bcache --block 4k --bucket 2M -C /dev/nvme0n1p1 caused the write error: Invalid argument. Specifically, it was the --block 4k that caused the problem. make-bcache --...
caleb c.'s user avatar
  • 141
4 votes
Accepted

Cannot attach cache device to backing device

I managed to fix this by re-creating the superblock on /dev/sdc4. Looks like the --block 4k --bucket 2M was incorrect and that's why the cache device wasn't attaching. I cleared the superblock, ...
gen_Eric's user avatar
  • 493
4 votes
Accepted

Equivalent of `btrfs send` and `btrfs recv` for bcachefs

The roadmap for bcachefs mentions it: Send and receive: Like ZFS and btrfs have, we need it to. This will give us the ability to efficiently synchronize filesystems over a network for backup/...
A.B's user avatar
  • 37.1k
3 votes
Accepted

Getting files off bcache disk from different computer

Mounted the bcache partition to a loop device with sudo losetup -f /dev/[DEVICE] -o 8192 The bcache data is probably only 1KiB or less, but the offset needs to align with the sector size of the disk, ...
PSpacer's user avatar
  • 153
3 votes

Convert existing LVM LV to bcache backing device

Overview Having looked at the source for blocks, what it does is: Shrink the LV's filesystem is shrunk by one LVM PE Shrink the LV itself by one LVM PE (this guarantees one free PE to be used for ...
Tom Hale's user avatar
  • 31.1k
3 votes
Accepted

bcache: is sequential_cutoff and other parameters supposed to be permanent?

For stuff like writeback, it is stored permanently on disk. However for stuff like sequential_cutoff, readahead, etc. those require you to reset them every boot (you can do this with a script / ...
Xyletic's user avatar
  • 46
3 votes
Accepted

Bcache writeback_percent max value

This is hardcoded value in the bcache drive code - linux/drivers/md/bcache/writeback.h. The only way to change this limit is to rebuild the driver from source.
V.Gorbunov's user avatar
3 votes

bcache not working as expected with ramdisk as cache device

some devices need to be registered in order to be used after making the cache devices with # make-bcache -B /dev/loop2 -C /dev/ram9 you need to register both (at least the ramdisk though, loop ...
CorvusCorax's user avatar
3 votes
Accepted

Is bcache solution for my ssd use case?

Ad question 1. I mount only caching device and not any backing partitions and see files, that are on those backing partitions Not true - you mount the bcache device. It must internally be ...
Adam Ryczkowski's user avatar
2 votes

What is grinding my HDDs and how do I stop it?

Thanks to meuh & frostschutz I was able to identify the offending process. It seems mdadm was doing some post-synchronisation stuff on the array (I replaced a drive a few days ago in the RAID-5 ...
velis's user avatar
  • 397
2 votes

How do I remove the cache device from bcache?

One-liner: echo $(ls -d /sys/fs/bcache/*-*-* | cut -f5 -d/) > /sys/block/bcache0/bcache/detach Then wait until cached clears: while true; do if [[ $(cat /sys/block/bcache0/bcache/state) != "...
sanmai's user avatar
  • 1,436
2 votes

Bcache writeback_percent max value

According to https://evilpiepirate.org/git/linux-bcache.git/tree/Documentation/bcache.txt writeback_percent If nonzero, bcache tries to keep around this percentage of the cache dirty by throttling ...
hjohanns's user avatar
2 votes

LVMCache: Why use a cachepool instead of a cachevol?

A concrete reason to use a cachepool instead of a cachevol, is that, as of early 2024, the maintenance tools for dm-cache do not understand cachevols. lvconvert --repair on a damaged cachevol will ...
zwol's user avatar
  • 7,193
2 votes

Cannot register bcache backing device: Invalid argument

First, try some clean-up: echo $cset_uuid | sudo tee /sys/fs/bcache/pendings_cleanup echo $backing_uuid | sudo tee /sys/fs/bcache/pendings_cleanup Use bcache-super-show to get the uuids. Then try ...
Tom Hale's user avatar
  • 31.1k
1 vote

Bcache is not being utilized, slow raid/transfer rates

sequential_cutoff was the setting to configure to fix the write speeds. By default sequential_cutoff is 4Mb which means anything over 4Mb will be directly written to the hard drive. I tried 2048Mb and ...
PleasantTiming's user avatar
1 vote
Accepted

How can you check how much of a bcache cache is currently in use?

The stats for the cache device of a certain bcache cache set can be queried using /sys/fs/bcache/$CSET_UUID/cache0/priority_stats. Among other information, it contains the unused field.
Atemu's user avatar
  • 687
1 vote

Is it possible to avoid cached data duplication in bcache and Btrfs RAID1?

What works for me is caching the entire array instead of each device behind the array. Cache the RAID instead of RAIDing the caches. It's discussed more in detail here
Jangita's user avatar
  • 111
1 vote

Using LVMCache or BCache for Hot-Warm-Cold Caching

This solution uses both dm-cache for the SLC (Hot) and QLC (Warm) SSDs, and bcache for the backing device (HDD/Cold). #!/bin/bash # Step 1: Set up dm-cache # Create the cache device with the SLC SSD ...
warashi nguyen's user avatar
1 vote
Accepted

Can bcache have non-zero dirty cache forever?

That appears to be expected behaviour. Write-back mode is usually safe because the caching device is journalled. Bcache will rewrite all dirty data after (unexpected) reboots to the persistent ...
carbolymer's user avatar
1 vote
Accepted

Compiling kernel from source got a fatal error: too few arguments to function 'part_round_stats'

Try this instead: rpm -ivh kernel-3.10.0-957.el7.src.rpm cd ~/rpmbuild/SOURCES rpmbuild -bp kernel.spec cd ~/rpmbuild/BUILD/kernel-3.10.0-957.el7/linux-3.10.0-957.fc32.x86_64 make menuconfig make ...
Artem S. Tashkinov's user avatar
1 vote
Accepted

Testing bcache with raspberry pi 4 on ubuntu

I managed to solve this issue with the instructions of https://www.raspberrypi.org/forums/viewtopic.php?t=245931 this topic. This is due to Raspberry PI 4 USB 3.0 UASP driver issue and it make my ...
sameera's user avatar
  • 304
1 vote
Accepted

Are btrfs reads round-robin or throughput maximising?

no, at the moment btrfs raid1 chose the device to read from based on the pid of the process (ie: if the pid is even read from disk 0, if the pid is odd read from disk 1). Anyway, recently this has ...
Gibraltar's user avatar
  • 126
1 vote

Access bcache backing data without bcache (eg from Windows)

bcache.txt says: Recovering data without bcache: If bcache is not available in the kernel, a filesystem on the backing device is still available at an 8KiB offset. So either via a loopdev ...
Tom Hale's user avatar
  • 31.1k
1 vote

Using dm-cache for transparent ongoing backup

No, this won't work. There's no method for "pushing" non-dirty blocks in the cache to the origin device. You will have dirty blocks temporarily which have not been written to the origin device, which ...
GoldenNewby's user avatar
1 vote

Installing bcache on debian9

you should specify "--block 4k" for backing device as well make-bcache --block 4k -B /dev/sdx1
edo1's user avatar
  • 241
1 vote

Getting files off bcache disk from different computer

To extend PSpacer's answer based on answers here D) Recovering data without bcache: If bcache is not available in the kernel, a filesystem on the backing device is still available at an 8KiB ...
Douglas Gaskell's user avatar
1 vote

Error while installing Bcache on centOS

You have LVM set up on /dev/sda2, so you need to run make-bcache on the logical volumes (LVs) instead of the raw partition. If you want to use both the centos-root and centos-home LVs as backing ...
Vincent Yu's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible