Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Andrei Borzenkov <arvidjaar@gmail.com>
To: swestrup@gmail.com, linux-btrfs@vger.kernel.org
Subject: Re: Rebalancing Question
Date: Sat, 11 Jul 2020 18:58:47 +0300	[thread overview]
Message-ID: <f37d1f09-e89d-b468-2de9-4dad1d98d750@gmail.com> (raw)
In-Reply-To: <CAJt7KB-c4vRYgjJ1WZJyNZuey6nH=y2BcQNVYJa6YAG9MTfKhQ@mail.gmail.com>

11.07.2020 17:42, Stirling Westrup пишет:
> 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.
> 

You should be able to shrink md0 which will relocate data beyond new
size to another device(s). See example in btrfs-filesystem:


       $ btrfs filesystem resize -1G /path

       $ btrfs filesystem resize 1:-1G /path

       Shrink size of the filesystem’s device id 1 by 1GiB. The first
syntax expects a
       device with id 1 to exist, otherwise fails. The second is
equivalent and more
       explicit. For a single-device filesystem it’s typically not
necessary to specify the
       devid though.


This assumes you are using single or dup profiles, as other profiles
require at least two devices anyway and you may not be able to shrink
md0 too far.

  parent reply	other threads:[~2020-07-11 15:58 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
2020-07-11 15:58 ` Andrei Borzenkov [this message]
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=f37d1f09-e89d-b468-2de9-4dad1d98d750@gmail.com \
    --to=arvidjaar@gmail.com \
    --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