<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>FN OS on KnightLi Blog</title>
        <link>https://knightli.com/en/tags/fn-os/</link>
        <description>Recent content in FN OS on KnightLi Blog</description>
        <generator>Hugo -- gohugo.io</generator>
        <language>en</language>
        <lastBuildDate>Sat, 20 Jun 2026 19:09:03 +0800</lastBuildDate><atom:link href="https://knightli.com/en/tags/fn-os/index.xml" rel="self" type="application/rss+xml" /><item>
        <title>How Synology and FN OS NAS Users Can Save Space with Btrfs, jdupes, and CoW Deduplication</title>
        <link>https://knightli.com/en/2026/06/20/synology-fn-os-btrfs-jdupes-cow-dedup/</link>
        <pubDate>Sat, 20 Jun 2026 19:09:03 +0800</pubDate>
        
        <guid>https://knightli.com/en/2026/06/20/synology-fn-os-btrfs-jdupes-cow-dedup/</guid>
        <description>&lt;p&gt;If your NAS stores videos, backup archives, installer images, or exported photo folders, duplicate files can quietly consume hundreds of GB or even several TB. The traditional approach is to delete duplicates or replace them with hard links, but neither option is ideal for long-term NAS storage.&lt;/p&gt;
&lt;p&gt;A safer approach is to use &lt;code&gt;jdupes&lt;/code&gt; for block-level deduplication on a filesystem that supports CoW.&lt;/p&gt;
&lt;p&gt;For Synology and FN OS NAS users, if the storage volume uses Btrfs, &lt;code&gt;jdupes -B&lt;/code&gt; can call the underlying filesystem capability and make duplicate files share the same physical data blocks. The files still look independent in the directory tree, but only one copy of the data is stored underneath.&lt;/p&gt;
&lt;h2 id=&#34;how-cow-deduplication-differs-from-hard-links&#34;&gt;How CoW deduplication differs from hard links
&lt;/h2&gt;&lt;p&gt;Hard links work by making multiple paths point to the same inode.&lt;/p&gt;
&lt;p&gt;This does save space, but it has a clear downside: if a program modifies one of those files, all hard-linked paths see the change. For media libraries, sync folders, photo managers, and backup directories, that behavior can create subtle trouble.&lt;/p&gt;
&lt;p&gt;Btrfs CoW deduplication is different.&lt;/p&gt;
&lt;p&gt;Its logic is: multiple independent files can share identical data blocks; once one file is modified, the filesystem writes the changed part to new blocks, and the other files remain untouched.&lt;/p&gt;
&lt;p&gt;After CoW deduplication:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;file paths remain independent;&lt;/li&gt;
&lt;li&gt;deleting one file does not delete the others;&lt;/li&gt;
&lt;li&gt;modifying one file does not modify the others;&lt;/li&gt;
&lt;li&gt;duplicate parts take only one copy of physical disk space.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This is why &lt;code&gt;jdupes -B&lt;/code&gt; is usually a better fit for NAS deduplication than hard links.&lt;/p&gt;
&lt;h2 id=&#34;good-use-cases&#34;&gt;Good use cases
&lt;/h2&gt;&lt;p&gt;CoW deduplication is especially useful for directories such as:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;duplicated TV episodes and movies in media libraries;&lt;/li&gt;
&lt;li&gt;installer packages, ISO files, and archives stored in different folders;&lt;/li&gt;
&lt;li&gt;repeated photo or video exports;&lt;/li&gt;
&lt;li&gt;large duplicate files produced by backup tools;&lt;/li&gt;
&lt;li&gt;temporary folders copied during manual cleanup.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Do not start by scanning the entire system volume. A safer workflow is to test on a user data directory first, for example:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;2
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;3
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;/volume1/video/
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;/volume1/photo/
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;/volume1/data1/aaa/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Test the command, exclusion rules, and space savings on a small scope before expanding the scan.&lt;/p&gt;
&lt;h2 id=&#34;basic-command&#34;&gt;Basic command
&lt;/h2&gt;&lt;p&gt;To run CoW deduplication with &lt;code&gt;jdupes&lt;/code&gt; on a Btrfs directory, the key option is &lt;code&gt;-B&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;jdupes -r -B &lt;span class=&#34;s2&#34;&gt;&amp;#34;/volume1/data1/aaa/&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Option meanings:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;-r&lt;/code&gt;: scan subdirectories recursively;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-B&lt;/code&gt;: perform Btrfs/CoW deduplication for duplicate files instead of creating hard links;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;quot;/volume1/data1/aaa/&amp;quot;&lt;/code&gt;: the target directory to scan.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The important part is &lt;code&gt;-B&lt;/code&gt;. It makes &lt;code&gt;jdupes&lt;/code&gt; use the filesystem-supported deduplication mechanism, usually through low-level reflink, clone, or dedupe range interfaces.&lt;/p&gt;
&lt;h2 id=&#34;exclude-eadir-and-recycle-on-synology&#34;&gt;Exclude @eaDir and #recycle on Synology
&lt;/h2&gt;&lt;p&gt;On Synology, it is usually best to exclude &lt;code&gt;@eaDir&lt;/code&gt; and &lt;code&gt;#recycle&lt;/code&gt; from the scan.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;@eaDir&lt;/code&gt; is a hidden directory generated by Synology. It commonly stores thumbnails, media indexes, extended attributes, and package-related cache data. These files are numerous, small, expensive to scan, and usually not worth deduplicating. Scanning them may also interfere with Synology indexing services.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;#recycle&lt;/code&gt; is the recycle bin for shared folders. Files there are waiting to be removed, so deduplicating them provides little value and makes the results harder to interpret.&lt;/p&gt;
&lt;p&gt;For Synology, exclude both directories.&lt;/p&gt;
&lt;p&gt;Different &lt;code&gt;jdupes&lt;/code&gt; versions support different forms of the &lt;code&gt;-X&lt;/code&gt; option. Some tutorials use:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;jdupes -r -B -X &lt;span class=&#34;s2&#34;&gt;&amp;#34;req:*/@eaDir/*&amp;#34;&lt;/span&gt; -X &lt;span class=&#34;s2&#34;&gt;&amp;#34;req:*/#recycle/*&amp;#34;&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;/volume1/data1/aaa/&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;But some Synology environments report:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Invalid extfilter filter name was specified
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;If your &lt;code&gt;jdupes -X&lt;/code&gt; help output shows support for &lt;code&gt;nostr:text_string&lt;/code&gt;, use this more compatible form:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;jdupes -r -B -X nostr:/@eaDir/ -X nostr:/#recycle/ &lt;span class=&#34;s2&#34;&gt;&amp;#34;/volume1/data1/aaa/&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;The meaning is straightforward:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;-X nostr:/@eaDir/&lt;/code&gt;: exclude files whose path contains &lt;code&gt;/@eaDir/&lt;/code&gt;;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-X nostr:/#recycle/&lt;/code&gt;: exclude files whose path contains &lt;code&gt;/#recycle/&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If the target path contains Chinese characters or spaces, always wrap it in quotes:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;jdupes -r -B -X nostr:/@eaDir/ -X nostr:/#recycle/ &lt;span class=&#34;s2&#34;&gt;&amp;#34;/volume1/photo/视频工作/&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;h2 id=&#34;how-to-think-about-fn-os-nas&#34;&gt;How to think about FN OS NAS
&lt;/h2&gt;&lt;p&gt;If FN OS uses a Btrfs storage pool, the idea is similar to Synology: confirm that the target directory is on Btrfs, then use &lt;code&gt;jdupes -B&lt;/code&gt; for CoW deduplication.&lt;/p&gt;
&lt;p&gt;The difference is that hidden system directories may have different names. Synology commonly uses &lt;code&gt;@eaDir&lt;/code&gt; and &lt;code&gt;#recycle&lt;/code&gt;; on FN OS, you should decide exclusion rules based on the actual directory structure.&lt;/p&gt;
&lt;p&gt;Start by listing nearby directories:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;find &lt;span class=&#34;s2&#34;&gt;&amp;#34;/你的目标目录&amp;#34;&lt;/span&gt; -maxdepth &lt;span class=&#34;m&#34;&gt;2&lt;/span&gt; -type d
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Check whether there are system caches, recycle bins, index folders, or app data directories. The files most worth deduplicating are usually large user files, not small system-generated cache files.&lt;/p&gt;
&lt;h2 id=&#34;how-to-confirm-cow-deduplication-worked&#34;&gt;How to confirm CoW deduplication worked
&lt;/h2&gt;&lt;p&gt;Do not rely only on &lt;code&gt;ls -l&lt;/code&gt;. After CoW deduplication, the logical file size remains unchanged, and the directory still appears to contain multiple complete files.&lt;/p&gt;
&lt;p&gt;There are three more reliable ways to verify the result.&lt;/p&gt;
&lt;h3 id=&#34;1-check-jdupes-output&#34;&gt;1. Check jdupes output
&lt;/h3&gt;&lt;p&gt;During execution, output like this usually means duplicate files were detected and processed:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;2
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;3
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;[SRC] /volume1/data1/aaa/1/file.mkv
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;====&amp;gt; /volume1/data1/aaa/2/file.mkv
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;====&amp;gt; /volume1/data1/aaa/3/file.mkv
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;&lt;code&gt;[SRC]&lt;/code&gt; is the source file, and files after &lt;code&gt;====&amp;gt;&lt;/code&gt; are deduplicated against the same underlying data blocks. They still exist independently, but their physical storage has been consolidated.&lt;/p&gt;
&lt;h3 id=&#34;2-compare-btrfs-space-usage&#34;&gt;2. Compare Btrfs space usage
&lt;/h3&gt;&lt;p&gt;Before and after deduplication, run:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;sudo btrfs filesystem usage /volume1/data1/aaa/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Focus on these fields:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;2
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;3
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Used:
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Free (estimated):
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Data,single: Used:
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;If deduplication took effect, you will usually see:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Used&lt;/code&gt; decrease;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Data,single: Used&lt;/code&gt; decrease;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Free (estimated)&lt;/code&gt; increase.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For example, if &lt;code&gt;Used&lt;/code&gt; drops from &lt;code&gt;8.44TiB&lt;/code&gt; to &lt;code&gt;8.20TiB&lt;/code&gt;, even a reduction of a few dozen GB means CoW deduplication has released physical space.&lt;/p&gt;
&lt;h3 id=&#34;3-use-compsize-for-real-usage&#34;&gt;3. Use compsize for real usage
&lt;/h3&gt;&lt;p&gt;If your system can install &lt;code&gt;compsize&lt;/code&gt;, it gives a clearer view of real Btrfs usage after compression and deduplication:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;sudo compsize &lt;span class=&#34;s2&#34;&gt;&amp;#34;/volume1/data1/aaa/&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;It is more suitable than plain &lt;code&gt;du&lt;/code&gt; for understanding actual space usage on Btrfs.&lt;/p&gt;
&lt;h2 id=&#34;safe-operating-checklist&#34;&gt;Safe operating checklist
&lt;/h2&gt;&lt;p&gt;A cautious workflow looks like this:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Confirm that the target directory is on a Btrfs volume;&lt;/li&gt;
&lt;li&gt;Test on a small directory before scanning the entire volume;&lt;/li&gt;
&lt;li&gt;Exclude system hidden directories, recycle bins, and application cache folders;&lt;/li&gt;
&lt;li&gt;Quote paths that contain Chinese characters or spaces;&lt;/li&gt;
&lt;li&gt;Record &lt;code&gt;btrfs filesystem usage&lt;/code&gt; before deduplication;&lt;/li&gt;
&lt;li&gt;Run it again afterward and compare &lt;code&gt;Used&lt;/code&gt; and &lt;code&gt;Free (estimated)&lt;/code&gt;;&lt;/li&gt;
&lt;li&gt;If you are unsure about an option, run &lt;code&gt;jdupes --help&lt;/code&gt; and check the filters supported by your installed version.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;For Synology, this is a good starting command:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;jdupes -r -B -X nostr:/@eaDir/ -X nostr:/#recycle/ &lt;span class=&#34;s2&#34;&gt;&amp;#34;/volume1/data1/aaa/&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;If your &lt;code&gt;jdupes&lt;/code&gt; version does not support &lt;code&gt;nostr&lt;/code&gt;, adjust the filter options according to &lt;code&gt;jdupes -X&lt;/code&gt; or &lt;code&gt;jdupes --help&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&#34;summary&#34;&gt;Summary
&lt;/h2&gt;&lt;p&gt;The value of Btrfs plus &lt;code&gt;jdupes -B&lt;/code&gt; is that you can save space without deleting files or turning them into hard links. Duplicate content shares physical blocks while each file remains independent.&lt;/p&gt;
&lt;p&gt;For Synology and FN OS NAS users, this is especially useful for duplicate videos, backup files, and large media assets. The main things to control are scan scope and exclusion rules: focus on user data, avoid system caches and recycle bins, and compare Btrfs usage before and after the run.&lt;/p&gt;
&lt;p&gt;For safe space savings, remember this command pattern:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;jdupes -r -B -X nostr:/@eaDir/ -X nostr:/#recycle/ &lt;span class=&#34;s2&#34;&gt;&amp;#34;/你的Btrfs数据目录/&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;</description>
        </item>
        
    </channel>
</rss>
