* Re: Best strategie to remove devices from pool
2017-10-17 17:58 Best strategie to remove devices from pool Cloud Admin
@ 2017-10-17 22:57 ` Duncan
2017-10-18 11:36 ` Austin S. Hemmelgarn
1 sibling, 0 replies; 3+ messages in thread
From: Duncan @ 2017-10-17 22:57 UTC (permalink / raw)
To: linux-btrfs
Cloud Admin posted on Tue, 17 Oct 2017 19:58:55 +0200 as excerpted:
> Hi,
> I want to remove two devices from a BTRFS RAID 1 pool. It should be
> enough free space to do it, but what is the best strategie. Remove both
> device in one call 'btrfs dev rem /dev/sda1 /dev/sdb1' (for example) or
> should it be better in two separate calls? What is faster? Are there
> other constraints to think about?
As a general policy, I'd first ensure that I had current backups in case
something goes wrong, unless of course you consider the data trivial
enough not to bother with backups. No sense unnecessarily tempting fate.
=:^\
Then I'd use the two devices in one call remove, because btrfs device
remove has an implicit rebalance that moves chunks off the device being
removed to the other available devices, and a rebalance can take awhile,
so doing two removals at once should go much faster than one at a time.
I'd also suggest that if you use btrfs quota functionality, you disable
it at least while doing the removes/balances, as trying to recalculate
the quotas constantly slows things down considerably, and if you have
lots of subvolume snapshots on the filesystem, I suggest you first delete
as many of those as you can reasonably delete (and turn off any scheduled
snapshotting during the remove/rebalance), as well, because they too can
slow down balances quite a bit.
--
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Best strategie to remove devices from pool
2017-10-17 17:58 Best strategie to remove devices from pool Cloud Admin
2017-10-17 22:57 ` Duncan
@ 2017-10-18 11:36 ` Austin S. Hemmelgarn
1 sibling, 0 replies; 3+ messages in thread
From: Austin S. Hemmelgarn @ 2017-10-18 11:36 UTC (permalink / raw)
To: Cloud Admin, linux-btrfs
On 2017-10-17 13:58, Cloud Admin wrote:
> Hi,
> I want to remove two devices from a BTRFS RAID 1 pool. It should be
> enough free space to do it, but what is the best strategie. Remove both
> device in one call 'btrfs dev rem /dev/sda1 /dev/sdb1' (for example) or
> should it be better in two separate calls? What is faster? Are there
> other constraints to think about?
Ideally, delete them all with a single operation. Internally the delete
command uses some numeric trickery together with a balance operation to
migrate the data off of the devices being removed. If you do them one
at a time, you will end up moving at least some data twice, and thus
wasting time. Other than that, there's not much to worry ab out, though
keep in mind that deleting devices from an array can take a long time,
especially if the array is mostly full.
^ permalink raw reply [flat|nested] 3+ messages in thread