Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying out btrfs and I noticed some funny behaviour:

I have two drives in a raid 1 configuration.

sudo btrfs fi show
Label: none  uuid: 52b9c6f6-ce5c-4727-861e-e2fd012e475f
    Total devices 2 FS bytes used 251.16GiB
    devid    1 size 298.09GiB used 252.01GiB path /dev/sdi
    devid    2 size 298.09GiB used 252.01GiB path /dev/sdh

As you can see they are set up as mdata=raid1, data=raid1:

sudo btrfs fi df /btr/.fsroot/
Data, RAID1: total=251.00GiB, used=250.57GiB
System, RAID1: total=8.00MiB, used=64.00KiB
Metadata, RAID1: total=1.00GiB, used=597.47Mi

Now if I fail /dev/sdh (e.g. pull out the sata cable), everything works as expected,

sudo btrfs fi show
Label: none  uuid: 52b9c6f6-ce5c-4727-861e-e2fd012e475f
    Total devices 2 FS bytes used 251.16GiB
    devid    1 size 298.09GiB used 252.01GiB path /dev/sdi
    *** Some devices missing

the filesystem is even unmounted. But what bothers me is what happens if I fail /dev/sdi:

Label: none  uuid: 52b9c6f6-ce5c-4727-861e-e2fd012e475f
    Total devices 2 FS bytes used 251.16GiB
    devid    1 size 298.09GiB used 252.01GiB path /dev/sdi
    devid    2 size 298.09GiB used 252.01GiB path /dev/sdh

So basically the failed drive is not detected at all. This can't even be fixed by running btrfs device scan. So in a production environment, how am I supposed to detect, that my raid is no more?

share|improve this question

Have you scrubbed the BTRFS filesystem? A scrub should read and check all available copies. And it's recommended to schedule a scrub, for example as monthly cronjob, so this is how you would be notified.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.