Skip to content

Instantly share code, notes, and snippets.

@daniel-svard
Last active April 11, 2020 10:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daniel-svard/3303b98ec222216e40bf87a74dcf07a3 to your computer and use it in GitHub Desktop.
Save daniel-svard/3303b98ec222216e40bf87a74dcf07a3 to your computer and use it in GitHub Desktop.
Installation of Manjaro Linux onto a BCache root device

Boot Manjaro Architect

Install BCache Tools

sudo pacman -Sy --needed yay base-devel
yay -S bcache-tools

Partition Disks

Create the following partitions on the HDD (/dev/sda):

  1. Boot partition (512M). Make sure to set the boot flag. (/dev/sda1)
  2. Swap partition (same size as RAM). Make sure to set type to Linux swap (ID 82). (/dev/sda2)
  3. Root partition (rest of disk). (/dev/sda3)

We will use the whole SSD (/dev/sdb) as cache, so no need to partition it.

Create the BCache Device

sudo make-bcache -B /dev/sda3 -C /dev/sdb

The bcache device should now be available at /dev/bcache0

Create the Filesystems

sudo mkfs.ext4 /dev/sda1
sudo mkswap /dev/sda2
sudo mkfs.btrfs /dev/bcache0
sudo mount /dev/bcache0 /mnt
sudo btrfs subvolume create /mnt/root
sudo umount /mnt

Mount Filesystems

sudo mount /dev/bcache0 -o subvol=root,compress=lzo /mnt
sudo mkdir /mnt/boot
sudo mount /dev/sda1 /mnt/boot
sudo swapon /dev/sda2

Run Setup

@DrSensor
Copy link

So manjaro-architect doesn't have an option to choose /dev/bcache0 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment