News for hackers. Stuff that matters.
Re:Btrfs in Linux 6.2 brings performance improvements, bette... by dale_glass on Monday December 12, 2022 @05:49PM (#33961608)
But is the RAID handling remotely sane yet? See https://arstechnica.com/gadgets/2021/09/examining-btrfs-linu...

It has gems such as:

* It won't boot on a degraded array by default, requiring manual action to mount it

* It won't complain if one of the disks is stale

* It won't resilver automatically if a disk is re-added to the array

I think the first is the killer. RAID is a High Availability measure. Your system is not Available if it fails to boot.

Re:Btrfs in Linux 6.2 brings performance improvements, bette... by dekhn on Monday December 12, 2022 @05:59PM (#33961708)
Many folks I know who manage storage don't make the boot volume RAID (redundant)- instead, it's some rapidly duplicatable thing like an NMVE flash containing the root filesystem, and there's a replacement handy. Then you can bring up and bring the full power of userspace to bear on the RAID repair.
Re:Btrfs in Linux 6.2 brings performance improvements, bette... by encabulator on Tuesday December 13, 2022 @12:24AM (#33965160)
I just finished another late night "thanks" to unknown person who decided to use this approach several years ago while setting up 17 servers that I inherited. The /boot partition of these RHEL machines was put on SD cards, which have been gradually dying. So I got to boot the machine (which is 6000 km away) to recovery mode from ISO and re-create the /boot filesystem on HDD (RAID).

Of the 17 servers, only three are now remaining where I haven't had to do this. Not all of these were actual SD card failures, some where done preventively. Still, there have been several SD card failures requiring emergency repair work at inconvenient times. There have been 0 RAID failures requiring similar emergency work on the systems where /boot has been migrated to HDD based RAID.

Of course there is no replacement SD card handy with working /boot filesystem. Actually there is no such thing as "handy" in my case. I can actually reconstruct /boot partition on the HDD faster than anybody could go to the datacenter and replace the SD card. And if there were a replacement SD card, I would need to keep it up to date manually every time the kernel or initrd are updated.

I never want to see this kind of setup again, and frankly it felt insane the first time I saw it.

Of course I should have migrated all of the machines off the SD cards by now, but my excuse is that maintaining Linux on these machines is not really my responsibility (it is nobody's responsibility apparently, although many people are interested in keeping these systems online).

When I die I want to have a SD-card shaped tombstone.

Re:Btrfs in Linux 6.2 brings performance improvements, bette... by mattpallissard on Tuesday December 13, 2022 @02:52PM (#33974741)
This was a trend for a minute back in the late 00's. Any system that was

  1.HA
  2.Had an OS that would get fully loaded into memory (think ESX).
The idea was that SD-cards take less power and where cheap enough you could have a whole gang of spares with images ready to just drop in place. I'm not saying it was a good idea, just that I've encountered this more than once.
Re:Btrfs in Linux 6.2 brings performance improvements, bette... by StreamBright on Tuesday December 13, 2022 @02:44AM (#33965950)
So you discovered the well known problem in "IoT" that SD cards should never be used for filesystems that are online 100% of the time?

I think the parent views on storage is still valid. Do not boot from the RAID volume where you store many terabytes.

I usually have a small mirror SSD for the OS (like 128G or max 256G). Those drives are super cheap, easy to replace.

For the /data I usually use ZFS or mdadm + xfs. Depending on the use case (for example do you want to add more capacity later? ) you can decide.

Using SDcards for server filesystem is negligent at the very least.

Re:Btrfs in Linux 6.2 brings performance improvements, bette... by krageon on Tuesday December 13, 2022 @10:12AM (#33969869)
flash dying after a few years is not exactly weird or unexpected, regardless of the form factor
Re:Btrfs in Linux 6.2 brings performance improvements, bette... by alerighi on Monday December 12, 2022 @07:48PM (#33962965)
I don't get why you need to do so. RAID is not a substitute of backups, and shouldn't used that way. Meaning that of course you have a backup of the data that you can recover from.

RAID is used for two things:

1. improving the performance of slow disks (at least the read performance) 2. having 1/2 disk fail with your system remaining completely usable, till you replace the faulty disk as soon as possible.

The second point is fundamental to me: there shouldn't be any disruption of service whatsoever, meaning that only the sysadmin should notice the fault (beside maybe a reduced performance of the system since you have 1 less drive). Database transaction that were in progress when the disk did break shouldn't fail, writes/reads on the FS shouldn't fail, the only thing that should happen is an alarm triggered in the monitoring system to inform that a disk needs to be changed as soon as possible.

Having a RAID with manual recovery... it means that you could end up a Saturday evening in front of a computer to bring a system back online, and still some data corruption may have happened.

Re:Btrfs in Linux 6.2 brings performance improvements, bette... by dekhn on Monday December 12, 2022 @08:49PM (#33963574)
Regardless of what you think, many people keep a separate boot and data disk and don't use RAID on the boot disk. I never said anything about it being used for backups nor did I said anything about service outages. I think my point- about what other people do since I don't use RAID- is more about the choices different people make in terms of trusting their boot volume's recoverability in times of crisis.
Re:Btrfs in Linux 6.2 brings performance improvements, bette... by linuxandrew on Tuesday December 13, 2022 @02:13AM (#33965765)
3. Prevent bit-rot w/ software RAID. Running ZFS, btrfs et al. on a single disk can detect bit-rot but not repair it.
Re:Btrfs in Linux 6.2 brings performance improvements, bette... by _kdave on Tuesday December 13, 2022 @12:57PM (#33972860)
By default the metadata profile is 'DUP' (i.e. 2 copies on one device), the same can be done for data but this reduces the usable capacity. On normal HDD or SSD this should not be needed but having both data and metadata DUP/DUP has been useful on raspberry pi with the micro SD card storage. It's not perfect but increases the chances to get the data back if the card is partially damaged due to power spikes.
Re:Btrfs in Linux 6.2 brings performance improvements, bette... by ac29 on Friday December 16, 2022 @12:28PM (#34017403)
I have wondered about this myself - does keeping 2 copies of the same data on a single flash-based drive actually increase reliability? Or is the flash controller going to end up combining the two writes into the same block?
Re:Btrfs in Linux 6.2 brings performance improvements, bette... by dale_glass on Monday December 12, 2022 @06:25PM (#33961957)
That seems like a very hacky way to accomplish something that should just work. I mean, it's better than nothing, but it seems far from ideal.

If it's your own personal box, and you're okay with that fiddling, fine. But if people are supposed to get work done while the admin gets a new disk, it's not great.

Re:Btrfs in Linux 6.2 brings performance improvements, bette... by mlyle on Tuesday December 13, 2022 @12:16AM (#33965120)
There's pretty solid reasons why you might choose to have a very simple RAID1 set for a boot volume-- because you want to be sure to boot even if the huge array is degraded, and because you want faster I/O for the OS install, etc...
Re:Btrfs in Linux 6.2 brings performance improvements, bette... by antod on Monday December 12, 2022 @07:19PM (#33962621)
The way I used to do it (back then getting grub/initrd raid aware wasn't really doable - not sure about now) with mdadm was to use RAID1 on the boot volume such that a disk from a broken mirror was still usable by itself. Other volumes were RAID 5 or 10 etc.
Re:Btrfs in Linux 6.2 brings performance improvements, bette... by koolba on Monday December 12, 2022 @09:50PM (#33964093)
How would a mirrored boot work in practice? Normally the first bootable partition gets loaded if it’s corrupt, it would keep failing at the same bad sectors.

Would it randomly pick one of the bootable disks? That way you have an n-1/n chance of avoiding the bad disk?

Re:Btrfs in Linux 6.2 brings performance improvements, bette... by antod on Monday December 12, 2022 @10:03PM (#33964198)
Back then, grub and initrd didn't understand mdadm so would be set to boot off one of the boot vols as a raw disk. Once initrd handed over to the root vol, it would understand mdadm properly.

If a disk with a boot vol failed, it would have a 50/50 chance of still booting depending on which one failed. You'd create a backup grub entry to boot off the other one manually.

Not as transparent as hardware RAID, and maybe now grub is aware enough to auto handle mdadm? I don't know - I haven't done bare metal mdadm for a decade or so.

Re:Btrfs in Linux 6.2 brings performance improvements, bette... by Annatar on Tuesday December 13, 2022 @04:11AM (#33966418)
"How would a mirrored boot work in practice?"

The same way it has worked for the past 30+ years: the firmware boots from first designated boot device; if that device isn't bootable, it moves on to the next one. The next one boots since it's part of a mirror and has all the necessary data to do so, and in the rare case where the device is "half bootable" one would simply intervene and select the next good bootable device manually.

Re:Btrfs in Linux 6.2 brings performance improvements, bette... by ndsipa_pomu on Tuesday December 13, 2022 @06:05AM (#33967222)
That's fair enough for a system that isn't critical, but you can almost guarantee that the disk failure will happen at the most inconvenient time. I'd rather have a couple of cheap disks and MD software RAID so that the system boots as long as one of the drives hasn't failed. Then you can replace/fix the failing disk at a convenient time.
Re:Btrfs in Linux 6.2 brings performance improvements, bette... by prmoustache on Tuesday December 13, 2022 @07:04AM (#33967765)
Back when solaris wasn't using zfs yet, we were using the live upgrade utility to duplicate the main boot environment on a local disk every night.

Machines booting from SAN had only one local disk, others would have 3 local disks (small and cheap ones because application data was on SAN anyway).

Main raid would do the job for availability in term of disk failure, 3rd bootdisk did the job in case of user erroror data corruption on the main boot env. It saved our asses a few times, bringing apps back online quickly and saving us from reinstalling or fixing stuff from a tenporary live environment.

Re:Btrfs in Linux 6.2 brings performance improvements, bette... by ilyt on Monday December 12, 2022 @09:06PM (#33963730)
Why ? mdadm RAID1 is quick and easy solution for that...
Re:Btrfs in Linux 6.2 brings performance improvements, bette... by evil-olive on Monday December 12, 2022 @11:32PM (#33964863)
why_not_both.jpg

I have 2 NixOS-based NASes that run ZFS. each one has 3 equal-sized 256gb SSDs in addition to the pile o' spinning rust.

each SSD has a small UEFI boot partition, then the rest of the space is cut in half.

the root filesystem is a 3-way ZFS mirror of the first half of the SSDs. the second half of each SSD is another 3-way mirror, this time as the "special" / metadata device for the main hard-drive-backed zpool.

any of the 3 SSDs can fail, and it will boot up and mount the storage perfectly fine. I could also easily upgrade to larger SSDs, in-place and with minimal downtime (zero downtime, if my case had hot-swappable SSD bays)

it would work just as well with only 2 SSDs, but the incremental cost of a 3rd is small enough relative to the whole that I went for it.

Re:Btrfs in Linux 6.2 brings performance improvements, bette... by mattpallissard on Tuesday December 13, 2022 @02:55PM (#33974775)
I haven't used raid for an OS or boot partition in years. We focus on provisioning and HA. Data goes on a raid an that's it.

Servers go boom, refuse to boot, or even get trigger a few alarms. Disk is replaced, server is booted, and provisioning paves the entire thing faster than you'd be able to debug.

Re:Btrfs in Linux 6.2 brings performance improvements, bette... by simcop2387 on Monday December 12, 2022 @07:01PM (#33962373)
The way I like to do it is with mirroring of the nvme storage and then lvm snapshots on top of it. Done correctly you get boot off either of them but they're kept in sync automagically by the OS. then you snapshot the boot volume regularly and copy those to some kind of archival storage for backups.

That lets you then even hotswap them if you need to while keeping the root filesystem workable.

Re:Btrfs in Linux 6.2 brings performance improvements, bette... by bravetraveler on Monday December 12, 2022 @07:34PM (#33962816)
Plain old USB thumb drives are pretty common for this

I can't knock it, but I imagine I'd be yelling for at least RAID1 if I had to wait for a replacement.

Re:Btrfs in Linux 6.2 brings performance improvements, bette... by ilyt on Monday December 12, 2022 @09:07PM (#33963736)
There are even some servers with hardware RAID1 on 2 microsd cards
Re:Btrfs in Linux 6.2 brings performance improvements, bette... by xorcist on Tuesday December 13, 2022 @04:55AM (#33966681)
Remember that DM is still there for you even if you use btrfs.

Every discussion about btrfs immediately escalates to how the btrfs RAID support develops. But btrfs is useful on its own without that mode.

Should you wish to put a btrfs file system on software RAID (DM), you can still do that. The btrfs RAID modes are something else, where you cut the DM driver out of the picture. That's not going to be as well tested as plain old DM, even if it works, and it doesn't offer any functionality beyond plain DM RAID.

If the use case is storing real data, you want the data storage layer to be as well tested as possible. There's also more to software RAID than the block device. You want a mature resilvering daemon on a well tested schedule, and you need working monitoring to alert you of issues. RAID without monitoring will only delay the inevitable.

Re:Btrfs in Linux 6.2 brings performance improvements, bette... by exceptione on Tuesday December 13, 2022 @05:42AM (#33967030)
DM = device mapper

wikipedia: The device mapper is a framework provided by the Linux kernel for mapping physical block devices onto higher-level virtual block devices. It forms the foundation of the logical volume manager (LVM), software RAIDs and dm-crypt disk encryption, and offers additional features such as file system snapshots.[1]

Device mapper works by passing data from a virtual block device, which is provided by the device mapper itself, to another block device. Data can be also modified in transition, which is performed, for example, in the case of device mapper providing disk encryption or simulation of unreliable hardware behavior.

Re:Btrfs in Linux 6.2 brings performance improvements, bette... by matheusmoreira on Tuesday December 13, 2022 @07:34AM (#33968047)
Yeah but DM doesn't have the btrfs flexible block allocation scheme that allows me to expand capacity one drive at a time and with drives of different capacities. This is very important for a home user like me.

To expand a typical RAID setup, you have to essentially fail every single drive in the array and replace them one by one with new identical drives. Expanding an array of N drives requires N resilvers which not only takes a long time but increases the chance of actually failing those drives due to massive I/O load. It's easier to build a second array and copy the data over. This combined with the fact you have to buy all the hardware up front makes it cost prohibitive for home users. You can't buy drives one at a time and expand capacity as needed.

Re:Btrfs in Linux 6.2 brings performance improvements, bette... by chasil on Monday December 12, 2022 @06:24PM (#33961944)
Regarding resilvering, I am amazed by ZFS' capability of quickly bringing a stale mirror back into synchronization.

I have used the FUSE port of ZFS to write only one member of a mirroset, then upon mounting both members elsewhere, the stale mirror was very quickly resilvered, so ZFS was able to determine only the blocks needing to be refreshed.

In btrfs, I understand that this requires a rebalance, which will read/write every used portion of the filesystem.

Re:Btrfs in Linux 6.2 brings performance improvements, bette... by patmorgan23 on Monday December 12, 2022 @09:20PM (#33963843)
Yeah ZFS does some sort of block level hash table magic. Very IO efficient for what it's doing.
Re:Btrfs in Linux 6.2 brings performance improvements, bette... by cmurf on Tuesday December 13, 2022 @01:39AM (#33965581)
Scrub, not balance. It's primarily a read operation. The on-disk format has all the information needed to do an automatic abbreviated scrub, but the feature isn't implemented yet.
Re:Btrfs in Linux 6.2 brings performance improvements, bette... by chasil on Tuesday December 13, 2022 @10:07AM (#33969794)
No, I've heard that a scrub will not reallocate missing blocks on mirrors. A rebalance was required in the article below, and this situation really requires attention.

ZFS is far friendlier in a crisis.

"We'll even manually trigger a scrub—a procedure that storage admins generally understand to look for and automatically repair any data issues... even though we manually initiated a scrub and let it finish, our array is still inconsistent and even outright non-mountable, because it ran for a little while without a disk and then that disk was re-added. The command that we were supposed to run was btrfs balance—with both drives connected and a btrfs balance run, it does correct the missing blocks, and we can now mount degraded on only the other disk, /dev/vdc. But this was a very tortuous path, with a lot of potential for missteps and zero discoverability."

https://arstechnica.com/gadgets/2021/09/examining-btrfs-linu...

Re:Btrfs in Linux 6.2 brings performance improvements, bette... by cmurf on Tuesday December 13, 2022 @02:56PM (#33974793)
Scrub checks every data and metadata block and compare to checksum. If missing, or wrong transid, or wrong csum, btrfs will replace the block from a good copy.

There is a potential gotcha with parity being wrong following a crash or powerfail, the so-called write hole. Scrub doesn't check parity, and parity isn't checksummed. The write hole though is arguably two parts: wrong parity and propagated wrong reconstruction.

In the usual write-hole case, both happen silently. Wrong parity could happen after a power fail, crash, misdirected or torn write - whether the array is functioning normally or degraded. However, wrong reconstruction only happens if there's a failure to read a data strip (bad sector or full device failure).

On btrfs, only the wrong parity being written is possible. Upon reconstruction from bad parity, the resulting data is compared to csum and will fail, thus propagation doesn't happen.

To cause parity to be recomputed and rewritten, yes you need to do a full balance. But among all the block group profiles, that's only raid5 and raid6. Single, DUP, raid1, raid1c3, raid1c4, raid10 aren't affected and a scrub does reallocate missing blocks on mirrors.

Re:Btrfs in Linux 6.2 brings performance improvements, bette... by _kdave on Monday December 12, 2022 @06:11PM (#33961834)
> It won't boot on a degraded array by default, requiring manual action to mount it

If you want it to behave like that then add 'degraded' to fstab. That a device is missing can have unknown reasons, the user should know better and resolve it or allow such boot. It's not automatic as there's no way to inform the user that it's degraded state.

Re:Btrfs in Linux 6.2 brings performance improvements, bette... by dale_glass on Monday December 12, 2022 @06:21PM (#33961913)
I don't quite understand the use case here. If I'm setting up RAID it's because I want the system to stay up. That's the only purpose for it.

If a device goes missing for "unknown reasons", then the machine should still work, and I'll figure out what happened when monitoring pokes me and says RAID is degraded.

Re:Btrfs in Linux 6.2 brings performance improvements, bette... by viraptor on Monday December 12, 2022 @06:35PM (#33962049)
The use case is: Enough drives failed that your raid is degraded. Any more data you write is not replicated and it may be due to software/hardware issue that will kill more drives soon.

It's up to you to choose at that point - is availability more important for you (add degraded to fstab), or data consistency (deal with the array first).

Re:Btrfs in Linux 6.2 brings performance improvements, bette... by p1necone on Monday December 12, 2022 @08:34PM (#33963436)
> That's the only purpose for it.

That's not the only purpose for it. There's three reasons I can think of that you might set up a RAID array:

    * You want better uptime. (your use case)

    * You want to protect from data loss. (my assumption was that this is the most common use case, but I could be wrong. This also helps with uptime because there's nothing worse for uptime than having to restore lost data from a cold backup)

    * You want better performance, data integrity be damned. (RAID 0)
Booting a RAID array with a failed disk is a bad idea if you care a lot about not losing data, because now you're one less disk failure away.
Re:Btrfs in Linux 6.2 brings performance improvements, bette... by wtallis on Monday December 12, 2022 @10:46PM (#33964539)
Another way of thinking about it: should uptime with bad data or services making false guarantees about data durability actually count as uptime?
Re:Btrfs in Linux 6.2 brings performance improvements, bette... by jonhohle on Monday December 12, 2022 @09:13PM (#33963773)
RAID 0 should be called AID, since it’s not really RAID.
Re:Btrfs in Linux 6.2 brings performance improvements, bette... by vetinari on Tuesday December 13, 2022 @05:31AM (#33966928)
The '0' says it exactly: the amount of data you are left with, once one of the drives fails.
Re:Btrfs in Linux 6.2 brings performance improvements, bette... by justsomehnguy on Tuesday December 13, 2022 @01:00AM (#33965365)
> Booting a RAID array with a failed disk is a bad idea

Booting a RAID array with a failed disk is absolutely fine idea.

How else I get access to the tools to identify the bad drive and resilver RAID on a replacement, be it in the same bay or not?

Re:Btrfs in Linux 6.2 brings performance improvements, bette... by wtallis on Tuesday December 13, 2022 @01:57AM (#33965688)
Booting from a degraded array is only a fine idea in some circumstances, not all. That's why the kernel should not default to automatically doing so; but a distro or sysadmin that has better knowledge of the broader situation (eg. presence of hot spares or a working monitoring/alert system) can reasonably change that default when the risks of booting from a degraded array have been mitigated.
Re:Btrfs in Linux 6.2 brings performance improvements, bette... by justsomehnguy on Tuesday December 13, 2022 @01:59AM (#33965697)
Ie you are treating RAID as a backup.
Re:Btrfs in Linux 6.2 brings performance improvements, bette... by wtallis on Tuesday December 13, 2022 @02:29AM (#33965852)
Backups cannot be perfectly real-time unless they are very nearly RAID. Any time you are generating/collecting important data, you will unavoidably have some amount of that important data in the state of not yet backed up.

It's reasonable to want to preserve all the data you currently have—some of which probably hasn't been backed up yet—and not accept new data to be written with the durability guarantees the array was originally configured for silently violated.

Since the kernel has no way of knowing which volumes may contain important data that didn't get the chance to be backed up, it should try its best to maintain the original durability standards the filesystem was configured until some mechanism outside the kernel authorizes the relaxation of those standards.

Re:Btrfs in Linux 6.2 brings performance improvements, bette... by justsomehnguy on Tuesday December 13, 2022 @02:55AM (#33966009)
> It's reasonable to want to preserve all the data you currently have—some of which probably hasn't been backed up yet—and not accept new data to be written with the durability guarantees the array was originally configured for silently violated.

IE (by your logic) the system should stop the writes as soon as the array became degraded.

But this is not what happens with btrfs: it would happily continue to write the data on the array until reboot.

And then suddenly it's "oh my god array is degraded!!!111 you should not write to it1111".

To add on that: I never seen for a HW RAID card to stop booting by a mere degraded state of the array. Changes in configuration of arrays, loss of more than enough for redundancy drives - yes, that would halt the boot and require the operator intervention. Array in a degraded state? Just spit the warnings to the console and boot. Nobody has the time to walk to each server with a degraded array on every reboot.

Re:Btrfs in Linux 6.2 brings performance improvements, bette... by happymellon on Tuesday December 13, 2022 @02:28AM (#33965848)
No, you are treating RAID as a protection against longer outage of restoring from backups.
Re:Btrfs in Linux 6.2 brings performance improvements, bette... by _kdave on Monday December 12, 2022 @08:14PM (#33963245)
Yeah but monitoring is not something that comes with the filesystem. If you have to set up the system to be a HA and configure monitoring, email notifications whatever, making sure the filesystem is created with redundant profiles, then I'm expecting that also adding the 'degraded' to the fstab is part of the configuration.
Re:Btrfs in Linux 6.2 brings performance improvements, bette... by RealStickman_ on Tuesday December 13, 2022 @01:04AM (#33965383)
The system stays up just fine. You just can't reboot it without fixing/ignoring the problem. I think that's fair.
Re:Btrfs in Linux 6.2 brings performance improvements, bette... by cmurf on Tuesday December 13, 2022 @01:57AM (#33965689)
Most distros have a udev rule in place that inhibits a mount attempt of a multiple device Btrfs until all devices are visible to the kernel. The degraded mount option won't even matter in this case, because mount isn't attempted.

If you remove this udev rule and then add degraded mount option to fstab, it's very risky because now even a small delay in drives appearing can result in a degraded mount. And it's even possible to get a split brain situation.

Btrfs needs automatic abbreviated scrub, akin to the mdadm write intent bitmap which significantly reduces the resync operation.

Re:Btrfs in Linux 6.2 brings performance improvements, bette... by Hello71 on Monday December 12, 2022 @06:49PM (#33962195)
according to https://arstechnica.com/gadgets/2021/09/examining-btrfs-linu..., btrfs devs say you should not add degraded to fstab, and doing so can easily result in data loss.
Re:Btrfs in Linux 6.2 brings performance improvements, bette... by viraptor on Monday December 12, 2022 @06:59PM (#33962345)
The quote is "At this stage of development, a disk failure should cause mount failure so you're alerted to the problem." and it's from over 9 years ago on an ancient kernel. That was just 3+ years since btrfs project got started.

Let's treat it as archived historical content it is.

Re:Btrfs in Linux 6.2 brings performance improvements, bette... by diegocg on Monday December 12, 2022 @06:05PM (#33961770)
No, they have plans for a new different RAID implementation as part of the "extent tree v2" thing AFAIK
Re:Btrfs in Linux 6.2 brings performance improvements, bette... by klysm on Monday December 12, 2022 @05:57PM (#33961684)
> * It won't boot on a degraded array by default, requiring manual action to mount it

That by itself is a complete deal breaker.

Re:Btrfs in Linux 6.2 brings performance improvements, bette... by cycomanic on Monday December 12, 2022 @09:23PM (#33963869)
Hold on, people make this out to be like if a disk fails it requires immediate intervention. However if the system already booted it stays up. Who reboots a production system without monitoring it? Also if you boot with a degraded disk are you not asking for massive trouble, because if another disk fails you might end up with data loss which is IMO much worse on a production system than not being able to boot until you add another disk.
Re:Btrfs in Linux 6.2 brings performance improvements, bette... by wang_li on Tuesday December 13, 2022 @01:38AM (#33965578)
The risks are the same whether you keep running with a failed disk vs. rebooting/booting with a failed disk. Also, given a system in which the OS is not running and requires booting, how exactly are you going to resync a replacement drive if you don't boot the system with a degraded raid volume?
Re:Btrfs in Linux 6.2 brings performance improvements, bette... by justsomehnguy on Tuesday December 13, 2022 @01:19AM (#33965470)
> Who reboots a production system without monitoring it?

Anyone.

> Also if you boot with a degraded disk are you not asking for massive trouble

> not being able to boot until you add another disk

Great.

I'm just a [sys]admin who were given a task to do something on $server.

I jump around the red tape, claw out a 15 minute downtime because the task requires reboot, proceed with all that corporate dance with notification emails.

I do my thing, reboot the server and it doesn't return back online.

Suddenly I broke the server, missed maintenance window, amount of mails with CC and RE: in my mailbox grows in geometric progression and the most important - now I need to find out who were responsible for the server, contact him and [kick his ass] ask him to diagnose what is going on.

Bonus points if:

server doesn't have a meaningful BMC/iLO/iDRAC with KVM console

it does have it but it's broken for some reason eg requires Java 6 on Vista

server was configured 10 years ago by a greybeard who is not only retired but already died from the old age

server is 6000km away from any place with a replacement disks and the earliest time when you can send the replacement would be the next spring when the ice would break and taw enough for the ships to move. Of course you can hire a helo to deliver it, which get your ass chewed for an unplanned $50k expenses

Also: https://news.ycombinator.com/item?id=33963000

Re:Btrfs in Linux 6.2 brings performance improvements, bette... by wtallis on Tuesday December 13, 2022 @02:01AM (#33965709)
It sounds like you're hypothesizing a long chain of bad decisions, and then ridiculing btrfs for taking the choice that means your next bad decision only culminates in (predictable, preventable) downtime rather than data loss.
Re:Btrfs in Linux 6.2 brings performance improvements, bette... by justsomehnguy on Tuesday December 13, 2022 @02:19AM (#33965796)
> It sounds like you're hypothesizing

This is all the things what I encountered in my admin days.

Including BL670 with incorrectly connected drives, so despite everything saying (and indicating) what the failed drive was in bay 2 it was actually in bay 1.

> then ridiculing btrfs

I ridicule btrfs for it's RAID mode not being a RAID mode by default.

RAID is about availability of data.

If you so hell bent on the data safety then btfrs should kernel panic as soon as one drive degrades. THAT would make sure someone would come and investigate what happened and no data loss.

Right?

Re:Btrfs in Linux 6.2 brings performance improvements, bette... by wtallis on Tuesday December 13, 2022 @02:53AM (#33966001)
> If you so hell bent on the data safety then btfrs should kernel panic as soon as one drive degrades. THAT would make sure someone would come and investigate what happened and no data loss.

> Right?

Panicking an already-running kernel would only serve to prevent userspace from handling the failure through mechanisms that are inherently beyond the scope and capabilities of the kernel alone (ie. stuff like alerting a sysadmin, activating a hot spare, or initiating a rebalance to restore redundancy among the remaining drives).

Perhaps the kernel should default to freezing a non-root filesystem when it becomes degraded, absent an explicit configuration permitting otherwise. But for the root filesystem, that would be counterproductive and prevent the failure from being handled gracefully.

Obviously, the tradeoffs are different for a system that is still trying to boot as opposed to one that is fully up and running.

Re:Btrfs in Linux 6.2 brings performance improvements, bette... by awiesenhofer on Tuesday December 13, 2022 @01:03PM (#33972991)
As someone who too had all of these happen at one point or another over the years: These are all process issues, not technical issues. No matter your RAID config or FS features,you're gonna have a bad time.
Re:Btrfs in Linux 6.2 brings performance improvements, bette... by chomp on Monday December 12, 2022 @06:22PM (#33961921)
Why? Are you in a position where you can’t modify grub or fstab?
Re:Btrfs in Linux 6.2 brings performance improvements, bette... by dale_glass on Monday December 12, 2022 @06:31PM (#33962010)
Because RAID is a High Availability technology.

It's not a backup. It doesn't protect against mistakes, bugs, or the server failing in some other way. What it's good for is for ensuring that work keeps happening if a disk fails. And disk failures happen to be fairly frequent, since spinning rust is a rather delicate technology.

If somebody has to connect to the machine and fiddle with it by hand it means that the system has been down, possibly for hours, when that was the exact thing you were trying to prevent by setting up RAID on it.

Re:Btrfs in Linux 6.2 brings performance improvements, bette... by viraptor on Monday December 12, 2022 @06:42PM (#33962117)
You don't have to modify it after a failure. You can set it right now to explicitly say "when I end up in a degraded state, I want to boot anyway".

> What it's good for is for ensuring that work keeps happening if a disk fails.

Different services have different priorities. I want my work servers to keep running, but my home server under the desk to stop until I replace the failed drive. Btrfs gives you a choice.

Re:Btrfs in Linux 6.2 brings performance improvements, bette... by alerighi on Monday December 12, 2022 @07:51PM (#33963000)
No, because I want to be elsewhere on a Sunday evening than in front of a computer modifying fstab to bring a production server back online.
Re:Btrfs in Linux 6.2 brings performance improvements, bette... by RealStickman_ on Tuesday December 13, 2022 @01:03AM (#33965377)
Unless you want to reboot the server this shouldn't affect you in any way.
Re:Btrfs in Linux 6.2 brings performance improvements, bette... by ndsipa_pomu on Tuesday December 13, 2022 @07:51AM (#33968200)
Unless you get a power outage or some other event that causes a reboot (e.g. STONITH)
Re:Btrfs in Linux 6.2 brings performance improvements, bette... by happymellon on Tuesday December 13, 2022 @02:34AM (#33965903)
Unless you give it permission.

It's an option to enable. If you needing to configure something is a dealbreaker then having RAID is probably not for you anyway.

Re:Btrfs in Linux 6.2 brings performance improvements, bette... by josephcsible on Monday December 12, 2022 @06:58PM (#33962321)
IMO, the inconvenience this causes is outweighed by the prevention of data loss for people who otherwise would never have noticed the degraded array.
Re:Btrfs in Linux 6.2 brings performance improvements, bette... by ilyt on Monday December 12, 2022 @10:00PM (#33964171)
Right but if it's remote server you're fucked and you can't login on it to even assess what happened
Re:Btrfs in Linux 6.2 brings performance improvements, bette... by ndsipa_pomu on Tuesday December 13, 2022 @07:54AM (#33968218)
This is why I want servers to always boot to an OS whenever possible. It's fine if production data is not available until someone fixes an array, but without the OS, it's a pain to even figure out what's happened, let alone fix it.
Re:Btrfs in Linux 6.2 brings performance improvements, bette... by josephcsible on Monday December 12, 2022 @10:03PM (#33964197)
Don't servers tend to include some kind of out-of-band management like HP iLO, Dell iDRAC, or OpenBMC?
Re:Btrfs in Linux 6.2 brings performance improvements, bette... by kiririn on Tuesday December 13, 2022 @06:46AM (#33967593)
That’s what the likes of dropbear-initramfs is for
Re:Btrfs in Linux 6.2 brings performance improvements, bette... by ClumsyPilot on Monday December 12, 2022 @08:07PM (#33963182)
I think this is the difference in target audience - for home use, maybe I won't have monitoring, so it should fail to boot.

For enterprise, if you dont have monitoring setup it's on you

Re:Btrfs in Linux 6.2 brings performance improvements, bette... by cmurf on Tuesday December 13, 2022 @01:47AM (#33965628)
Automatic degraded mount at boot time isn't implemented by md either, it's implemented by a dracut module (or whatever creates the initramfs). The gist is that when mdadm assembly fails, the dracut module's script performs a 5 minute wait to see if all devices will appear, and then if not, tries to assemble degraded.

These days, with UEFI prevalent, a system won't boot without EFI system partitions replicated (and possibly sync'd) on every drive.

Re:Btrfs in Linux 6.2 brings performance improvements, bette... by ndsipa_pomu on Tuesday December 13, 2022 @06:12AM (#33967285)
You can boot from a MD RAID1 system that's degraded easily enough. Here's some info on how to implement it https://outflux.net/blog/archives/2018/04/19/uefi-booting-an...
Re:Btrfs in Linux 6.2 brings performance improvements, bette... by jiggawatts on Monday December 12, 2022 @06:59PM (#33962338)
The list of bugs and counter-intuitive design decisions in BTRFS RAID should make anyone pause before ever considering it as a viable filesystem for anything.

It's like people justifying MySQL saying that it's okay for it to lose or corrupt data, and that transactional integrity doesn't matter as much as people say it does.

Yeah, maybe if you're website is a blog. But anyone storing real data should run away screaming from systems like this.

Maybe MySQL is sort-of-okay now? I dunno. It's possible BTRFS RAID 5 won't eat your data or crash your server regularly now.

I'm going to stay away from both anyway.

Re:Btrfs in Linux 6.2 brings performance improvements, bette... by happymellon on Tuesday December 13, 2022 @02:41AM (#33965937)
I've had more issues with my ZFS arrays than the BTRFS ones.

The Linux implementation is pretty awful, with it demanding that it uses the absolute `/dev/sdx` reference even if you try to build it using serials or other unchaging reference.

Replace a disk and then after the next restart it fails to bring up the RAID because `sdf` points to a different disk. At least BTRFS uses internal UUIDs so can bring up the arrays when the disk ids change.

Fairly fundamental stuff, rather than complaining about an option not being enabled by default.

Re:Btrfs in Linux 6.2 brings performance improvements, bette... by wokkel on Tuesday December 13, 2022 @04:46AM (#33966625)
Uh, using /dev/disk/by-id to assemble a zfs array is pretty standard for zol. I never use device names and shuffling disks has never required any manual intervention on my part. Was this a very old ZoL?
Re:Btrfs in Linux 6.2 brings performance improvements, bette... by vetinari on Tuesday December 13, 2022 @05:43AM (#33967033)
At a time, it was the default, and you had to go out of your way to use /dev/disk/by-id (you had to create your pool, export it, and then import it by id), only to be hit by another issue, where when preparing grub, it was looking for the IDs straight in /dev (that's how I learned that ZPOOL_VDEV_NAME_PATH=YES exists).

Yeah, putting / on zfs was not smart. Nowadays, when the distro doesn't support it out of the box and doesn't come with kernel+bootloader+zfs tested together (i.e. proxmox, ubuntu), I wouldn't do it.

Re:Btrfs in Linux 6.2 brings performance improvements, bette... by happymellon on Wednesday December 14, 2022 @03:34PM (#33990099)
This was last year on Ubuntu.

I assembled the zfs array using by-id, but after a reboot zfs reports the drives as being on /dev/sdx.

Re:Btrfs in Linux 6.2 brings performance improvements, bette... by tecleandor on Tuesday December 13, 2022 @07:54AM (#33968215)
I don't know if you're talking about a veeeeery old implementation or haven't properly configured it, but you can use both the device reference or the partition UUID.

This is one of my systems using both identifications:

  root@multivac[~]# zpool status
    pool: boot-pool
   state: ONLINE
    scan: scrub repaired 0B in 00:01:33 with 0 errors on Fri Dec  9 03:46:34 2022
  config:

        NAME        STATE     READ WRITE CKSUM
        boot-pool   ONLINE       0     0     0
          sdg3      ONLINE       0     0     0

  errors: No known data errors

    pool: multivac-slow
   state: ONLINE
    scan: scrub repaired 0B in 07:05:51 with 0 errors on Sun Nov 20 09:05:55 2022
  config:

        NAME                                      STATE     READ WRITE CKSUM
        multivac-slow                             ONLINE       0     0     0
          mirror-0                                ONLINE       0     0     0
            ad3395b6-ac43-453c-9ba2-cf65542cb710  ONLINE       0     0     0
            2c423fe3-07a4-44cb-bc39-8b267c79d8c3  ONLINE       0     0     0
          mirror-1                                ONLINE       0     0     0
            8ca9d5a2-04cb-47a0-987a-8b3d27326975  ONLINE       0     0     0
            bec4c67f-fa41-4ab2-907f-0e5b1e052300  ONLINE       0     0     0
        cache
          bfef4d7f-c484-4c37-a0b7-81d59fa1e189    ONLINE       0     0     0
  root@multivac[~]# blkid|grep zfs_member
  /dev/sda2: LABEL="multivac-slow" UUID="4053361656876756561" UUID_SUB="363024978934966364" BLOCK_SIZE="4096" TYPE="zfs_member" PARTUUID="2c423fe3-07a4-44cb-bc39-8b267c79d8c3"
  /dev/sdd2: LABEL="multivac-slow" UUID="4053361656876756561" UUID_SUB="10877444988141002268" BLOCK_SIZE="4096" TYPE="zfs_member" PARTUUID="8ca9d5a2-04cb-47a0-987a-8b3d27326975"
  /dev/sdb2: LABEL="multivac-slow" UUID="4053361656876756561" UUID_SUB="9244362969528724588" BLOCK_SIZE="4096" TYPE="zfs_member" PARTUUID="ad3395b6-ac43-453c-9ba2-cf65542cb710"
  /dev/sdc2: LABEL="multivac-slow" UUID="4053361656876756561" UUID_SUB="11658072268678819533" BLOCK_SIZE="4096" TYPE="zfs_member" PARTUUID="bec4c67f-fa41-4ab2-907f-0e5b1e052300"
  /dev/sdg3: LABEL="boot-pool" UUID="13291833732043257716" UUID_SUB="15424416082895860251" BLOCK_SIZE="4096" TYPE="zfs_member" PARTUUID="b6c0b302-7599-4862-888b-be6f7a85b970"
Re:Btrfs in Linux 6.2 brings performance improvements, bette... by michaelmrose on Tuesday December 13, 2022 @12:28PM (#33972280)
I think the advice was to simply use /dev/disk/by-id/foo when originally creating a pool and one would never have a problem with /dev/sda being a different disk and this was true at least back to 2015ish.