<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>COW on RESEARCHUT</title><link>https://researchut.com/tags/cow/</link><description>Recent content in COW on RESEARCHUT</description><generator>Hugo -- gohugo.io</generator><language>en</language><managingEditor>rrs@researchut.com (Ritesh Raj Sarraf)</managingEditor><webMaster>rrs@researchut.com (Ritesh Raj Sarraf)</webMaster><lastBuildDate>Wed, 20 Apr 2022 22:41:53 +0530</lastBuildDate><atom:link href="https://researchut.com/tags/cow/index.xml" rel="self" type="application/rss+xml"/><item><title>Btrfs Subvol Fix</title><link>https://researchut.com/blog/BTRFS_Subvol_Fix/</link><pubDate>Wed, 20 Apr 2022 22:41:53 +0530</pubDate><author>rrs@researchut.com (Ritesh Raj Sarraf)</author><guid>https://researchut.com/blog/BTRFS_Subvol_Fix/</guid><description>&lt;p&gt;There surely is need for better tooling on the BTRFS File System side.&lt;/p&gt;
&lt;p&gt;While &lt;a href="https://researchut.com/blog/Thinkpad_AMD_Debian/"&gt;migrating&lt;/a&gt; my setup from one machine to another, this is one issue I came to be aware of, only today, when my backup tool (&lt;code&gt;btrbk&lt;/code&gt;) complained about it. Following the pointers, I see the below snippet in &lt;code&gt;btrfs-subvolume&lt;/code&gt; manual page.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; A snapshot that was created by send/receive will be read-only, with different last change generation, read-only and with set received_uuid which identifies the subvolume on the
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; filesystem that produced the stream. The usecase relies on matching data on both sides. Changing the subvolume to read-write after it has been received requires to reset the
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; received_uuid. As this is a notable change and could potentially break the incremental send use &lt;span style="color:#66d9ef"&gt;case&lt;/span&gt;, performing it by btrfs property set requires force &lt;span style="color:#66d9ef"&gt;if&lt;/span&gt; that is really desired by
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; user.
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; Note
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; The safety checks have been implemented in 5.14.2, any subvolumes previously received &lt;span style="color:#f92672"&gt;(&lt;/span&gt;with a valid received_uuid&lt;span style="color:#f92672"&gt;)&lt;/span&gt; and read-write status may exist and could still lead to
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; problems with send/receive. You can use btrfs subvolume show to identify them. Flipping the flags to read-only and back to read-write will reset the received_uuid manually. There
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; may exist a convenience tool in the future.
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Fixing the &lt;code&gt;Received UUID: &lt;/code&gt; flag meant running the below:&lt;/p&gt;</description><content:encoded><![CDATA[<p>There surely is need for better tooling on the BTRFS File System side.</p>
<p>While <a href="/blog/Thinkpad_AMD_Debian/">migrating</a> my setup from one machine to another, this is one issue I came to be aware of, only today, when my backup tool (<code>btrbk</code>) complained about it. Following the pointers, I see the below snippet in <code>btrfs-subvolume</code> manual page.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>       A snapshot that was created by send/receive will be read-only, with different last change generation, read-only and with set received_uuid which identifies the subvolume on the
</span></span><span style="display:flex;"><span>       filesystem that produced the stream. The usecase relies on matching data on both sides. Changing the subvolume to read-write after it has been received requires to reset the
</span></span><span style="display:flex;"><span>       received_uuid. As this is a notable change and could potentially break the incremental send use <span style="color:#66d9ef">case</span>, performing it by btrfs property set requires force <span style="color:#66d9ef">if</span> that is really desired by
</span></span><span style="display:flex;"><span>       user.
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>           Note
</span></span><span style="display:flex;"><span>           The safety checks have been implemented in 5.14.2, any subvolumes previously received <span style="color:#f92672">(</span>with a valid received_uuid<span style="color:#f92672">)</span> and read-write status may exist and could still lead to
</span></span><span style="display:flex;"><span>           problems with send/receive. You can use btrfs subvolume show to identify them. Flipping the flags to read-only and back to read-write will reset the received_uuid manually. There
</span></span><span style="display:flex;"><span>           may exist a convenience tool in the future.
</span></span></code></pre></div><p>Fixing the <code>Received UUID: </code> flag meant running the below:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-text" data-lang="text"><span style="display:flex;"><span>rrs@priyasi:.../spool$ sudo btrfs sub show /
</span></span><span style="display:flex;"><span>WARNING: the subvolume is read-write and has received_uuid set,
</span></span><span style="display:flex;"><span>         don&#39;t use it for incremental send. Please see section
</span></span><span style="display:flex;"><span>         &#39;SUBVOLUME FLAGS&#39; in manual page btrfs-subvolume for
</span></span><span style="display:flex;"><span>         further information.
</span></span><span style="display:flex;"><span>ROOTVOL
</span></span><span style="display:flex;"><span>        Name:                   ROOTVOL
</span></span><span style="display:flex;"><span>        UUID:                   122b0de1-e6f2-6845-aba0-6bf766c16526
</span></span><span style="display:flex;"><span>        Parent UUID:            -
</span></span><span style="display:flex;"><span>        Received UUID:          34772967-c709-5146-bf20-898f7dbc2c1f
</span></span><span style="display:flex;"><span>        Creation time:          2021-12-02 19:59:29 +0530
</span></span><span style="display:flex;"><span>        Subvolume ID:           256
</span></span><span style="display:flex;"><span>        Generation:             138473
</span></span><span style="display:flex;"><span>        Gen at creation:        7
</span></span><span style="display:flex;"><span>        Parent ID:              5
</span></span><span style="display:flex;"><span>        Top level ID:           5
</span></span><span style="display:flex;"><span>        Flags:                  -
</span></span><span style="display:flex;"><span>        Send transid:           35245
</span></span><span style="display:flex;"><span>        Send time:              2021-12-02 19:59:29 +0530
</span></span><span style="display:flex;"><span>        Receive transid:        34
</span></span><span style="display:flex;"><span>        Receive time:           2021-12-02 20:13:11 +0530
</span></span><span style="display:flex;"><span>        Snapshot(s):
</span></span><span style="display:flex;"><span>                                ROOTVOL/.snapshots/1/snapshot
</span></span><span style="display:flex;"><span>                                ROOTVOL/.snapshots/2/snapshot
</span></span><span style="display:flex;"><span>22:40 ♒ ॐ ♅ ♄ ⛢     ☺ 😄    
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>rrs@priyasi:.../spool$ sudo btrfs property set / ro true
</span></span><span style="display:flex;"><span>WARNING: read-write subvolume with received_uuid, this is bad
</span></span><span style="display:flex;"><span>22:40 ♒ ॐ ♅ ♄ ⛢     ☺ 😄    
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>rrs@priyasi:.../spool$ sudo btrfs property set -f / ro false
</span></span><span style="display:flex;"><span>22:40 ♒ ॐ ♅ ♄ ⛢     ☺ 😄    
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>rrs@priyasi:.../spool$ sudo btrfs sub show /
</span></span><span style="display:flex;"><span>ROOTVOL
</span></span><span style="display:flex;"><span>        Name:                   ROOTVOL
</span></span><span style="display:flex;"><span>        UUID:                   122b0de1-e6f2-6845-aba0-6bf766c16526
</span></span><span style="display:flex;"><span>        Parent UUID:            -
</span></span><span style="display:flex;"><span>        Received UUID:          -
</span></span><span style="display:flex;"><span>        Creation time:          2021-12-02 19:59:29 +0530
</span></span><span style="display:flex;"><span>        Subvolume ID:           256
</span></span><span style="display:flex;"><span>        Generation:             138473
</span></span><span style="display:flex;"><span>        Gen at creation:        7
</span></span><span style="display:flex;"><span>        Parent ID:              5
</span></span><span style="display:flex;"><span>        Top level ID:           5
</span></span><span style="display:flex;"><span>        Flags:                  -
</span></span><span style="display:flex;"><span>        Send transid:           0
</span></span><span style="display:flex;"><span>        Send time:              2021-12-02 19:59:29 +0530
</span></span><span style="display:flex;"><span>        Receive transid:        138480
</span></span><span style="display:flex;"><span>        Receive time:           2022-04-20 22:40:43 +0530
</span></span><span style="display:flex;"><span>        Snapshot(s):
</span></span><span style="display:flex;"><span>                                ROOTVOL/.snapshots/1/snapshot
</span></span><span style="display:flex;"><span>                                ROOTVOL/.snapshots/2/snapshot
</span></span><span style="display:flex;"><span>22:40 ♒ ॐ ♅ ♄ ⛢     ☺ 😄    
</span></span></code></pre></div><p>Hoping there won&rsquo;t be surprises in the coming months. 🤞</p>
]]></content:encoded></item></channel></rss>