Bcache setup help for tiered setup

Hi, first off let start by saying I’m new to Linux and after trying different versions of Ubuntu I’m settling on OpenSUSE Leap. I recently purchase a gaming/workstation rig from Maingear which has a MSI X399 Carbon Pro A/C motherboard, AMD Threadripper 2920X, 32GB DDR4 RAM, GTX 1080 and 1TB PCI2. M2, 512GB PCIe M2 and 3TB SATA HD. I’m looking to a tiered storage solution that will leverage the 512GB M.2 as a super fast cache tier, the 512GB M.2 as a slightly slower tier and the 3TB as the backing device. I came across bcache which seems like it might fit the bill. The problem I’m having is I have no clue how to set this up. Everything I’m reading is really related to Ubuntu but none of the information I have found really go into the details step by step.

Does anyone have a guide or steps I can follow to get bcache setup?

Steps for bcache

  1. Boot to Leap from LIVE USB
  2. Partition using below scheme
  3. sudo wipefs -a /dev/nvme0n1
  4. sudo wipefs -a /dev/sdb

Devices:
512GB M.2 - /dev/nvme1n1
1TB M.2 - /dev/nvme0n1
3TB SATA - /dev/sdb

Partition Layout (Can be changed if needed)

  1. Create partition /dev/nvme1n1p2 (40GB) for / with btrfs
  2. Mount partition /dev/nvme1n1p1 (512MB) at /boot/efi
  3. Create partition /dev/nvme1n1p3 (405GB) for /home with xfs
  4. Create partition /dev/nvme1n1p4 (31GB) for swap

9 subvolumes

  • Create subvolume on /dev/nvme1n1p2
  • Create subvolume /var on /dev/nvme1n1p2 with option ‘no copy on write’
  • Create subvolume /usr/local on /dev/nvme1n1p2
  • Create subvolume /tmp on /dev/nvme1n1p2
  • Create subvolume /srv on /dev/nvme1n1p2
  • Create subvolume /root on /dev/nvme1n1p2
  • Create subvolume /opt on /dev/nvme1n1p2
  • Create subvolume /boot/grub2/x86_64-efi on /dev/nvme1n1p2
  • Create subvolume /boot/grub2/i386-pc on /dev/nvme1n1p2

Hi and welcome to the Forum :slight_smile:
So what’s you end game for the 3TB storage (what is the drive and specs?) to be used for?

Way back on 13.2 I had it running on a test system, normally you set up your system with the OS, then setup your bcache with the SSD and HDD.

In a nutshell, install bcache-tools;

Create your backing device (HDD)


make-bcache -B /dev/sdXN

Create your caching device (SSD)


make-bcache -C /dev/nvmeXnN

Check it’s all good and attach;


ls /sys/fs/bcache/

echo "Set UUID output from cache device" > /sys/block/bcache0/bcache/attach

Set to use writeback and verify it changed;


cat /sys/block/bcache0/bcache/cache_mode
[writethrough] writeback writearound none

echo writeback > /sys/block/bcache0/bcache/cache_mode

cat /sys/block/bcache0/bcache/cache_mode
writethrough [writeback] writearound none

Then check all is created/attached from the output of the command lsblk, then on the bcache0 device create your filesystem and mount (you can do this via YaST partitioner or manually formatting and editing /etc/fstab).

@malcolmlewis

Thank you for the warm welcome. The 3TB HD is Segate BarraCuda 7200RPM SATA III. The intent is for this drive to be a backing device that will hold games, software repo, and video files.

I just realized that bcache can only have 1 SSD cache but multiple backing devices. if I’m understanding your steps below I should install the OS on say the 1TB SSD and use the 512B SSD as the cache device for both the 1TB and 3TB devices. I thinking that for /home I could combine the remaining space from the 512GB and 3TB via LVM and have that backed by bcache.

Hi
Not sure about LVM/bcache but would imagine there should be no issues. I think the only benefit will be from a SSD bcache and the HDD. Why not use the 1 TB SSD for your os, home etc. The 512GB for bcache and swap (I’m guessing for suspend?). No thoughts of running virtual machines?