<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>File System on RESEARCHUT</title><link>https://researchut.com/tags/file-system/</link><description>Recent content in File System 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/file-system/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>There surely is need for better tooling on the BTRFS File System side.&lt;/p>
&lt;p>While &lt;a href="https://researchut.com/blog/Thinkpad_AMD_Debian/">migrating&lt;/a> 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>btrbk&lt;/code>) complained about it. Following the pointers, I see the below snippet in &lt;code>btrfs-subvolume&lt;/code> manual page.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;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
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;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
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> received_uuid. As this is a notable change and could potentially break the incremental send use &lt;span style="color:#66d9ef">case&lt;/span>, performing it by btrfs property set requires force &lt;span style="color:#66d9ef">if&lt;/span> that is really desired by
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> user.
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> Note
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> The safety checks have been implemented in 5.14.2, any subvolumes previously received &lt;span style="color:#f92672">(&lt;/span>with a valid received_uuid&lt;span style="color:#f92672">)&lt;/span> and read-write status may exist and could still lead to
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;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
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> may exist a convenience tool in the future.
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Fixing the &lt;code>Received UUID: &lt;/code> flag meant running the below:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-text" data-lang="text">&lt;span style="display:flex;">&lt;span>rrs@priyasi:.../spool$ sudo btrfs sub show /
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>WARNING: the subvolume is read-write and has received_uuid set,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> don&amp;#39;t use it for incremental send. Please see section
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;#39;SUBVOLUME FLAGS&amp;#39; in manual page btrfs-subvolume for
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> further information.
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>ROOTVOL
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> Name: ROOTVOL
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> UUID: 122b0de1-e6f2-6845-aba0-6bf766c16526
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> Parent UUID: -
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> Received UUID: 34772967-c709-5146-bf20-898f7dbc2c1f
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> Creation time: 2021-12-02 19:59:29 +0530
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> Subvolume ID: 256
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> Generation: 138473
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> Gen at creation: 7
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> Parent ID: 5
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> Top level ID: 5
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> Flags: -
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> Send transid: 35245
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> Send time: 2021-12-02 19:59:29 +0530
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> Receive transid: 34
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> Receive time: 2021-12-02 20:13:11 +0530
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> Snapshot(s):
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> ROOTVOL/.snapshots/1/snapshot
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> ROOTVOL/.snapshots/2/snapshot
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>22:40 ♒ ॐ ♅ ♄ ⛢ ☺ 😄
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>rrs@priyasi:.../spool$ sudo btrfs property set / ro true
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>WARNING: read-write subvolume with received_uuid, this is bad
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>22:40 ♒ ॐ ♅ ♄ ⛢ ☺ 😄
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>rrs@priyasi:.../spool$ sudo btrfs property set -f / ro false
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>22:40 ♒ ॐ ♅ ♄ ⛢ ☺ 😄
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>rrs@priyasi:.../spool$ sudo btrfs sub show /
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>ROOTVOL
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> Name: ROOTVOL
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> UUID: 122b0de1-e6f2-6845-aba0-6bf766c16526
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> Parent UUID: -
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> Received UUID: -
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> Creation time: 2021-12-02 19:59:29 +0530
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> Subvolume ID: 256
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> Generation: 138473
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> Gen at creation: 7
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> Parent ID: 5
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> Top level ID: 5
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> Flags: -
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> Send transid: 0
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> Send time: 2021-12-02 19:59:29 +0530
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> Receive transid: 138480
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> Receive time: 2022-04-20 22:40:43 +0530
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> Snapshot(s):
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> ROOTVOL/.snapshots/1/snapshot
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> ROOTVOL/.snapshots/2/snapshot
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>22:40 ♒ ॐ ♅ ♄ ⛢ ☺ 😄
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Hoping there won&amp;rsquo;t be surprises in the coming months. 🤞&lt;/p></description></item></channel></rss>