问题原文
原帖链接 · Greg · CC BY-SA 3.0
Using a striped mirror (Raid 10) as an example, if two disks are expanded to four, how can the data from the two disks be 're-balanced' (spread out) amongst the two mirrors?
That is, how can the files which were written to one mirror be written to two mirrors to take advantage of the striped disks?
社区高分解答
原帖链接 · jason_uruguru · CC BY-SA 4.0
possible 3rd solution (as mentioned by SirMaster in this FreeNAS forum post) :
- add new disk(s) to zpool
- copy many files to another new /mnt/pool/temp/ directory
- delete original files:
rm -rf original/ - rename dir back:
mv temp/ original/
This works because ZFS will proportionally place writes to whichever vdev has most free space, in this case the brand new drives which were empty. (as of 0.7, zfs will favor faster drives for writes, but lets assume your 2 new drives are same or greater performance than the original drives)
It's probably slower than zfs send | zfs recv, but simpler because you don't have to create/destroy snapshots.
You can run zpool list -v before and after to see each vdev utilization.
Also, found a php script that does the copy/delete/rename procedure on a file-by-file basis. This was linked in an answer from a similar (but zvol) question a few years older. (didn't test this script personally)
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
