On 19/09/17 17:47, Austin S. Hemmelgarn wrote:
(...)
A better option if you can afford to remove a single device from that
array temporarily is to use bcache. Bcache has one specific advantage
in this case, multiple backend devices can share the same cache
device. This means you don't have to carve out dedicated cache space
for each disk on the SSD and leave some unused space so that you can
add new devices if needed. The downside is that you can't convert
each device in-place, but because you're using BTRFS, you can still
convert the volume as a whole in-place. The procedure for doing so
looks like this:
1. Format the SSD as a bcache cache.
2. Use `btrfs device delete` to remove a single hard drive from the
array.
3. Set up the drive you just removed as a bcache backing device bound
to the cache you created in step 1.
4. Add the new bcache device to the array.
5. Repeat from step 2 until the whole array is converted.
A similar procedure can actually be used to do almost any underlying
storage conversion (for example, switching to whole disk encryption,
or adding LVM underneath BTRFS) provided all your data can fit on one
less disk than you have.
Thanks Austin, that's just great. For some reason I had discarded bcache
thinking that it would force me to rebuild from scratch, but this kind
of incremental migration is exactly why I hoped was possible. I have
plenty of space to replace the devices one by one.
I will report back my experience in a few days, I hope.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html