On Sun, Dec 09, 2012 at 12:20:46PM +0100, Swâmi Petaramesh wrote:
> Le 09/12/2012 11:41, Roman Mamedov a écrit :
> > CoW filesystem incurs fragmentation by its nature, not specifically 
> > snapshots.
> > Even without snapshots, rewriting portions of existing files will write the
> > new blocks not over the original ones, but elsewhere, thus increasing
> > fragmentation.
> 
> Is it to expect that somewhere in the future, BTRFS will be able to
> defragment itself without duplicating snapshot data ?

   In the presence of snapshots that are modified, no, it's impossible
to fully defrag all the files.

   Consider a file, AAABBBCCC, which is snapshotted, and then the
middle third is rewritten, so the snapshot shows AAAZZZCCC. You now
have two files which share their first and last sections, but the
centre section is different. One or other of those files *must* be
fragmented -- you can't eliminate fragmentation here.

   If you mean, will there be a defrag that does as well as it can
despite the limitation above, and which doesn't split snapshots into
separate copies, then yes -- there's already patches out for that, but
they've had a couple of problems.

   Hugo.

-- 
=== Hugo Mills: hugo@... carfax.org.uk | darksatanic.net | lug.org.uk ===
  PGP key: 515C238D from wwwkeys.eu.pgp.net or http://www.carfax.org.uk
               --- emacs: Emacs Makes A Computer Slow. ---               

Attachment: signature.asc
Description: Digital signature

Reply via email to