From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f45.google.com ([74.125.82.45]:35095 "EHLO mail-wm0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751695AbdHRVw4 (ORCPT ); Fri, 18 Aug 2017 17:52:56 -0400 Received: by mail-wm0-f45.google.com with SMTP id m85so9017928wma.0 for ; Fri, 18 Aug 2017 14:52:55 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <38bbcea5-882b-1637-1970-e147cb141d39@gmx.com> <5193c358-f64b-6b1f-bc55-c9e423a1ac8c@gmx.com> From: Zirconium Hacker Date: Fri, 18 Aug 2017 17:52:54 -0400 Message-ID: Subject: Re: BTRFS error (device sda4): failed to read chunk tree: -5 To: Chris Murphy Cc: Qu Wenruo , Btrfs BTRFS Content-Type: text/plain; charset="UTF-8" Sender: linux-btrfs-owner@vger.kernel.org List-ID: Ok, so since it's clear now that I need that 5 GB device to be present... I found the image file. But how do I get BTRFS to recognize the image as a device? I have zero experience with multi-device systems. Setting it up as a loop device doesn't fix mounting, and wipefs doesn't detect the BTRFS magic number, but printing some of it to console shows it does have real data. Writing the magic number onto it (it's a copy of the original to be safe) shows in dump-super, but all other values are zero. I tried sending the above on my phone earlier but it was detected as a "virus" because it contained HTML. Whoops. On Fri, Aug 18, 2017 at 11:00 AM, Chris Murphy wrote: > On Fri, Aug 18, 2017 at 2:47 AM, Zirconium Hacker wrote: > >> I vaguely remember following this guide at some point: >> http://marc.merlins.org/perso/btrfs/post_2014-05-04_Fixing-Btrfs-Filesystem-Full-Problems.html >> -- specifically the "Balance cannot run because the filesystem is >> full" part. This may have broken some things? >> > > If you don't do 'btrfs device delete /dev/loop0' or if that command > does not complete, then it's possible to get into the situation you're > in. > > Have you ever mounted this file system with -o degraded? > > I'm going to guess the history is something like: > 1. enospc > 2. btrfs dev add > 3. some kind of filtered balance, which only causes data block groups > to be moved to the 2nd device > 4. 2nd device is physically removed without first 'btrfs dev del' > > Zirco's superblock very clearly says num_devices 2, so I'd expect > normal mount to always fail unless both devices are present. Is there > some weird edge case where Btrfs might permit non-degraded mount when > only data bg's are on a 2nd device? And then trouble only happens > later when a balance is done and it goes looking for these bg's? And > then, boom! > > -- > Chris Murphy