Re: Rebalancing Question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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          |



[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux