[Discuss] btrfs tip

Matthew Gillen me at mattgillen.net
Sat Jul 3 14:51:20 EDT 2021


Came back from vacation to a dead disk in my main linux server.  Disk
had been dying for a while, and we had a power outage at some point
while I was gone which must have finished it off.  Kernel had been stuck
trying to initialize the disks on boot for 3 days.

Protip: if you use btrfs as your root filesystem, and use a
RAID1/mirroring configuration, then add the 'degraded' flag to your grub
kernel command line.  That will allow it to mount (and boot) even if a
disk dies.  Don't know why this isn't the default...

If you don't do that (or manually edit the command line to add it if you
have console access) you have to boot off a rescue USB that understands
btrfs in order to start the 'btrfs replace' operation.

To do this, you add to the rootflags parameter:
   rootflags=subvol=root,degraded

Where do you set that?  The grub config keeps moving around.  Currently
my Fedora33 box the actual command lines for the kernel are in:
/boot/loader/entries/*.conf

(note that it needs to be on the kernel command line, having it as an
option in /etc/fstab is not sufficient, at least when it comes to the
root filesystem)

Matt


More information about the Discuss mailing list