Can I use BTRFS RAID with manual partitioning?

I run my system with a separate disk fro home file in a RAID. I discovered yesterday that BTRFS has a builtin functionality of doing RAID setups. I want to try that.

A friend told me that even with manual partitioning the snapshots setup is done regardless so I wonder if I can setup BTRFS RAID for install. I know I need to add some module to initram image but don't know how or which module. I think borked my system yesterday because of not adding that to initram, it complained about boot partition not being mounted and the Live session couldn't repair the grub install because of this so I had to reinstall (but I really don't know what happened). Anyways I intend to reinstall because I forgot hibernation this time around.

Why not just use symlinks to your data on the separate drive? It's so much simpler.

3 Likes

Don't know much about RAID, but at a quick search into the forum I found a couple of good starting points for you to read:
https://btrfs.wiki.kernel.org/index.php/Using_Btrfs_with_Multiple_Devices
https://wiki.archlinux.org/title/Btrfs#Multi-device_file_system
Both come from @Bro above :wink:

3 Likes

The problem is this, that I don’t know which module to add and how. I think that I would have to chroot after installation and add it.

ls /etc/modprobe.d/modprobe.conf
"/etc/modprobe.d/modprobe.conf": No such file or directory (os error 2)

Follows the text from here

Registration in /etc/fstab

If you don’t have an initrd, or your initrd doesn’t perform a btrfs device scan, you can still mount a multi-volume btrfs filesystem by passing all the devices in the filesystem explicitly to the mount command. A suitable /etc/fstab entry would be:

/dev/sdb /mnt btrfs device=/dev/sdb,device=/dev/sdc,device=/dev/sdd,device=/dev/sde 0 0

Using device is not recommended, as it is sensitive to device names changing that is affected by the order of discovery of the devices. You should really be using a initramfs. Most modern distributions will do this for you automatically if you install their own btrfs-progs package.

Using device=PARTUUID=... with GPT partition UUIDs would also work and be less fragile

Also talks here about modules

btrfs device scan is used to scan all of the block devices under /dev and probe for Btrfs volumes. This is required after loading the btrfs module if you’re running with more than one device in a filesystem.

Ok, this is the command btrfs device scan and it build the hooks. If it doesn't run mkinitcpio -P then I do it manually

source

so procedure would be:

boot Live Garuda and make BTRFS RAID

mkfs.btrfs -L files -m raid0 -d raid0 /dev/sdb /dev/sda

Choose manual partitioning and set the raid to /home

chroot with the Garuda welcome chroot tool and scan devices for the hook. It should run mkinitcpio -P after scan

btrfs device scan

Anyone can review my last comment and hopefully validate before I go for it? for me it rings green :smiley:

1 Like

Actually I’m testing it with latest Garuda Linux KDE. I’ll report after setting up the system :slight_smile:

After forcing the terminal to override the former btrfs file system the terminal created the raid. But the installer doesn’t show me the raid. It show two separated drives.

Update: idk if it worked, but I’ve did it this way:

I’ve booted the live image and started the terminal. With sudo and your mk.btrfs raid0 code I’ve created raid0.

In the installer I’ve set to manually partitioning and set both 1TB Drives to home. /dev/sda = /home and /dev/sdb = /home .
My ssd as Root and grub-bios.

Update 2 : I can confirm that your tutorial absolutely working.

Hi there and welcome to the forum @NixNick89.

We generally try to discourage necrobumping very old threads here. This mostly pertains to technical threads, as on a rolling distro things change very quickly and reviving threads with outdated technical information is counterproductive.

There are exceptions of course, like if you've found a completely new solution to a long standing problem it is acceptable to add your new information to an old thread.

If you wish to continue discussing this topic you can always open a new thread. It is generally better to open a new thread and link back to pertinent older threads than to revive long dead threads.

I will now put this thread to rest.

3 Likes