Skip to contentSkip to conversation

bcachefs as a caching filesystem

DISCUSSION Dr.-Ing. Heiko Münkel 1 participant 1 message Apr 9, 2023

lore
Share & tools
lore
#0 lore raw

Hello,

I am in the process of testing bcachefs. I have two partitions /dev/nvme0n1p1 and /dev/sde1. The first (internal SSD) should be as cache for the second (is an SSD on a USB3 port).

First I created the bcachefs file system with:
  sudo bcachefs format \
       --label=Shotwell-3 /dev/sde1 \
       --label=Shotwell-Cache-1 /dev/nvme0n1p1 \
       --foreground_target /dev/nvme0n1p1 \
       --promote_target /dev/nvme0n1p1 \
--background_target /dev/sde1
and then mount the disks with
 sudo mount -t bcachefs /dev/nvme0n1p1:/dev/sde1 /mnt

This worked fine so far. I then used dd to create a 100GB file on /mnt and found, as expected, that the file was written much faster.

Since I occasionally want to use the external disk on another machine, I then tried disconnecting the cache from the array.

Since I didn't really find anything in the documentation about this, I tried the following command (after the external disk had come to rest and thus the 100GB file was presumably also on the disk):
    bcachefs device evacuate /dev/nvme0n1p1

After this command, it took what felt like hours for the external disk to come to rest again. Is this normal?

Is this the right command for this case, or do I have to use the command bcachefs device offline /dev/nvme0n1p1
to disconnect the cache and
  bcachefs device online /dev/nvme0n1p1
to reconnect?

Thanks for your help,

Heiko