> From: zfs-discuss-boun...@opensolaris.org [mailto:zfs-discuss-
> boun...@opensolaris.org] On Behalf Of Orvar Korvar
> 
> I am not really worried about fragmentation. I was just wondering if I
> attach new drives and zfs send recieve to a new zpool, would count as
> defrag. But apparently, not.

"Apparently not in all situations" would be more appropriate.

The understanding I had was:  If you send a single zfs send | receive, then
it does effectively get defragmented, because the receiving filesystem is
going to re-layout the received filesystem, and there is nothing
pre-existing to make the receiving filesystem dance around...  But if you're
sending some initial, plus incrementals, then you're actually repeating the
same operations that probably caused the original filesystem to become
fragmented in the first place.  And in fact, it seems unavoidable...

Suppose you have a large file, which is all sequential on disk.  You make a
snapshot of it.  Which means all the individual blocks must not be
overwritten.  And then you overwrite a few bytes scattered randomly in the
middle of the file.  The nature of copy on write is such that of course, the
latest version of the filesystem is impossible to remain contiguous.  Your
only choices are:  To read & write copies of the whole file, including
multiple copies of what didn't change, or you leave the existing data in
place where it is on disk, and you instead write your new random bytes to
other non-contiguous locations on disk.  Hence fragmentation.

_______________________________________________
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss

Reply via email to