<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Btrfs on RESEARCHUT</title><link>https://researchut.com/tags/btrfs/</link><description>Recent content in Btrfs 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>Sat, 20 Dec 2025 00:00:00 +0000</lastBuildDate><atom:link href="https://researchut.com/tags/btrfs/index.xml" rel="self" type="application/rss+xml"/><item><title>Immutable Debian</title><link>https://researchut.com/blog/Immutable_Atomic_Debian/</link><pubDate>Sat, 20 Dec 2025 00:00:00 +0000</pubDate><author>rrs@researchut.com (Ritesh Raj Sarraf)</author><guid>https://researchut.com/blog/Immutable_Atomic_Debian/</guid><description>&lt;h2 id="immutable-atomic-linux-distirbutions">Immutable Atomic Linux Distirbutions&lt;/h2>
&lt;p>Of late, I&amp;rsquo;ve been hearing a lot of (good) things about Immutable Linux
Distributions, from friends, colleagues and mentors. It has been
something on my plate for some time, to explore. But given the nature of
the subject, it has been delayed for a while. Reasons are simple; I can
only really judge this product if I use it for some time; and it has to
be on my primary daily driver machine.&lt;/p>
&lt;p>Personal life, this year, has been quite challenging as well. Thus it got pushed to until now.&lt;/p>
&lt;h3 id="chrome-os">Chrome OS&lt;/h3>
&lt;p>I&amp;rsquo;ve realized that I&amp;rsquo;ve been quite late to a lot of Linux parties.
Containers, Docker, Kubernetes, Golang, Rust, Immutable Linux and many
many more.&lt;/p>
&lt;p>Late to the extent that I&amp;rsquo;ve had a Chrome Book lying at home for many
months but never got to tinker with it at all.&lt;/p>
&lt;p>Having used it for just around 2 weeks now, I can see what a great
product Google built with it. In short, this is exactly how a Linux
desktop integration should be. The GUI integration is just top notch.
There&amp;rsquo;s consistency across all applications rendered on the Chrome OS&lt;/p>
&lt;p>The integration of [X]Wayland and friends is equally good. Maybe Google
should consider opensourcing all those components. IIRC, exo,
sommelier, xwayland, ash and many more.&lt;/p>
&lt;p>I was equally happy to see their &lt;code>Linux Development Environment&lt;/code>
offering on supported hardware. While tightly integrated, it still
allows power users to tinker things around. I was quite impressed to see
nested containers in &lt;code>crostini&lt;/code>. Job well done.&lt;/p>
&lt;p>All of this explains why there&amp;rsquo;s much buzz about &lt;code>Immutable Atomic Linux Distributions&lt;/code> these days.&lt;/p>
&lt;p>Then, there&amp;rsquo;s the Android integration, which is just awesome in case you
care of it. Both &lt;code>libndk&lt;/code> and &lt;code>libhoudini&lt;/code> are well integrated and
nicely usable.&lt;/p>
&lt;h3 id="immutable-linux-distributions">Immutable Linux Distributions&lt;/h3>
&lt;p>This holiday season I wanted to find and spend some time catching up on
stuff I had been prolonging.&lt;/p>
&lt;p>I chose to explore this subject while trying to remain in familiar
Debian land. So my first look was to see if there was any product
derived out of the Debian base.&lt;/p>
&lt;p>That brought me to &lt;code>Vanilla OS Orchid&lt;/code>. This is a fresh out of oven
project, recently switched to being based on Debian Sid. Previous
iteration used Ubuntu as the base.&lt;/p>
&lt;p>Vanilla OS turned out to be quite good an experience. The stock
offering is created well enough to serve the general audience. And the
framework is such wonderfully structured that seasoned users can tinker
around with it, without much fuss.&lt;/p>
&lt;p>Vanilla OS uses an A/B Partition model for how system updates are
rolled. At any point, when a new OTA update is pushed, it gets applied
to the inactive A/B partition. And it gets activated at next boot. If things
break, user has the option to switch to the previous state. Just the
usual set of expectations one would have with an immutable distribution.&lt;/p>
&lt;p>What they&amp;rsquo;ve done beautifully is:&lt;/p>
&lt;ul>
&lt;li>Integration Device Mapper LVM for A/B Partition&lt;/li>
&lt;li>Linux Container OCI images to provison/flash A/B Paritions&lt;/li>
&lt;li>Developed &lt;code>abroot&lt;/code> utility for A/B Partition management&lt;/li>
&lt;li>APX (Distrobox) integration for container workflows, with multiple Linux flavors&lt;/li>
&lt;li>No &lt;code>sudo&lt;/code>. Everything done via &lt;code>pkexec&lt;/code>&lt;/li>
&lt;/ul>
&lt;p>But the most awesome thing I liked in Vanilla OS is &lt;a href="https://github.com/rickysarraf/custom-image">custom images&lt;/a>. This allows power users to easily tinker with the developer workflow and generate new images, tailored for their specific use cases. All of this done levraging the GitHub/GitLab CI/CD workflows, which I think is just plain awesome. Given that payload is of the OCI format, the CICD workflow just generates new OCI images and publishes to a registry. And then the same is pulled to the client as an OTA.&lt;/p>
&lt;p>Hats off to this small team/community for doing such nice integration
work, ultimately producing a superb Immutable Atomic Linux Distribution
based on the Debian base.&lt;/p>
&lt;h3 id="immutable-linux">Immutable Linux&lt;/h3>
&lt;p>My primary work machine has grown over the years, being on the rolling
Debian Testing/Unstable channel. And I don&amp;rsquo;t much feel the itch ever to
format my (primary) machine so quick, no matter how great the counter
offer is.&lt;/p>
&lt;p>So that got me wondering how to have some of bling of the immutable
world that I&amp;rsquo;ve tasted (Thanks Chrome OS and Vanilla OS). With a fair
idea of what they offer in features, I drew a line to what I&amp;rsquo;d want on
my primary machine.&lt;/p>
&lt;ul>
&lt;li>read-only rootfs&lt;/li>
&lt;li>read-only /etc/&lt;/li>
&lt;/ul>
&lt;p>This also kinda hardens my systems to an extent that I can&amp;rsquo;t
accidentally cause catastrophic damage to it.&lt;/p>
&lt;p>The feature I&amp;rsquo;m letting go of is the A/B Partition (rpm-ostree for Fedora
land). While a good feature, having to integrate it into my current
machine is going to be very very challenging.&lt;/p>
&lt;p>I actually feel that, the core assumption the Immutable Distros make,
that all hardware is going to &lt;code>Just Work&lt;/code>, is flawed. While Linux has
substantially improved over the past years, there&amp;rsquo;s still a hit/miss
when introducing very recent hardware.&lt;/p>
&lt;p>Immutable Linux is targeted for the novice user, who won&amp;rsquo;t accidentally
mess with the system. But what would the novice user do in case they
have issues with their recently purchased hardware, that they are
attempting to run (Immutable) Linux on.&lt;/p>
&lt;h3 id="riteshs-immutable-debian">Ritesh&amp;rsquo;s Immutable Debian&lt;/h3>
&lt;p>With the premise set, on to sailing in immutable land.&lt;/p>
&lt;p>There&amp;rsquo;s another ground breaking innovation that has been happening;
which I think everyone is aware of. And may be using it as well, direct
or indirect.&lt;/p>
&lt;p>&lt;em>Artificial Intelligence&lt;/em>&lt;/p>
&lt;p>While I&amp;rsquo;ve only been a user for a couple of months as I draft this post,
I&amp;rsquo;m now very much impressed with all this innovation. Being at the
consumer end has me appreciating it for what it has offered thus far.
And I haven&amp;rsquo;t even scratched the surface. I&amp;rsquo;m making attempts at
developing understanding of &lt;em>Machine Learning&lt;/em> and &lt;em>Artificial
Intelligence&lt;/em> but there&amp;rsquo;s a looonnngg way to go still.&lt;/p>
&lt;p>What I&amp;rsquo;m appreciating the most is the availability of the AI Technology.
It has helped me be more efficient. And thus I get to use the gain
(time) with family.&lt;/p>
&lt;p>To wrap, what I tailored my primary OS to, wouldn&amp;rsquo;t have been possible
without assistance from AI.&lt;/p>
&lt;p>With that, I disclaim that the rest of this article is primarily drafted
by my AI Companion. This is going to serve me as a reference for future,
when I forget about how all of this was structured.&lt;/p>
&lt;h1 id="-system-architecture-immutable-debian-btrfs--mergerfs">🏗️ System Architecture: Immutable Debian (Btrfs + MergerFS)&lt;/h1>
&lt;p>This system is a custom-hardened &lt;strong>Immutable Workstation&lt;/strong> based on Debian Testing/Unstable. It utilizes native Btrfs properties and surgical VFS mounting to isolate the Operating System from persistent data.&lt;/p>
&lt;h2 id="1-storage-strategy-subvolume-isolation">1. Storage Strategy: Subvolume Isolation&lt;/h2>
&lt;p>The system resides on a LUKS-encrypted NVMe partition, using a flattened subvolume layout to separate the &amp;ldquo;Gold Master&amp;rdquo; OS from volatile and persistent data.&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th style="text-align:left">Mount Point&lt;/th>
&lt;th style="text-align:left">Subvolume Path&lt;/th>
&lt;th style="text-align:left">State&lt;/th>
&lt;th style="text-align:left">Purpose&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td style="text-align:left">&lt;code>/&lt;/code>&lt;/td>
&lt;td style="text-align:left">&lt;code>/ROOTVOL&lt;/code>&lt;/td>
&lt;td style="text-align:left">&lt;strong>RO&lt;/strong>&lt;/td>
&lt;td style="text-align:left">The core OS image.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td style="text-align:left">&lt;code>/etc&lt;/code>&lt;/td>
&lt;td style="text-align:left">&lt;code>/ROOTVOL/etc&lt;/code>&lt;/td>
&lt;td style="text-align:left">&lt;strong>RO&lt;/strong>&lt;/td>
&lt;td style="text-align:left">System configuration (Snapshot-capable).&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td style="text-align:left">&lt;code>/home/rrs&lt;/code>&lt;/td>
&lt;td style="text-align:left">&lt;code>/ROOTVOL/home/rrs&lt;/code>&lt;/td>
&lt;td style="text-align:left">&lt;strong>RW&lt;/strong>&lt;/td>
&lt;td style="text-align:left">User data and Kitty terminal configs.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td style="text-align:left">&lt;code>/var/lib&lt;/code>&lt;/td>
&lt;td style="text-align:left">&lt;code>/ROOTVOL/var/lib&lt;/code>&lt;/td>
&lt;td style="text-align:left">&lt;strong>RW&lt;/strong>&lt;/td>
&lt;td style="text-align:left">Docker, Apt state, and system DBs.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td style="text-align:left">&lt;code>/var/spool&lt;/code>&lt;/td>
&lt;td style="text-align:left">&lt;code>/ROOTVOL/var/spool&lt;/code>&lt;/td>
&lt;td style="text-align:left">&lt;strong>RW&lt;/strong>&lt;/td>
&lt;td style="text-align:left">Mail queues and service state.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td style="text-align:left">&lt;code>/swap&lt;/code>&lt;/td>
&lt;td style="text-align:left">&lt;code>/ROOTVOL/swap&lt;/code>&lt;/td>
&lt;td style="text-align:left">&lt;strong>RW&lt;/strong>&lt;/td>
&lt;td style="text-align:left">Isolated path for No_COW Swapfile.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td style="text-align:left">&lt;code>/disk-tmp&lt;/code>&lt;/td>
&lt;td style="text-align:left">&lt;code>/ROOTVOL/disk-tmp&lt;/code>&lt;/td>
&lt;td style="text-align:left">&lt;strong>RW&lt;/strong>&lt;/td>
&lt;td style="text-align:left">MergerFS overflow tier.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;h3 id="11-etcfstab">1.1 /etc/fstab&lt;/h3>
&lt;pre tabindex="0">&lt;code>❯ cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use &amp;#39;blkid&amp;#39; to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# &amp;lt;file system&amp;gt; &amp;lt;mount point&amp;gt; &amp;lt;type&amp;gt; &amp;lt;options&amp;gt; &amp;lt;dump&amp;gt; &amp;lt;pass&amp;gt;
# --- ROOT &amp;amp; BOOT ---
/dev/mapper/nvme0n1p3_crypt / btrfs autodefrag,compress=zstd,discard=async,noatime,defaults,ro 0 0
/dev/nvme0n1p2 /boot ext4 defaults 0 2
/dev/nvme0n1p1 /boot/efi vfat umask=0077 0 1
# --- SWAP ---
# Mount the &amp;#34;Portal&amp;#34; to the swap subvolume using UUID (Robust)
UUID=4473b40b-bb46-43d6-b69c-ef17bfcac41c /swap btrfs subvol=/ROOTVOL/swap,defaults,noatime 0 0
# Activate the swap file by path (Correct for files)
/swap/swapfile none swap defaults 0 0
# --- DATA / MEDIA ---
UUID=439e297a-96a5-4f81-8b3a-24559839539d /media/rrs/TOSHIBA btrfs noauto,compress=zstd,space_cache=v2,subvolid=5,subvol=/,user
# --- MERGERFS ---
# --- DISK-TMP (MergerFS Overflow Tier) ---
# Ensure this ID matches your actual disk-tmp subvolume
UUID=4473b40b-bb46-43d6-b69c-ef17bfcac41c /disk-tmp btrfs subvolid=417,discard=async,defaults,noatime,compress=zstd 0 0
tmpfs /ram-tmp tmpfs defaults 0 0
/ram-tmp:/disk-tmp /tmp fuse.mergerfs x-systemd.requires=/ram-tmp,x-systemd.requires=/disk-tmp,defaults,allow_other,use_ino,nonempty,minfreespace=1G,category.create=all,moveonenospc=true 0 0
# --- IMMUTABILITY PERSISTENCE LAYERS ---
# We explicitly mount these subvolumes so they remain Writable later.
# UUID is the same as your /var/lib entry (your main Btrfs volume).
# 1. /var/lib (Docker, Apt state) - ID 50659
UUID=4473b40b-bb46-43d6-b69c-ef17bfcac41c /var/lib btrfs subvolid=50659,discard=async,defaults,noatime,compress=zstd 0 0
# 2. /home/rrs (User Data) - ID 13032
UUID=4473b40b-bb46-43d6-b69c-ef17bfcac41c /home/rrs btrfs subvolid=13032,discard=async,defaults,noatime,compress=zstd 0 0
# 3. /etc (System Config) - ID 13030
UUID=4473b40b-bb46-43d6-b69c-ef17bfcac41c /etc btrfs subvolid=13030,discard=async,defaults,noatime,compress=zstd,ro 0 0
# 4. /var/log (Logs) - ID 406
UUID=4473b40b-bb46-43d6-b69c-ef17bfcac41c /var/log btrfs subvolid=406,discard=async,defaults,noatime,compress=zstd 0 0
# 5. /var/cache (Apt Cache) - ID 409
UUID=4473b40b-bb46-43d6-b69c-ef17bfcac41c /var/cache btrfs subvolid=409,discard=async,defaults,noatime,compress=zstd 0 0
# 6. /var/tmp (Temp files) - ID 401
UUID=4473b40b-bb46-43d6-b69c-ef17bfcac41c /var/tmp btrfs subvolid=401,discard=async,defaults,noatime,compress=zstd 0 0
# /var/spool
UUID=4473b40b-bb46-43d6-b69c-ef17bfcac41c /var/spool btrfs subvolid=50689,discard=async,defaults,noatime,compress=zstd 0 0
&lt;/code>&lt;/pre>&lt;h2 id="2-tiered-memory-model-tmp">2. Tiered Memory Model (/tmp)&lt;/h2>
&lt;p>To balance performance and capacity, &lt;code>/tmp&lt;/code> is managed via &lt;strong>MergerFS&lt;/strong>:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Tier 1 (RAM):&lt;/strong> &lt;code>tmpfs&lt;/code> mounted at &lt;code>/ram-tmp&lt;/code>.&lt;/li>
&lt;li>&lt;strong>Tier 2 (Disk):&lt;/strong> Btrfs subvolume mounted at &lt;code>/disk-tmp&lt;/code>.&lt;/li>
&lt;li>&lt;strong>Logic:&lt;/strong> Files are written to RAM first. If RAM falls below 1GB available, files spill over to the Btrfs disk tier.&lt;/li>
&lt;/ul>
&lt;h2 id="3-hibernation--swap-logic">3. Hibernation &amp;amp; Swap Logic&lt;/h2>
&lt;ul>
&lt;li>&lt;strong>Size:&lt;/strong> 33 GiB (Configured for Suspend-to-Disk with 24GB RAM).&lt;/li>
&lt;li>&lt;strong>Attribute:&lt;/strong> The &lt;code>/swap&lt;/code> subvolume is marked &lt;strong>No_COW (+C)&lt;/strong>.&lt;/li>
&lt;li>&lt;strong>Kernel Integration:&lt;/strong>
&lt;ul>
&lt;li>&lt;code>resume=UUID=...&lt;/code> (Points to the unlocked LUKS container).&lt;/li>
&lt;li>&lt;code>resume_offset=...&lt;/code> (Physical extent mapping for Btrfs).&lt;/li>
&lt;/ul>
&lt;/li>
&lt;/ul>
&lt;h3 id="31-systemd-sleephibernation">3.1 systemd sleep/Hibernation&lt;/h3>
&lt;pre tabindex="0">&lt;code>❯ cat /etc/systemd/sleep.conf.d/sleep.conf
[Sleep]
HibernateDelaySec=12min
&lt;/code>&lt;/pre>&lt;p>and&lt;/p>
&lt;pre tabindex="0">&lt;code>❯ cat /etc/systemd/logind.conf.d/logind.conf
[Login]
HandleLidSwitch=suspend-then-hibernate
HandlePowerKey=suspend-then-hibernate
HandleSuspendKey=suspend-then-hibernate
SleepOperation==suspend-then-hibernate
&lt;/code>&lt;/pre>&lt;h2 id="4-immutability--safety-mechanisms">4. Immutability &amp;amp; Safety Mechanisms&lt;/h2>
&lt;p>The system state is governed by two key components:&lt;/p>
&lt;h3 id="a-the-control-script-immutectl">A. The Control Script (&lt;code>immutectl&lt;/code>)&lt;/h3>
&lt;p>Handles the state transition by flipping Btrfs properties and VFS mount flags in the correct order.&lt;/p>
&lt;ul>
&lt;li>&lt;code>sudo immutectl unlock&lt;/code>: Sets &lt;code>ro=false&lt;/code> and remounts &lt;code>rw&lt;/code>.&lt;/li>
&lt;li>&lt;code>sudo immutectl lock&lt;/code>: Sets &lt;code>ro=true&lt;/code> and remounts &lt;code>ro&lt;/code>.&lt;/li>
&lt;/ul>
&lt;pre tabindex="0">&lt;code>❯ cat /usr/local/bin/immutectl
#!/bin/bash
# Ensure script is run as root
if [[ $EUID -ne 0 ]]; then
echo &amp;#34;This script must be run as root (sudo).&amp;#34;
exit 1
fi
ACTION=$1
case $ACTION in
unlock)
echo &amp;#34;🔓 Unlocking / and /etc for maintenance...&amp;#34;
# 1. First, tell the Kernel to allow writes to the mount point
mount -o remount,rw /
mount -o remount,rw /etc
# 2. Now that the VFS is RW, Btrfs will allow you to change the property
btrfs property set / ro false
btrfs property set /etc ro false
echo &amp;#34;Status: System is now READ-WRITE.&amp;#34;
;;
lock)
echo &amp;#34;🔒 Locking / and /etc (Immutable Mode)...&amp;#34;
sync
btrfs property set / ro true
btrfs property set /etc ro true
# We still attempt remount, but we ignore failure since Property is the Hard Lock
mount -o remount,ro / 2&amp;gt;/dev/null
mount -o remount,ro /etc 2&amp;gt;/dev/null
echo &amp;#34;Status: System is now READ-ONLY (Btrfs Property Set).&amp;#34;
;;
status)
echo &amp;#34;--- System Immutability Status ---&amp;#34;
for dir in &amp;#34;/&amp;#34; &amp;#34;/etc&amp;#34;; do
# Get VFS state
VFS_STATE=$(grep &amp;#34; $dir &amp;#34; /proc/mounts | awk &amp;#39;{print $4}&amp;#39; | cut -d, -f1)
# Get Btrfs Property state
BTRFS_PROP=$(btrfs property get &amp;#34;$dir&amp;#34; ro | cut -d= -f2)
# Determine overall health
if [[ &amp;#34;$BTRFS_PROP&amp;#34; == &amp;#34;true&amp;#34; ]]; then
FINAL_STATUS=&amp;#34;LOCKED (RO)&amp;#34;
else
FINAL_STATUS=&amp;#34;UNLOCKED (RW)&amp;#34;
fi
echo &amp;#34;Path: $dir&amp;#34;
echo &amp;#34; - VFS Layer (Mount): $VFS_STATE&amp;#34;
echo &amp;#34; - Btrfs Property: ro=$BTRFS_PROP&amp;#34;
echo &amp;#34; - Effective State: $FINAL_STATUS&amp;#34;
# Check for mismatch (The &amp;#34;Busy&amp;#34; scenario)
if [[ &amp;#34;$VFS_STATE&amp;#34; == &amp;#34;rw&amp;#34; &amp;amp;&amp;amp; &amp;#34;$BTRFS_PROP&amp;#34; == &amp;#34;true&amp;#34; ]]; then
echo &amp;#34; ⚠️ NOTICE: VFS is RW but Btrfs is RO. System is effectively Immutable.&amp;#34;
fi
echo &amp;#34;&amp;#34;
done
;;
*)
echo &amp;#34;Usage: $0 {lock|unlock|status}&amp;#34;
exit 1
;;
esac
&lt;/code>&lt;/pre>&lt;h3 id="b-the-smart-seal-immutability-sealservice">B. The Smart Seal (&lt;code>immutability-seal.service&lt;/code>)&lt;/h3>
&lt;p>A systemd one-shot service that ensures the system is locked on boot.&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Fail-safe:&lt;/strong> The service checks &lt;code>/proc/cmdline&lt;/code> for the standalone word &lt;code>rw&lt;/code>. If found (via GRUB manual override), the seal is aborted to allow emergency maintenance.&lt;/li>
&lt;/ul>
&lt;pre tabindex="0">&lt;code>❯ cat /etc/systemd/system/immutability-seal.service
[Unit]
Description=Ensure Btrfs Immutable Properties are set on Boot (unless rw requested)
DefaultDependencies=no
After=systemd-remount-fs.service
Before=local-fs.target
# Don&amp;#39;t run in emergency/rescue modes
#ConditionPathExists=!/run/systemd/seats/seat0
[Service]
Type=oneshot
# The robust check: exit if &amp;#39;rw&amp;#39; exists as a standalone word
ExecStartPre=/bin/sh -c &amp;#39;! grep -qE &amp;#34;\brw\b&amp;#34; /proc/cmdline&amp;#39;
ExecStartPre=mount -o remount,rw /
ExecStart=/usr/bin/btrfs property set / ro true
ExecStart=/usr/bin/btrfs property set /etc ro true
ExecStartPost=mount -o remount,ro /
RemainAfterExit=yes
[Install]
WantedBy=local-fs.target
&lt;/code>&lt;/pre>&lt;h2 id="5-monitoring--maintenance">5. Monitoring &amp;amp; Maintenance&lt;/h2>
&lt;ul>
&lt;li>&lt;strong>Nagging:&lt;/strong> A systemd user-timer runs &lt;code>immutability-nag&lt;/code> every 15 minutes to notify the desktop session if the system is currently in an &amp;ldquo;Unlocked&amp;rdquo; state.&lt;/li>
&lt;li>&lt;strong>Verification:&lt;/strong> Use &lt;code>sudo immutectl status&lt;/code> to verify that both the VFS Layer and Btrfs Properties are in sync.&lt;/li>
&lt;/ul>
&lt;h3 id="51-nagging">5.1 Nagging&lt;/h3>
&lt;pre tabindex="0">&lt;code>❯ cat ~/bin/immutability-nag
#!/bin/bash
# Check Btrfs property
BTRFS_STATUS=$(btrfs property get / ro | cut -d= -f2)
if [[ &amp;#34;$BTRFS_STATUS&amp;#34; == &amp;#34;false&amp;#34; ]]; then
# Use notify-send (Standard, fast, non-intrusive)
notify-send -u critical -i security-low \
&amp;#34;🔓 System Unlocked&amp;#34; \
&amp;#34;Root is currently WRITABLE. Run &amp;#39;immutectl lock&amp;#39; when finished.&amp;#34;
fi
&lt;/code>&lt;/pre>&lt;p>and&lt;/p>
&lt;pre tabindex="0">&lt;code>❯ usystemctl cat immutability-nag.service
# /home/rrs/.config/systemd/user/immutability-nag.service
[Unit]
Description=Check Btrfs immutability and notify user
# Ensure it doesn&amp;#39;t run before the graphical session is ready
After=graphical-session.target
[Service]
Type=oneshot
ExecStart=%h/bin/immutability-nag
# Standard environment for notify-send to find the DBus session
Environment=DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%U/bus
[Install]
WantedBy=default.target
   ~   20:35:15
❯ usystemctl cat immutability-nag.timer
# /home/rrs/.config/systemd/user/immutability-nag.timer
[Unit]
Description=Check immutability every 15 mins
[Timer]
OnStartupSec=5min
OnUnitActiveSec=15min
[Install]
WantedBy=timers.target
&lt;/code>&lt;/pre>&lt;p>And the resultant nag in action.
&lt;link rel="stylesheet" href="https://researchut.com/css/hugo-easy-gallery.css" />
&lt;div class="box" >
&lt;figure itemprop="associatedMedia" itemscope itemtype="http://schema.org/ImageObject">
&lt;div class="img">
&lt;img itemprop="thumbnail" src="https://researchut.com/images/immutable-seal.jpeg" alt="Immutable Debian Nag"/>
&lt;/div>
&lt;a href="https://researchut.com/images/immutable-seal.jpeg" itemprop="contentUrl">&lt;/a>
&lt;figcaption>&lt;h4>Immutable Debian Nag&lt;/h4>
&lt;/figcaption>
&lt;/figure>
&lt;/div>
&lt;/p>
&lt;h3 id="52-verification">5.2 Verification&lt;/h3>
&lt;pre tabindex="0">&lt;code>❯ sudo immutectl status
[sudo] password for rrs:
--- System Immutability Status ---
Path: /
- VFS Layer (Mount): rw
- Btrfs Property: ro=false
- Effective State: UNLOCKED (RW)
Path: /etc
- VFS Layer (Mount): rw
- Btrfs Property: ro=false
- Effective State: UNLOCKED (RW)
   ~   21:14:08
❯ sudo immutectl lock
🔒 Locking / and /etc (Immutable Mode)...
Status: System is now READ-ONLY (Btrfs Property Set).
   ~   21:14:15
❯ sudo immutectl status
--- System Immutability Status ---
Path: /
- VFS Layer (Mount): rw
- Btrfs Property: ro=true
- Effective State: LOCKED (RO)
⚠️ NOTICE: VFS is RW but Btrfs is RO. System is effectively Immutable.
Path: /etc
- VFS Layer (Mount): rw
- Btrfs Property: ro=true
- Effective State: LOCKED (RO)
⚠️ NOTICE: VFS is RW but Btrfs is RO. System is effectively Immutable.
&lt;/code>&lt;/pre>&lt;hr>
&lt;p>&lt;strong>Date Configured:&lt;/strong> December 2025&lt;br>
&lt;strong>Philosophy:&lt;/strong> The OS is a diagnostic tool. If an application fails to write to a locked path, the application is the variable, not the system.&lt;/p>
&lt;h2 id="wrap">Wrap&lt;/h2>
&lt;p>Overall, I&amp;rsquo;m very very happy with, the result of a day of working
together with AI. I wouldn&amp;rsquo;t have gotten things done so quick in such
time if it wasn&amp;rsquo;t around. Such great is this age of AI.&lt;/p></description></item><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><item><title>ThinkPad AMD Debian</title><link>https://researchut.com/blog/Thinkpad_AMD_Debian/</link><pubDate>Tue, 11 Jan 2022 19:37:24 +0530</pubDate><author>rrs@researchut.com (Ritesh Raj Sarraf)</author><guid>https://researchut.com/blog/Thinkpad_AMD_Debian/</guid><description>&lt;p>After a hiatus of 6 years, it was nice to be back with the ThinkPad. This blog post briefly touches upon my impressions with the current generation ThinkPad T14 Gen2 AMD variant.&lt;/p>
&lt;link rel="stylesheet" href="https://researchut.com/css/hugo-easy-gallery.css" />
&lt;div class="box" >
&lt;figure itemprop="associatedMedia" itemscope itemtype="http://schema.org/ImageObject">
&lt;div class="img">
&lt;img itemprop="thumbnail" src="https://researchut.com/images/ThinkPad_T14_Gen2_AMD.jpg" alt="ThinkPad T14 Gen2 AMD"/>
&lt;/div>
&lt;a href="https://researchut.com/images/ThinkPad_T14_Gen2_AMD.jpg" itemprop="contentUrl">&lt;/a>
&lt;figcaption>&lt;h4>ThinkPad T14 Gen2 AMD&lt;/h4>
&lt;/figcaption>
&lt;/figure>
&lt;/div>
&lt;h3 id="lenovo">Lenovo&lt;/h3>
&lt;p>It took 8 weeks to get my hands on the machine. Given the pandemic, restrictions and uncertainities, not sure if I should call it an ontime delivery. This was a CTO - Customise-to-order; so was nice to get rid of things I really didn&amp;rsquo;t care/use much. On the other side, it also meant I could save on some power. It also came comparatively cheaper overall.&lt;/p>
&lt;ul>
&lt;li>No fingerprint reader&lt;/li>
&lt;li>No Touch screen&lt;/li>
&lt;/ul>
&lt;p>There&amp;rsquo;s still parts where Lenovo could improve. Or less frustate a customer. I don&amp;rsquo;t understand why a company would provide a full customization option on their portal, while at the same time, not provide an explicit option to choose the make/model of the hardware one wants. Lenovo deliberately chooses to not show/specify which WiFi adapter one could choose. So, as I suspected, I ended up with a &lt;code>MEDIATEK Corp. Device 7961&lt;/code> wifi adapter.&lt;/p>
&lt;h3 id="amd">AMD&lt;/h3>
&lt;p>For the first time in my computing life, I&amp;rsquo;m now using AMD at the core. I was pretty frustrated with annoying Intel Graphics bugs, so decided to take the plunge and give AMD/ATI a shot, knowing that the &lt;code>radeon&lt;/code> driver does have decent support. So far, on the graphics side of things, I&amp;rsquo;m glad that things look bright. The stock in-kernel radeon driver has been working perfect for my needs and I haven&amp;rsquo;t had to tinker even once so far, in my 30 days of use.&lt;/p>
&lt;p>On the overall system performance, I have not done any benchmarks nor do I want to do. But wholly, the system performance is smooth.&lt;/p>
&lt;h3 id="powerthermal">Power/Thermal&lt;/h3>
&lt;p>This is where things need more improvement on the AMD side. This AMD laptop terribly draws a lot of power in suspend mode. And it isn&amp;rsquo;t just this machine, but also the previous T14 Gen1 which has similar problems. I&amp;rsquo;m not sure if this is a generic ThinkPad problem, or an AMD specific problem. But coming from the Dell XPS 13 9370 Intel, this does draw a lot lot more power. So much, that I chose to use hibernation instead.&lt;/p>
&lt;p>Similarly, on the thermal side, this machine doesn&amp;rsquo;t cool down well as compared the the Dell XPS Intel one. On an idle machine, its temperature are comparatively higher. Looking at &lt;code>powertop&lt;/code> reports, it does show to consume an average of 10 watts power even while idle.&lt;/p>
&lt;p>I&amp;rsquo;m hoping these are Linux ingeration issues and that Lenovo/AMD will improve things in the coming months. But given the user feedback on the ThinkPad T14 Gen1 thread, it may just be wishful thinking.&lt;/p>
&lt;h3 id="linux">Linux&lt;/h3>
&lt;p>The overall hardware support has been surprisingly decent. The MediaTek WiFi driver had some glitches but with Linux 5.15+, things have considerably improved. And I hope the trend will continue with forthcoming Linux releases. My previous device driver experience with MediaTek wasn&amp;rsquo;t good but I took the plunge, considering that in the worst scenario I&amp;rsquo;d have the option to swap the card.&lt;/p>
&lt;p>There&amp;rsquo;s a lot of marketing about Linux + Intel. But I took a jibe with Linux + AMD. There are glitches but nothing so far that has been a dealbreaker. If anything, I wish Lenovo/AMD would seriously work on the power/thermal issues.&lt;/p>
&lt;h3 id="migration">Migration&lt;/h3>
&lt;p>Other than what&amp;rsquo;s mentioned above, I haven&amp;rsquo;t had any serious issues. I may have had some rare occassional hangs but they&amp;rsquo;ve been so infrequent that I haven&amp;rsquo;t spent time to investigate those.&lt;/p>
&lt;p>Upon receiving the machine, my biggest requirement was how to switch my current workstation from Dell XPS to Lenovo ThinkPad. I&amp;rsquo;ve been using btrfs for some time now. And over the years, built my own practise on how to structure it. Things like, provisioning [sub]volumes, based on use cases is one thing I see. Like keeping separate subvols for: cache/temporary data, copy-on-write data , swap etc. I wish these things could be simplified; either on the btrfs tooling side or some different tool on top of it.&lt;/p>
&lt;p>Below is filtered list of subvols created over years, that were worthy of moving to the new machine.&lt;/p>
&lt;pre tabindex="0">&lt;code>rrs@priyasi:~$ cat btrfs-volume-layout
ID 550 gen 19166 top level 5 path home/foo/.cache
ID 552 gen 1522688 top level 5 path home/rrs
ID 553 gen 1522688 top level 552 path home/rrs/.cache
ID 555 gen 1426323 top level 552 path home/rrs/rrs-home/Libvirt-Images
ID 618 gen 1522672 top level 5 path var/spool/news
ID 634 gen 1522670 top level 5 path var/tmp
ID 635 gen 1522688 top level 5 path var/log
ID 639 gen 1522226 top level 5 path var/cache
ID 992 gen 1522670 top level 5 path disk-tmp
ID 1018 gen 1522688 top level 552 path home/rrs/NoBackup
ID 1196 gen 1522671 top level 5 path etc
ID 23721 gen 775692 top level 5 path swap
18:54 ♒ ॐ ♅ ♄ ⛢ ☺ 😄
&lt;/code>&lt;/pre>&lt;h4 id="btrfs-sendreceive">btrfs send/receive&lt;/h4>
&lt;p>This did come in handy but I sorely missed some feature. Maybe they aren&amp;rsquo;t there, or are there and I didn&amp;rsquo;t look close enough. Over the years, different attributes were set to different subvols. Over time I forget what feature was added where. But from a migration point of view, it&amp;rsquo;d be nice to say, &amp;ldquo;Take this volume and take it with all its attributes&amp;rdquo;. I didn&amp;rsquo;t find that functionality in &lt;code>send/receive&lt;/code>.&lt;/p>
&lt;p>There&amp;rsquo;s &lt;code>get/set-property&lt;/code> which I noticed later but by then it was late. So some sort of tooling, ideally something like &lt;code>btrfs migrate&lt;/code> or somesuch would be nicer.&lt;/p>
&lt;p>In the file system world, we already have nice tools to take care of similar scenarios. Like with &lt;code>rsync&lt;/code>, I can request it to carry all file attributes.&lt;/p>
&lt;p>Also, iirc, &lt;code>send/receive&lt;/code> works only on &lt;code>ro&lt;/code> volumes. So there&amp;rsquo;s more work one needs to do in:&lt;/p>
&lt;ol>
&lt;li>create ro vol&lt;/li>
&lt;li>send&lt;/li>
&lt;li>receive&lt;/li>
&lt;li>don&amp;rsquo;t forget to set rw property&lt;/li>
&lt;li>And then somehow find out other properties set on each individual subvols and [re]apply the same on the destination&lt;/li>
&lt;/ol>
&lt;p>I wish this all be condensed into a sub-command.&lt;/p>
&lt;p>For my own sake, for this migration, the steps used were:&lt;/p>
&lt;pre tabindex="0">&lt;code>user@debian:~$ for volume in `sudo btrfs sub list /media/user/TOSHIBA/Migrate/ | cut -d &amp;#39; &amp;#39; -f9 | grep -v ROOTVOL | grep -v etc | grep -v btrbk`; do echo $volume; sud
o btrfs send /media/user/TOSHIBA/$volume | sudo btrfs receive /media/user/BTRFSROOT/ ; done
Migrate/snapshot_disk-tmp
At subvol /media/user/TOSHIBA/Migrate/snapshot_disk-tmp
At subvol snapshot_disk-tmp
Migrate/snapshot-home_foo_.cache
At subvol /media/user/TOSHIBA/Migrate/snapshot-home_foo_.cache
At subvol snapshot-home_foo_.cache
Migrate/snapshot-home_rrs
At subvol /media/user/TOSHIBA/Migrate/snapshot-home_rrs
At subvol snapshot-home_rrs
Migrate/snapshot-home_rrs_.cache
At subvol /media/user/TOSHIBA/Migrate/snapshot-home_rrs_.cache
At subvol snapshot-home_rrs_.cache
ERROR: crc32 mismatch in command
Migrate/snapshot-home_rrs_rrs-home_Libvirt-Images
At subvol /media/user/TOSHIBA/Migrate/snapshot-home_rrs_rrs-home_Libvirt-Images
At subvol snapshot-home_rrs_rrs-home_Libvirt-Images
ERROR: crc32 mismatch in command
Migrate/snapshot-var_spool_news
At subvol /media/user/TOSHIBA/Migrate/snapshot-var_spool_news
At subvol snapshot-var_spool_news
Migrate/snapshot-var_lib_machines
At subvol /media/user/TOSHIBA/Migrate/snapshot-var_lib_machines
At subvol snapshot-var_lib_machines
Migrate/snapshot-var_lib_machines_DebianSidTemplate
..... snipped .....
&lt;/code>&lt;/pre>&lt;p>And then, follow-up with:&lt;/p>
&lt;pre tabindex="0">&lt;code>user@debian:~$ for volume in `sudo btrfs sub list /media/user/BTRFSROOT/ | cut -d &amp;#39; &amp;#39; -f9`; do echo $volume; sudo btrfs property set -ts /media/user/BTRFSROOT/$volume ro false; done
ROOTVOL
ERROR: Could not open: No such file or directory
etc
snapshot_disk-tmp
snapshot-home_foo_.cache
snapshot-home_rrs
snapshot-var_spool_news
snapshot-var_lib_machines
snapshot-var_lib_machines_DebianSidTemplate
snapshot-var_lib_machines_DebSidArmhf
snapshot-var_lib_machines_DebianJessieTemplate
snapshot-var_tmp
snapshot-var_log
snapshot-var_cache
snapshot-disk-tmp
&lt;/code>&lt;/pre>&lt;p>And then finally, renaming everything to match proper:&lt;/p>
&lt;pre tabindex="0">&lt;code>user@debian:/media/user/BTRFSROOT$ for x in snapshot*; do vol=$(echo $x | cut -d &amp;#39;-&amp;#39; -f2 | sed -e &amp;#34;s|_|/|g&amp;#34;); echo $x $vol; sudo mv $x $vol; done
snapshot-var_lib_machines var/lib/machines
snapshot-var_lib_machines_Apertisv2020ospackTargetARMHF var/lib/machines/Apertisv2020ospackTargetARMHF
snapshot-var_lib_machines_Apertisv2021ospackTargetARM64 var/lib/machines/Apertisv2021ospackTargetARM64
snapshot-var_lib_machines_Apertisv2022dev3ospackTargetARMHF var/lib/machines/Apertisv2022dev3ospackTargetARMHF
snapshot-var_lib_machines_BusterArm64 var/lib/machines/BusterArm64
snapshot-var_lib_machines_DebianBusterTemplate var/lib/machines/DebianBusterTemplate
snapshot-var_lib_machines_DebianJessieTemplate var/lib/machines/DebianJessieTemplate
snapshot-var_lib_machines_DebianSidTemplate var/lib/machines/DebianSidTemplate
snapshot-var_lib_machines_DebianSidTemplate_var_lib_portables var/lib/machines/DebianSidTemplate/var/lib/portables
snapshot-var_lib_machines_DebSidArm64 var/lib/machines/DebSidArm64
snapshot-var_lib_machines_DebSidArmhf var/lib/machines/DebSidArmhf
snapshot-var_lib_machines_DebSidMips var/lib/machines/DebSidMips
snapshot-var_lib_machines_JenkinsApertis var/lib/machines/JenkinsApertis
snapshot-var_lib_machines_v2019 var/lib/machines/v2019
snapshot-var_lib_machines_v2019LinuxSupport var/lib/machines/v2019LinuxSupport
snapshot-var_lib_machines_v2020 var/lib/machines/v2020
snapshot-var_lib_machines_v2021dev3Slim var/lib/machines/v2021dev3Slim
snapshot-var_lib_machines_v2021dev3SlimTarget var/lib/machines/v2021dev3SlimTarget
snapshot-var_lib_machines_v2022dev2OspackMinimal var/lib/machines/v2022dev2OspackMinimal
snapshot-var_lib_portables var/lib/portables
snapshot-var_log var/log
snapshot-var_spool_news var/spool/news
snapshot-var_tmp var/tmp
&lt;/code>&lt;/pre>&lt;h4 id="snapper">snapper&lt;/h4>
&lt;p>Entirely independent of this, but indirectly related. I use &lt;code>snapper&lt;/code> as my snapshotting tool. It worked perfect on my previous machine. While everything got migrated, the only thing that fell apart was &lt;code>snapper&lt;/code>. It just wouldn&amp;rsquo;t start/run proper. Funny thing is that I just removed the snapper configs and reinitialized with the exact same config again, and voila snapper was happy.&lt;/p>
&lt;h3 id="conclusion">Conclusion&lt;/h3>
&lt;p>That was pretty much it. With the above and then also migrating &lt;code>/boot&lt;/code> and then just chroot to install the boot loader. At some time, I&amp;rsquo;d like to explore other boot options but given that that is such a non-essential task, it is low on the list.&lt;/p>
&lt;p>The good part was that I booted into my new machine with my exact workstation setup as it was. All the way to the user cache and the desktop session. So it was nice on that part.&lt;/p>
&lt;p>But I surely think there&amp;rsquo;s room for a better migration experience here. If not directly as &lt;code>btrfs migrate&lt;/code>, then maybe as an independent tool. The problem is that such a tool is going to be used once in years, so I didn&amp;rsquo;t find the motivation to write one. But this surely would be a good use case for the distribution vendors.&lt;/p></description></item><item><title>Debian Boot time</title><link>https://researchut.com/blog/w530-boot-time-with-debian/</link><pubDate>Sat, 20 Oct 2012 14:38:13 -0400</pubDate><author>rrs@researchut.com (Ritesh Raj Sarraf)</author><guid>https://researchut.com/blog/w530-boot-time-with-debian/</guid><description>&lt;p>
&lt;div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;">
&lt;iframe allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen="allowfullscreen" loading="eager" referrerpolicy="strict-origin-when-cross-origin" src="https://www.youtube.com/embed/cTK3aIZbe2A?autoplay=1&amp;controls=1&amp;end=0&amp;loop=0&amp;mute=1&amp;start=0" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;" title="YouTube video"
>&lt;/iframe>
&lt;/div>
In case, the video doesn&amp;rsquo;t show on the page,
&lt;a href="http://www.youtube.com/watch?v=cTK3aIZbe2A">http://www.youtube.com/watch?v=cTK3aIZbe2A&lt;/a> This blog post is to show-off the
impressive performance I saw with my machine.&lt;/p>
&lt;p>I recently switched to a ThinkPad W530 laptop. It is a fairly recent machine
with the following hardware config:&lt;/p>
&lt;ul>
&lt;li>Intel(R) Core(TM) i7-3720QM CPU @ 2.60GHz&lt;/li>
&lt;li>8 GiB RAM&lt;/li>
&lt;li>nVIDIA Optimus&lt;/li>
&lt;li>Samsung SSD Drive&lt;/li>
&lt;/ul>
&lt;p>On the software front, I decided to take my chances. Hence:&lt;/p>
&lt;ul>
&lt;li>BTRFS File System&lt;/li>
&lt;li>SystemD Init&lt;/li>
&lt;/ul>
&lt;p>The rest is in the video. It is impressive to see how drastically the
experience has changed with this combination.&lt;/p>
&lt;p>From my limited time spent exploring the machine, all credit goes to the SSD
technology.&lt;/p></description></item></channel></rss>