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: How does "btrfs fi show" show full?
Date: Tue, 6 May 2014 20:10:00 +0000 (UTC)	[thread overview]
Message-ID: <pan$1f225$3bfd5829$2b5ac65b$4bb85dc6@cox.net> (raw)
In-Reply-To: 20140505055029.GM10159@merlins.org

Marc MERLIN posted on Sun, 04 May 2014 22:50:29 -0700 as excerpted:

> In the second FS:
>> >Label: btrfs_pool1  uuid: [...]
>> >	Total devices 1 FS bytes used 442.17GiB
>> >	devid    1 size 865.01GiB used 751.04GiB path [...]
> 
> The difference is huge between 'Total used' and 'devid used'.
> 
> Is btrfs going to fix this on its own, or likely not and I'm stuck doing
> a full balance (without filters since I'm balancing data and not
> metadata)?
> 
> If that helps.
> legolas:~# btrfs fi df /mnt/btrfs_pool1
> Data, single: total=734.01GiB, used=435.29GiB
> System, DUP: total=8.00MiB, used=96.00KiB
> System, single: total=4.00MiB, used=0.00
> Metadata, DUP: total=8.50GiB, used=6.74GiB
> Metadata, single: total=8.00MiB, used=0.00

Definitely helps.  The spread is in data.

Try

btrfs balance start -dusage=20 /mnt/btrfs_pool1

You still have plenty of unused (if allocated) space available, so you 
can play around with the usage= a bit.  -dusage=20 will be faster than 
something like -dusage=50 or -dusage=80, likely MUCH faster, but will 
return less chunks to unallocated, as well.  Still, your spread between 
data-total and data-used is high enough, I expect -dusage=20 will give 
you pretty good results.

Since show says you still have ~100 GiB unallocated in df, there's no 
real urgency, and again I'd try -dusage=20 the first time.  If that 
doesn't cut it you can of course try bumping the usage= as needed, but 
because you still have 100 GiB unallocated and because the data used vs. 
total spread is so big, I really do think -dusage=20 will do it for you.
As your actual device usage goes up the spread between used and size will 
go down, meaning more frequent balances to keep some reasonable 
unallocated space available, and you'll either need to actually delete 
some stuff or to bump up those usage= numbers as well, but usage=20 is 
very likely to be sufficient at this point.

I hadn't seen anyone try an actual formula as Brendan suggests in his 
post, and I'm not actually sure that formula will apply well in all use-
cases as I think fragmentation and fill-pattern will have a lot to do 
with it, but based on his post it does apply for his use-case, and the 
same general principle if not the specific formula should apply 
everywhere and is what I'm doing above, only simply eyeballing it, not 
using a specific formula.

-- 
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


  parent reply	other threads:[~2014-05-06 20:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-05  0:54 How does "btrfs fi show" show full? Marc MERLIN
2014-05-05  4:11 ` Brendan Hide
2014-05-05  5:50   ` Marc MERLIN
2014-05-05  7:48     ` Brendan Hide
2014-05-06 20:10     ` Duncan [this message]
2014-05-07  7:59       ` Marc MERLIN
2014-05-07 10:53         ` Brendan Hide
2014-05-07 11:30           ` Marc MERLIN
     [not found]           ` <yzWd1n0292w7UQp01zWf8e>
2014-05-07 12:40             ` Duncan

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$1f225$3bfd5829$2b5ac65b$4bb85dc6@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).