hetzneronline / installimage

Bash scripts to universally deploy various distributions
Other
517 stars 143 forks source link

Add support btrfs multi-device #74

Open shirotech opened 1 year ago

shirotech commented 1 year ago

Reading in the comments that it is currently not supported, are there any plans to support this? Thank you.

asciiprod commented 10 months ago

Currently not planned, but thank you for the suggestion

madalinignisca commented 4 months ago

If the topic is to support raid 1 for btrfs, u can start the installation with first drive and before reboot, u can change the setup in raid 1. The official docs mention how to: https://btrfs.readthedocs.io/en/latest/btrfs-device.html.

I'd do it like this:

  1. setup all partitions as subvolumes, don't do separate partitions for btrfs.
  2. mount the main partition to /mnt when install is done.
  3. add the second drive
  4. convert to raid 1 triggering balance and conversion.

But you must do yourself the boot part.

That can be easy if u ask to have the server with UEFI.

Create first identical same ESP partition, and copy the contents. It's safe to copy as normal, as that is just fat32 partition.

unmount both, and use mdadm to create a raid 1 setup from them.

Explanation on Arch wiki always worked for me: https://wiki.archlinux.org/title/EFI_system_partition#ESP_on_software_RAID1

I hope it works for you, as it did for me.


Note: I do recommend the normal raid 1 as the installer does, and setup btrfs on top of the raid block. The thing is that it allows you to encrypt the raid block and maintenance in case of drive failure is easier and straightforward in case of encrypted block. With BTRFS + raid 1 + encryption, there are years to follow to be stable.