dracut icon indicating copy to clipboard operation
dracut copied to clipboard

enable unattended degraded boot for btrfs

Open cmurf opened this issue 3 years ago • 3 comments

Describe the enhancement

Currently dracut assembles mdadm raid during startup, and enters a 300s loop if all devices aren't ready to do a normal assemble. After 300s dracut commands mdadm to assemble degraded.

The requirements would be something like:

  1. Count to 300
  2. /usr/lib/udev/rules.d/64-btrfs.rules currently waits indefinitely for all btrfs devices to become available; set SYSTEMD_READY=1 at the end of the countdown so that it's willing to issue the proper command
  3. Modify/add degraded to the existing (if present) rootflags boot parameter so that systemd attempts degraded mount of the Btrfs file system.

This is probably acceptable for servers. Desktops it might be trickier/riskier because (a) users might be more forgetful of plugging in a drive (b) the resulting split brain potential if they don't do a scrub following the resumption of normal operation and then the other drive goes missing. So in the desktop user case, additional protective features might be necessary.

Does dracut have a facility to differentiate between desktop and all-other use cases?

cmurf avatar Aug 16 '22 20:08 cmurf

I too want to see this feature in BTRFS.

Why would dracut and a 300s delay be necessary? ZFS handles the (temporary) removal of disks flawlessly in my experience. Why could BTRFS not replicate ZFS' handling of degraded RAID volumes where no dracut or lengthy delays are required?

danboid avatar Sep 03 '22 18:09 danboid

Why would dracut and a 300s delay be necessary?

Same reason as for mdadm raid. To be certain the device isn't merely slow to appear. Degraded operation is obviously more risky, so you don't want to quickly resort to degraded operation unless necessary. 300s is the same as it is now for the mdadm case so I'm only suggesting parity.

Dracut is only applicable during boot. Btrfs already can handle partial and full failure of a device OK.

I don't know ZFS degraded behavior at all so I can't comment about it.

cmurf avatar Sep 05 '22 16:09 cmurf

Does dracut have a facility to differentiate between desktop and all-other use cases?

That would be no and no particular interest from upstream to fall into that rabbit hole.

johannbg avatar Dec 21 '22 18:12 johannbg