You are not logged in.

#1 2024-08-27 08:52:06

Efka
Member
From: Klaipeda
Registered: 2014-04-27
Posts: 107
Website

btrfs raid1 boot root etc.

How should i approach it ?
I want to use raid1 for my boot  root home snapshot device. will use 2x ssd.
do i need to replicate each step for each disk  and add each disk uuid in fstab ?
or using this enough to add one uuid ?

 mkfs.btrfs -d raid1 -m raid1 /dev/part1 /dev/part2 

And how btrfs raid 1 works ? i see it says single ( arch wiki ) - metadata is mirrored but data is no ,  raid1 and  data is not mirrored ? or i misunderstand something ? does my command which is missing single  mirrors metadata and data ? if i want to have 1 disk redundancy  i need to have mirrored data and metadata right ?
From wikipedia:

RAID 1 consists of an exact copy (or mirror) of a set of data on two or more disks; a classic RAID 1 mirrored pair contains two disks. This configuration offers no parity, striping, or spanning of disk space across multiple disks, since the data is mirrored on all disks belonging to the array, and the array can only be as big as the smallest member disk. This layout is useful when read performance or reliability is more important than write performance or the resulting data storage capacity.[13][14]

The array will continue to operate so long as at least one member drive is operational.[15]

I want to have 1disk redundancy with boot / root / home /snapshot partitions then have a zfs for rest of my drives and have a cron job(?) where i send my snapshot to my external usb drive ( zfs ) [ my externald hdd is zfs due to usage on my FreeBSD laptop and another PC  dont have windows, i want to have zfs . period smile I think i cant have zfs at the moment  for 6.10 kernel ( if i did my re-search correctly ) .
]
I need  btrfs for main system due to i have Arch on my VPS and its btrfs. ( trying to replicate so i could easily do stuff on my VPS what i did on my WS )

And how i should approach boot ? using uefi and trough my research grub is best for it  as its supports multiple device booting and do i need to add degraded to avoid future extra steps to boot if 1 ssd fails ?
I wont have encryption  for sake of simplicity  to boot.


IBM Lenovo ThinkPad T61 ; Lenovo ThinkPad X220; Lenovo ThinkPad T440p; Lenovo Thinkpad W520; Lenovo Thinkpad P71; ThinkPad X1 Yoga Gen1;  FrankenPad T25
Asus Z10PE D-16 WS; 2x Intel Xeon E-5 2690V4; 32GB ECC; nVidia Titan V CEO | Asus ROG Gene XI Intel i7-9700k nVidia 3070Ti

Offline

#2 2024-08-31 19:03:48

lenhuppe
Member
From: New Hampshire USA
Registered: 2018-12-10
Posts: 282
Website

Re: btrfs raid1 boot root etc.

Creating mirrors in btrfs may be different from other filesystems you have used. When you are finished creating the mirror you only need to mount one of the two mirrored partitions.

mkfs.btrfs -L broot -O free-space-tree -m raid1 -d raid1 /dev/nvme0n1p2 /dev/nvme1n1p2
mount -t btrfs /dev/nvme0n1p2 /mnt

Next you can create sub-volumes:

btrfs subvolume create /mnt/@
btrfs subvolume create /mnt/@home
btrfs subvolume create /mnt/@archive

Lastly you remount:

umount -R /mnt
mount -t btrfs -o noatime,compress=zstd,ssd,discard=async,autodefrag,subvol=@ /dev/nvme0n1p2 /mnt
mount -t btrfs -m -o noatime,compress=zstd,ssd,discard=async,autodefrag,subvol=@home /dev/nvme0n1p2 /mnt/home
mount -t btrfs -m -o noatime,compress=zstd,ssd,discard=async,autodefrag,subvol=@archive /dev/nvme0n1p2 /mnt/archive

When you are ready you can run genfstab as you normally would.

Hope that clarifies the process for you.


"I'm suspicious of people who don't like dogs, but I trust a dog when it doesn't like a person."  -- Bill Murray

Offline

Board footer

Powered by FluxBB