this post was submitted on 14 Aug 2023
159 points (97.6% liked)

Linux

45488 readers
2015 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
 

cross-posted from: https://lemm.ee/post/4274796

Just wanted to share some love for this filesystem.

I’ve been running a btrfs raid1 continuously for over ten years, on a motley assortment of near-garbage hard drives of all different shapes and sizes. None of the original drives are still in it, and that server is now on its fourth motherboard. The data has survived it all!

It’s grown to 6 drives now, and most recently survived the runtime failure of a SATA controller card that four of them were attached to. After replacing it, I was stunned to discover that the volume was uncorrupted and didn’t even require repair.

So knock on wood — I’m not trying to tempt fate here. I just want to say thank you to all the devs for their hard work, and add some positive feedback to the heap since btrfs gets way more than it’s fair share of flak, which I personally find to be undeserved. Cheers!

all 20 comments
sorted by: hot top controversial new old
[–] [email protected] 32 points 10 months ago (1 children)

Agreed, RAID 1 (and 10) are pretty stable.

Moderately fun fact, RAID 1 in BTRFS is not really RAID 1 in the traditional sense. Rather it's a guarantee that your data lives on two separate drives. You don't know which ones though. You could have one copy of everything on a 12TB drive, whith various secondary copies distrivlbuted on three 4TB drives.
Traditional RAID 1 works ONLY with two drives, with a capacity of the smaller drive as upper limit. The way to extend a traditional RAID 1 array is by adding two new drives and creating a RAID 10 with all four. (Multiple RAID 1 striped)

[–] [email protected] 11 points 10 months ago

This right here is what has made it so flexible for me to reuse salvaged equipment. You can just chuck a bunch of randomly sized drives at it, and it will give you as much storage as it can while guaranteeing you can lose any one drive. Fantastic.

[–] flux 10 points 10 months ago (2 children)

Anything specific advice you would give to others to prevent corruption? Or keep drives healthy?

[–] [email protected] 9 points 10 months ago

Schedule a monthly scrub (with the foreground option), and make sure you get notified if the exit code is non-zero

https://btrfs.readthedocs.io/en/latest/btrfs-scrub.html

I also have a weekly balance scheduled to keep block groups compact, although if you don't frequently delete files this may not be necessary IMO

[–] [email protected] 3 points 10 months ago

I’m not sure I know enough to be giving out advice, but I can tell you what I do. I do have a cron job to run scrub, to keep the bitrot away. I also tend to replace my drives proactively when they get REALLY old — the flexibility of btrfs raid1 lets me do that one drive at a time instead of two, making it much more affordable. You can plan out your storage with the btrfs calculator.

[–] [email protected] 6 points 10 months ago (1 children)

I've been using it in Fedora since they switched to it as the default FS. I have not done anything special. I am not trying anything fancy except compress-force=zstd:1. Seems good to me!

[–] [email protected] 1 points 8 months ago (1 children)

Why just :1? The default is :3 and looking at the timings for zstd deflate speed vs compression level (Google for it .. ), becomes slow at around 7.

Don't mean shit to me but suggest you reconsider.

[–] [email protected] 1 points 8 months ago

Slow relative to what? Any zstd compression, while really fast, will be slower than native write speeds to my nvme. A tiny bit of ratio gain isn't worthwhile to me.

[–] [email protected] 5 points 10 months ago

I use it on my steam deck microsd to cram more shit in via compression. Main drive is left as ext4 though so case folding can be used for particularly janky windows games or mods.

[–] [email protected] 1 points 10 months ago (1 children)

I've been wanting to build a raid for a while, what raid controller do you use/would you recommend?

[–] [email protected] 2 points 10 months ago* (last edited 10 months ago)

For a software RAID like this, you don’t want a hardware RAID controller, per se – you just want a bunch of ports. After my recent controller failure, I decided to try one of these. It’s slick as hell, sitting close to the motherboard, and seems rock solid so far. We’ll see!