Alexstrasza Posted October 3, 2020 Share Posted October 3, 2020 (edited) Hi all, just a general question about btrfs pools. I recently wanted to remove an SSD from my raid1 pool, so I unassigned it and then restarted the array. To my suprise, instead of the pool starting up in some degraded mode, it instead seemed to begin a mandatory rebalance with the unassigned SSD to switch them to "single" operation, after which I assume it will remove it. According to this article, that seems to be normal for removing a device. So my question is, for a raid1 with two devices, to a raid1 with 1 (degraded, but still the same), why does a rebalance have to occur - If I were to simply remove the SSD physically, it would keep working, so why does it need to rebalance if the drive is instead not removed? I'm running 6.9.0-beta29, but about to downgrade to beta25 because of the vfio drive passthrough issues. Edited October 3, 2020 by Alexstrasza Quote Link to comment
Alexstrasza Posted October 4, 2020 Author Share Posted October 4, 2020 I've found the original command-line run by UnRaid: Oct 4 01:45:47 Sector5 emhttpd: shcmd (41): /sbin/btrfs balance start -f -dconvert=single -mconvert=single /mnt/cache && /sbin/btrfs balance start -f -dconvert=single,soft -mconvert=single,soft /mnt/cache && /sbin/btrfs device delete /dev/nvme0n1p1 /mnt/cache & That would seem to match up with what I've observed: Convert to single (striped?) mode Convert again? Then finally copy the data off the SSD I want to delete. So I'm still confused as to why UnRaid chooses to do steps 1 & 2 rather than skipping to step 3. Quote Link to comment
JorgeB Posted October 4, 2020 Share Posted October 4, 2020 10 hours ago, Alexstrasza said: why does a rebalance have to occur To make the pool not degraded. 5 hours ago, Alexstrasza said: Convert to single (striped?) mode Convert again? These are only one operation, balance is what converts the pools to single mode. Quote Link to comment
Alexstrasza Posted October 4, 2020 Author Share Posted October 4, 2020 9 hours ago, JorgeB said: To make the pool not degraded. But can't this be done after the remove operation, to save time waiting for the rebalance across the "removed" SSD? 9 hours ago, JorgeB said: These are only one operation, balance is what converts the pools to single mode. I get that, but I don't understand why the command line calls it twice, the second time with "dconvert=single,soft" instead. Quote Link to comment
JorgeB Posted October 5, 2020 Share Posted October 5, 2020 15 hours ago, Alexstrasza said: But can't this be done after the remove operation, to save time waiting for the rebalance across the "removed" SSD? No, balance is what "removes" the member pool. 15 hours ago, Alexstrasza said: I get that, but I don't understand why the command line calls it twice, the second time with "dconvert=single,soft" instead. LT most likely did that because some times a balance leaves some old profile chunks unconverted, note that the "soft" balance will only balance those chunks, if there are any, it won't re-balance what is already balanced. 1 Quote Link to comment
Alexstrasza Posted October 6, 2020 Author Share Posted October 6, 2020 Interesting, thanks for the theories! Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.