{"id":3781,"date":"2025-07-20T14:02:05","date_gmt":"2025-07-20T13:02:05","guid":{"rendered":"https:\/\/kudzia.eu\/b\/?p=3781"},"modified":"2025-07-20T14:02:05","modified_gmt":"2025-07-20T13:02:05","slug":"using-transparent-compression-in-btrfs","status":"publish","type":"post","link":"https:\/\/kudzia.eu\/b\/2025\/07\/using-transparent-compression-in-btrfs\/","title":{"rendered":"using transparent compression in btrfs"},"content":{"rendered":"\n<p>to compress any newly added file\/directory &#8211; mount the file system with option <em>compression=algorithm:compressionLevel<\/em> e.g.:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mount -o compress=zstd:12 \/dev\/mapper\/something \/mnt\/somewhere<\/code><\/pre>\n\n\n\n<p>to compress individual file or folder, without compressing everything else stored on given file system:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>btrfs property set \/path\/to\/file\/or\/folder compression zstd\nbtrfs filesystem defragment -r -v -czstd \/path\/to\/file\/or\/folder <\/code><\/pre>\n\n\n\n<p>to check compression ratio:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>compsize \/path\/to\/file\/or\/folder\n<\/code><\/pre>\n\n\n\n<p>to check <em>compression<\/em> property for an existing folder:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>btrfs property get \/path\/to\/folder compression<\/code><\/pre>\n\n\n\n<p>for more details &#8211; see <a href=\"https:\/\/btrfs.readthedocs.io\/en\/latest\/Compression.html\">https:\/\/btrfs.readthedocs.io\/en\/latest\/Compression.html<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>to compress any newly added file\/directory &#8211; mount the file system with option compression=algorithm:compressionLevel e.g.: to compress individual file or folder, without compressing everything else stored on given file system: to check compression ratio: to check compression property for an existing folder: for more details &#8211; see https:\/\/btrfs.readthedocs.io\/en\/latest\/Compression.html<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[51],"tags":[100],"class_list":["post-3781","post","type-post","status-publish","format-standard","hentry","category-unimportant","tag-btrfs"],"_links":{"self":[{"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/posts\/3781","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/comments?post=3781"}],"version-history":[{"count":1,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/posts\/3781\/revisions"}],"predecessor-version":[{"id":3782,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/posts\/3781\/revisions\/3782"}],"wp:attachment":[{"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/media?parent=3781"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/categories?post=3781"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/tags?post=3781"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}