From: Hugo Mills <hugo@carfax.org.uk>
To: Stirling Westrup <swestrup@gmail.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: Rebalancing Question
Date: Sat, 11 Jul 2020 16:19:47 +0100 [thread overview]
Message-ID: <20200711151947.GA12186@savella.carfax.org.uk> (raw)
In-Reply-To: <CAJt7KB-c4vRYgjJ1WZJyNZuey6nH=y2BcQNVYJa6YAG9MTfKhQ@mail.gmail.com>
On Sat, Jul 11, 2020 at 10:42:30AM -0400, Stirling Westrup wrote:
> I have a BTRFS built with two devices md0 and md1 on a server. I wish
> to move as much data as will fit from md0 to md1, but I cannot figure
> out a balance command that will do that.
>
> My use case is a file server with a fixed number of hard drive slots
> and two raids. md0 is a raid using most of the slots with small
> drives, and md1 is a raid using the remaining slots with large drives.
> I'm trying to shrink md0, so I can remove some small drives and put in
> new large drives to add to md1.
>
> I have read the notes on the balance command several times but I can't
> figure out how to get it to do what I want, if it's even possible.
Balance isn't the right tool for this. You can reduce the size that
the FS takes up on md0, using "btrfs fi resize 0:10G /mount/btrfs",
where the 0 is the device ID of md0 (see btrfs fi show), and the 10G
is the target size for the device. You can then use the mdadm tools to
reduce the size of md0 (but no smaller than 10G, in this example).
I would definitely recommend reducing the FS by more than the
device, just to cope with any rounding errors in tooling.
If you're removing md0 entirely from the FS, and have space to do
so, then btrfs dev delete is what you need -- but it sounds like
that's not the case here.
Hugo.
--
Hugo Mills | Great films about cricket: Monster's No-Ball
hugo@... carfax.org.uk |
http://carfax.org.uk/ |
PGP: E2AB1DE4 |
next prev parent reply other threads:[~2020-07-11 16:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-11 14:42 Rebalancing Question Stirling Westrup
2020-07-11 15:19 ` Hugo Mills [this message]
2020-07-11 15:58 ` Andrei Borzenkov
2020-07-14 4:47 ` Stirling Westrup
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=20200711151947.GA12186@savella.carfax.org.uk \
--to=hugo@carfax.org.uk \
--cc=linux-btrfs@vger.kernel.org \
--cc=swestrup@gmail.com \
/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