Talk:Compression

From btrfs Wiki
(Difference between revisions)
Jump to: navigation, search
(force compression per-file?)
 
(Force compression)
 
Line 9: Line 9:
 
* <code>btrfs property set <file> compression</code> is the per-file equivalent of <code>-o compress-force</code>?
 
* <code>btrfs property set <file> compression</code> is the per-file equivalent of <code>-o compress-force</code>?
  
<code>chattr</code> and <code>btrfs property set</code> don't affect each other? [[User:Jonathan|Jonathan]] ([[User talk:Jonathan|talk]]) 04:11, 15 January 2021 (UTC)
+
<code>chattr</code> and <code>btrfs property set</code> don't affect each other? See also https://www.reddit.com/r/btrfs/comments/fhqz55/confused_by_compression_and_forced_compression_in/?ref=share&ref_source=link [[User:Jonathan|Jonathan]] ([[User talk:Jonathan|talk]]) 04:11, 15 January 2021 (UTC)

Latest revision as of 04:12, 15 January 2021

[edit] Force compression

"if the first portion of data being compressed is not smaller than the original, the compression of the file is disabled -- unless the filesystem is mounted with -o compress-force. In that case compression will always be attempted on the file only to be later discarded."

"The utility chattr supports setting file attribute c that marks the inode to compress newly written data. Setting the compression property on a file using btrfs property set <file> compression <zlib|lzo|zstd> will force compression to be used on that file using the specified algorithm."

So

  • chattr +c is the per-file equivalent of -o compress?
  • btrfs property set <file> compression is the per-file equivalent of -o compress-force?

chattr and btrfs property set don't affect each other? See also https://www.reddit.com/r/btrfs/comments/fhqz55/confused_by_compression_and_forced_compression_in/?ref=share&ref_source=link Jonathan (talk) 04:11, 15 January 2021 (UTC)

Personal tools