linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Duncan <1i5t5.duncan@cox.net>
To: linux-btrfs@vger.kernel.org
Subject: Re: Fwd: unable to delete files after kernel upgrade from 3.8.10 to 3.12
Date: Sun, 10 Nov 2013 15:42:53 +0000 (UTC)	[thread overview]
Message-ID: <pan$db67$dd5d03d8$5d8b6d6f$728d89d1@cox.net> (raw)
In-Reply-To: 201311110010.36848.russell@coker.com.au

Russell Coker posted on Mon, 11 Nov 2013 00:10:36 +1100 as excerpted:

> On Thu, 7 Nov 2013, Bartosz Kulicki <bartosz.kulicki@gmail.com> wrote:
>> FWIW - just before nuking the fs I have added a 3GB loopback device to
>> btrfs.
>> 
>> This restored ability to delete the files but I could not remove the
>> loopback after deleting some large files (if I remember correctly error
>> I got was "block device required")
> 
> I once had a problem where I added a second block device and started a
> balance.  But for some reason the balance decided to make metadata a
> RAID-1 and even when there was enough space I couldn't remove it (you
> must have 2 devices for RAID-1).
> 
> So I added a third device, that allowed me to delete the second device
> which made the meta-data no longer RAID-1 and I could then delete the
> third device and have the single-device BTRFS filesystem I wanted.
> 
> That was a while ago, maybe running kernel 3.10 or 3.8.

Hmm... Very good point that I guess the classic "add a device to get out 
of the jam" recommendation doesn't cover, without a more complex 
explanation, at least!  Thanks for bringing it up!

For safety reasons btrfs (almost[1]) always defaults to two copies of 
metadata.  On a single device, that's DUP mode, two copies obviously on 
the same device.  But with two or more devices it'll default metadata to 
raid1 mode, trying to keep one copy of metadata on each of two different 
devices thus allowing the chance to recover at least the data that's on 
surviving drives in the event of a failure.

So if there's only a single existing device and the "add-a-device-to-get-
out-of-the-jam" method is used, either adding a /third/ device may be 
needed (your solution), or alternatively, doing the balance using options 
to force single mode may be necessary:

btrfs balance -mconvert=single -f <path>

Or possibly -mconvert=dup, to force metadata to stay dup mode, but I'm 
not sure without trying it whether dup will work on more than a single 
device.

---
[1] The exception is SSD, I believe only with a single device, where 
SINGLE mode is the default because some SSDs automatically dedup in any 
case, so even DUP mode would only actually be physically stored only 
once, second-guessing btrfs' efforts to keep two separate copies.  I'm 
not sure why the dedup feature changes the default for /all/ ssds as it 
seems to me SSDs without that feature should arguably still get DUP by 
default which means it's a bad exception, do DUP regardless and if the 
hardware dedups let the hardware dedup seems more reasonable, but that's 
what's documented.

-- 
Duncan - List replies preferred.   No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master."  Richard Stallman


      reply	other threads:[~2013-11-10 15:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAMajw1N4bqFyHA4V8SkEzQFZF8adN0xQDShRq7bC2Of+nxsJGA@mail.gmail.com>
2013-11-06 21:53 ` Fwd: unable to delete files after kernel upgrade from 3.8.10 to 3.12 Bartosz Kulicki
2013-11-07  8:49   ` Stefan Behrens
2013-11-07 11:33     ` Bartosz Kulicki
2013-11-07 11:43       ` Bartosz Kulicki
2013-11-07 14:04         ` Duncan
2013-11-10 13:10         ` Russell Coker
2013-11-10 15:42           ` Duncan [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='pan$db67$dd5d03d8$5d8b6d6f$728d89d1@cox.net' \
    --to=1i5t5.duncan@cox.net \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).