Reducing ZFS fragmentation by copying to larger disk

Mark Martinec Mark.Martinec+freebsd at ijs.si
Mon Jan 15 23:18:33 UTC 2018


Having a ZFS filesystem with two 4 TB disks in a mirror that
is 85 % full and apparently pretty much fragmented (scrubs
or a resilver takes excessively long time), I intend to move
its contents to a new pair of disks twice the size.

My question is what method to use so that in the end the copy will
be less fragmented:

1. attach new disks to a ZFS mirror and let them resilver, then
    remove the old disks (Would the copied content be any less
    fragmented, or perhaps would the added free space just
    relieve some of the problem?)

2. use zfs send / receive to make a copy
    (is this any better than method #1 ?)

3. use rsync to make a copy (losing snapshots, and would likely
    take much longer)


Mark


More information about the freebsd-fs mailing list