On Nov 2, 2014, at 8:43 PM, Zygo Blaxell <zblaxell@xxxxxxxxxxxxxxx> wrote: > On Sun, Nov 02, 2014 at 02:57:22PM -0700, Chris Murphy wrote: >> >> For example if I have a two device Btrfs raid1 for both data and >> metadata, and one device is removed and I mount -o degraded,rw one >> of them and make some small changes, unmount, then reconnect the >> missing device and mount NOT degraded - what happens? I haven't tried >> this. > > I have. It's a filesystem-destroying disaster. Never do it, never let > it happen accidentally. Make sure that if a disk gets temporarily > disconnected, you either never mount it degraded, or never let it come > back (i.e. take the disk to another machine and wipefs it). Don't ever, > ever put 'degraded' in /etc/fstab mount options. Nope. No. Well I guess I now see why opensuse's plan for Btrfs by default proscribes multiple device Btrfs volumes. The described scenario is really common with users, I see it often on linux-raid@. And md doesn't have this problem. The worst case scenario is if devices don't have bitmaps, and then a whole device rebuild has to happen rather than just a quick "catchup". > > btrfs seems to assume the data is correct on both disks (the generation > numbers and checksums are OK) but gets confused by equally plausible but > different metadata on each disk. It doesn't take long before the > filesystem becomes data soup or crashes the kernel. This is a pretty significant problem to still be present, honestly. I can understand the "catchup" mechanism is probably not built yet, but clearly the two devices don't have the same generation. The lower generation device should probably be booted/ignored or declared missing in the meantime to prevent trashing the file system. Chris Murphy -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html
