Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Reducing ZFS fragmentation by copying to larger disk

10 views
Skip to first unread message

Mark Martinec

unread,
Jan 15, 2018, 6:18:48 PM1/15/18
to
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
_______________________________________________
freeb...@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-fs
To unsubscribe, send any mail to "freebsd-fs-...@freebsd.org"

Bob Friesenhahn

unread,
Jan 15, 2018, 7:34:31 PM1/15/18
to
On Tue, 16 Jan 2018, Mark Martinec wrote:

> 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?)

I don't think this would help with fragmentation at all.

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

This will work well as long as there is enough space to send to. It
will even work within the same pool if there is enough free space.

Bob
--
Bob Friesenhahn
bfri...@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer, http://www.GraphicsMagick.org/

Mark Martinec

unread,
Jan 16, 2018, 9:56:19 AM1/16/18
to
>> 1. attach new disks to a ZFS mirror and let them resilver, ...
>
> I don't think this would help with fragmentation at all.

Thank you for confirming my guess!


>> 2. use zfs send / receive to make a copy
>
> [...] It will even work within the same pool if there is enough free
> space.

Nice, this is helpful!

Mark



2018-01-16 01:28, je Bob Friesenhahn wrote:

> On Tue, 16 Jan 2018, Mark Martinec wrote:
>> 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?)
>
> I don't think this would help with fragmentation at all.
>
>> 2. use zfs send / receive to make a copy
>> (is this any better than method #1 ?)
>
> This will work well as long as there is enough space to send to. It
> will even work within the same pool if there is enough free space.
>
> Bob
0 new messages