Re: What do the arguments of btrfs filesystem defragment do?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Excerpts from Erik Logtenberg's message of 2010-12-15 14:26:49 -0500:
> >> Is there a decent way to have btrfs compress already existing files
> >> (that were written before compression was enabled) without hurting any
> >> of the internal structures such as snapshots?
> > 
> > I'm afraid not yet.  There is code for this in the btrfs balance
> > routines, but we haven't yet adapted it to the defragment command.
> 
> Okay, just to be 100% sure, if I add -o compress to the mount options,
> this will cause btrfs to (try to) compress newly written files, right?

Yes

> Is this fully compatible with existing snapshots, or will compressing
> files always (have a chance to) hurt COW relations?

COW references (both via snapshotting and cp --reflink) are broken when
you change the file in either copy.  While the
files are the same, they are shared and the parts that change are
private to each copy.  If you have a reflink copy of a 1TB file and
change only 4K in the middle, the other 1TB-4KB are still shared.

This is true for both the default and with compression on.

> 
> The use case is a filesystem used for backups, which are rsynced
> nightly, after which a new snapshot is made. After something like 45
> days, the old snapshots are removed. I am assuming that this way, after
> 45 days all files will be compressed naturally, but this is only
> beneficial if snapshots still fully work. If instead it results in
> storing the compressed form of every file 45 times on disk, then it
> won't help much.

Yes, you'll end up with a fully compressed and fully shared setup after
45 days.

-chris
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux