All of lore.kernel.org
 help / color / mirror / Atom feed
* btrfs dev del not transaction protected?
@ 2019-12-20  4:05 Marc Lehmann
  2019-12-20  5:24 ` Qu Wenruo
  0 siblings, 1 reply; 18+ messages in thread
From: Marc Lehmann @ 2019-12-20  4:05 UTC (permalink / raw)
  To: linux-btrfs

Hi!

I used btrfs del /somedevice /mountpoint to remove a device, and then typed
sync. A short time later the system had a hard reset.

Now the file system doesn't mount read-write anymore because it complains
about a missing device (linux 5.4.5):

[  247.385346] BTRFS error (device dm-32): devid 1 uuid f5c3dc63-1fac-45b3-b9ba-ed1ec5f92403 is missing
[  247.386942] BTRFS error (device dm-32): failed to read chunk tree: -2
[  247.462693] BTRFS error (device dm-32): open_ctree failed

The thing is, the device is still there and accessible, but btrfs no longer
recognises it, as it already deleted it before the crash.

I can mount the filesystem in degraded mode, and I have a backup in case
somehting isn't readable, so this is merely a costly inconvinience for me
(it's a 40TB volume), but this seems very unexpected, both that device
dels apparently have a race condition and that sync doesn't actually
synchronise the filesystem - I naively expected that btrfs dev del doesn't
cause the loss of the filesystem due to a system crash.

Probably nbot related, but maybe worth mentioning: I found that system
crashes (resets, not power failures) cause btrfs to not mount the first
time a mount is attempted, but it always succeeds the second time, e.g.:

   # mount /device /mnt
   ... no errors or warnings in kernel log, except:
   BTRFS error (device dm-34): open_ctree failed
   # mount /device /mnt
   magically succeeds

The typical symptom here is that systemd goes into emergency mode on mount
failure, but simpyl rebooting, or executing the mount manually then succeeds.

Greetings,
Marc

-- 
                The choice of a       Deliantra, the free code+content MORPG
      -----==-     _GNU_              http://www.deliantra.net
      ----==-- _       generation
      ---==---(_)__  __ ____  __      Marc Lehmann
      --==---/ / _ \/ // /\ \/ /      schmorp@schmorp.de
      -=====/_/_//_/\_,_/ /_/\_\

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2019-12-21 20:06 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-20  4:05 btrfs dev del not transaction protected? Marc Lehmann
2019-12-20  5:24 ` Qu Wenruo
2019-12-20  6:37   ` Marc Lehmann
2019-12-20  7:10     ` Qu Wenruo
2019-12-20 13:27       ` Marc Lehmann
2019-12-20 13:41         ` Qu Wenruo
2019-12-20 16:53           ` Marc Lehmann
2019-12-20 17:24             ` Remi Gauvin
2019-12-20 17:50               ` Marc Lehmann
2019-12-20 18:00               ` Marc Lehmann
2019-12-20 18:28                 ` Eli V
2019-12-20 20:24             ` Chris Murphy
2019-12-20 23:30               ` Marc Lehmann
2019-12-21 20:06               ` Zygo Blaxell
2019-12-21  1:32             ` Qu Wenruo
2019-12-20 17:07           ` Marc Lehmann
2019-12-21  1:23             ` Qu Wenruo
2019-12-20 17:20           ` Marc Lehmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.