Hi,
Rather than burning tons of NVMe storage on my Mastodon cache I
thought I'd give bcachefs a go. It was upstreamed into the Linux 6.7
kernel in early January.
Seems to work.
$ uname -a
Linux social0 6.7-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.7.4-1~exp1 (2024-02-08) x86_64
GNU/Linux
$ sudo bcachefs format \
--label=ssd.ssd1 /dev/xvdd \
--label=hdd.hdd1 /dev/xvde \
--foreground_target=ssd \
--promote_target=ssd \
--background_target=hdd
$ sudo mount -t bcachefs /dev/xvdd:/dev/xvde /mnt/cache
$ sudo rsync -SHav /opt/mastodon/web/system/cache/ /mnt/cache/
$ sudo umount /mnt/cache
$ sudo mv /opt/mastodon/web/system/cache{,.old}
$ sudo mkdir /opt/mastodon/web/system/cache
$ sudo mount -t bcachefs /dev/xvdd:/dev/xvde /opt/mastodon/web/system/cache
$ df -h /opt/mastodon/web/system/cache
Filesystem Size Used Avail Use% Mounted on
/dev/xvdd:/dev/xvde 468G 61G 400G 14% /opt/mastodon/web/system/cache
xvdd is a 10GiB NVMe while xvde is a 500GiB HDD. It promotes stuff
to xvdd on read.
The kernel comes from Debian experimental. The only other things
that are needed are:
- about 140MiB of packaged dependencies
- a recent Rust compiler
- building bcachefs-tools from source (just "make; make install"
once you did the above two)
Of course, it may yet all end in tears.
No version of grub understands bcachefs yet so you wouldn't be able
to boot off of it.
https://bcachefs-docs.readthedocs.io/en/latest/index.html
Thanks,
Andy
--
https://bitfolk.com/ -- No-nonsense VPS hosting