Handle broken disks with BTRFS

Oct 21, 2020
113
7
23
38
I'm testing the behavior of BTRFS in case of disk failure.

As a first test, I disconnect one of the two disks in "RAID 1".
I get errors whether it's boot disks or not, but the errors are different.
In case of boot disk I have this screen:
1682523931692.jpeg

Otherwise I have:
1682523999186.jpeg

How can I fix?

Ask if you need any other information.
 
This has come up before on this forum. BTRFS will not mount a mirror when a disk is missing (and I really don't understand why they made this the default). You need to enable this option first. It's probably somewhere in the BTRFS documentation.
 
I followed this guide to temporarily change the GRUB.
The change was to add
Code:
rootflags=degraded
to the end of the line starting with linux.

This made it possible to overcome the problem of boot disks.
EDIT:
There is a strange thing, or rather (in my opinion) wrong.
Reported BTRFS volume capacity is twice the actual capacity.

For non-boot disks what should I do?
 
Last edited:
I think I've found a better solution.

In the screen initramfs insert:
Code:
mount -o degraded /dev/sda3 /root -t btrfs

Where "/dev/sda3" is the healthy disck.
And press Ctrl-D.

For non-boot disks in the proxmox shell enter:
Code:
mount -o degraded /dev/nvme0n1 /BTRFS

Where "/dev/nvme0n1" is the healthy disck, and /BTRFS is the mount path.

The problem of the reported BTRFS volume twice the actual capacity remains but, for me, seams more clear as solution.
 
Last edited:
  • Like
Reactions: leesteken
There is a strange thing, or rather (in my opinion) wrong.
Reported BTRFS volume capacity is twice the actual capacity.
Yes, you'll also have this with ZFS. Due to compression, deduplication and other weirdness, you cannot say how big your virtual disk actually is, therefore the safer option was to just state what you have as a backing device. I don't like it either, yet here we are.
 
Any updates to this, I have a server offsite I cant ipmi into so to change grub id have to be local onsite , whats happens if I add rootflags=degraded even though both disks are working still?
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!