From: Duncan <1i5t5.duncan@cox.net>
To: linux-btrfs@vger.kernel.org
Subject: Re: btrfs fi usage -T shows unallocated column as total in drive, not total available to btrfs
Date: Thu, 27 Dec 2018 07:12:35 +0000 (UTC) [thread overview]
Message-ID: <pan$ac19$67da17d$80a83557$ce46be42@cox.net> (raw)
In-Reply-To: CAJCQCtS7XJaD4Mhrg152K4zfj-w2P0JkpUvZ0R-M6x8QmCc1tg@mail.gmail.com
Chris Murphy posted on Wed, 26 Dec 2018 17:36:19 -0700 as excerpted:
> I'm not really following this. An fs resize is implied by any device
> add, remove or replace command. In the case of replace, it will
> efficiently copy the device being replaced to the designated drive, and
> then once that succeeds resize the file system to reflect the size of
> the replacement device. I'm also confused why devid 4 seems to be
> present before and after your device replace, so I have to wonder if
> your copy paste really worked out as intended? And also, what version of
> kernel and btrfs-progs are you using?
I thought... yes...
Just checked the btrfs-replace manpage (v4.19.1) and it says:
Note
the filesystem has to be resized to fully take advantage of a larger
target device; this can be achieved with btrfs filesystem
resize <devid>:max /path
So it does *not* auto-resize after the replace.
Also, I'm not positive on this, and I don't see it mentioned in the
manpage, but I /think/ replace (unlike add/remove) keeps the same devid
for the new device.
(And IIRC one of the devs commented that there's a devid 0 during the
replace itself, but I'm unsure whether that's the source or the
destination, that is, whether the old ID is switched to the new device at
the beginning of the replace so the old one temporarily gets the 0 during
the replace until it's deleted at the end, or end so the new one
temporarily gets it until the id is transferred at the end. That was in
the context of a draft patch that didn't yet account for the possibility
of devid 0 during replace, and the comment was pointing out the
possibility.)
If that's correct then the devid 4 could indeed be the old device at
first (when it refers to sda and has 164.5 GiB unallocated), but the new
device later (when it refers to sdu and has 6.53 TiB unallocated), even
before the resize, that being the point of confusion (6.53 TB unallocated
even tho it can't actually use it as it hasn't been resized yet) that
triggered the original post in the first place.
To address that point, I suppose ideally there'd be another line when the
filesystem's smaller than the available device size, device-space outside
filesystem, or some such.
Tho you are correct that fi show and fi df's output don't correspond
exactly to fi usage, without some sort of decoder ring to translate
between them, and even with the decoder ring, the numbers come out but
slightly different things are reported.
Meanwhile, while I normally want the filesystem usage info and thus use
that command, for something like this I'd be specifically interested in
the specific device's usage, and thus would use btrfs device usage, in
place of or in addition to btrfs filesystem usage.
It'd be interesting to see what device usage (as opposed to filesystem
usage) did with the unreachable space in terms of reporting -- maybe it
has that separate line tho I doubt it, but if not does it count it or
not?. But that wasn't posted and presumably the query wasn't run while
in the still-unresized state, and I guess it's a bit late now to get it...
--
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
next prev parent reply other threads:[~2018-12-27 7:14 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-24 17:21 btrfs fi usage -T shows unallocated column as total in drive, not total available to btrfs joshua
2018-12-27 0:36 ` Chris Murphy
2018-12-27 7:12 ` Duncan [this message]
2018-12-27 20:06 ` Chris Murphy
2018-12-27 20:07 ` Chris Murphy
2018-12-27 20:33 ` joshua
2018-12-27 23:37 ` Chris Murphy
2018-12-28 4:09 ` 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$ac19$67da17d$80a83557$ce46be42@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 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.