kdave / btrfs-progs

Development of userspace BTRFS tools
GNU General Public License v2.0
527 stars 239 forks source link

Device priorities for new block allocation on filesystem spanning multiple devices #725

Closed matthuszagh closed 6 months ago

matthuszagh commented 6 months ago

This is a question. I apologize if it's been asked before, or if this is the wrong place to ask it, but I wasn't able to find an answer elsewhere. If that's the case, please feel free to direct me elsewhere.

In a multi-device filesystem (data single, metadata dup), how does BTRFS handle on which device to allocate a new data block? I seem to recall reading somewhere that it was the device with the largest free space left. Is that correct? Is there a way to give BTRFS a priority of devices, such that it fills up the highest priority device before the next, etc?

I have a desktop computer with 2 very fast NVMe SSD drives and several very large HDDs. Unfortunately, the BTRFS is filling up the HDDs and ignoring the fast SSDs, greatly affecting the performance. Is there a way to resolve this without removing the HDDs from the filesystem?

ErrorNoInternet commented 6 months ago

There is some more discussion at https://github.com/kdave/btrfs-progs/issues/610, and a patch for preferred-(meta)data: https://github.com/kakra/linux/pull/31

matthuszagh commented 6 months ago

Thanks! I'll close this, as it's a duplicate issue then.