Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

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

My idea was that (using loopback devices) it works like this

  1. Create the raid array sudo mkfs.btrfs -m raid1 -d raid1 /dev/loop1 /dev/loop2
  2. You mount them sudo mount /dev/loop1 /mnt and mark them touch goodcondition
  3. You unmount and simulate disk failure (remove disk or delete loopback device loop2 in my case)
  4. You mount degraded -o degraded and mark again touch degraded
  5. You add the bad disk again sudo btrfs dev add /dev/loop2
  6. You rebalance sudo btrfs fi ba /mnt

And Raid 1 should work again. But that's not the case. sudo btrfs fi show:

Total devices 3 FS bytes used 28.00KB
devid    3 size 4.00GB used 264.00MB path /dev/loop1
devid    2 size 4.00GB used 272.00MB path /dev/loop2
*** Some devices missing

The file degraded lives on loop1 but not on loop2 when loop2 is mounted in degraded mode. Why is that?

share|improve this question
up vote 2 down vote accepted

It looks like you added a third device and so the original second is still missing. I guess you need to remove the missing device before adding the new one. The brtfs mailing list might also be a better place to ask this question.

share|improve this answer
I think asking how to restore a degraded RAID is not too specific. It' nice to know how it's created but also to know how to handle it is nice :) – turbo Jun 21 '11 at 23:14
@turbo: It's just that btrfs is still new and not yet widely used, so the knowledge is still concentrated in the mailing list participants, few of whom are likely to be around here to answer your question. Your best bet is probably to work out the answer there, then come back here and post a detailed answer. Rake in rep points while helping to diffuse btrfs knowledge to the world. :) – Nicholas Knight Jun 22 '11 at 4:43

In this situation, you need to do two things. First, you need to indicate to btrfs that the missing device is permanently gone: btrfs dev delete missing /mnt (missing is a keyword indicating any missing devices). Second, you need to rebalance to ensure that the data is properly replicated: btrfs fi balance /mnt.

share|improve this answer

Your Answer


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.