Friday, October 23, 2026

Convertion F45 Server to Thin XFS LVM Provisioning with Libvirt-Hooks based on BTRFS-XFS Setup ( Assisted by Google AI )

Converting a server (such as a high-density virtualization platform) to Thin XFS LVM Provisioning with Libvirt-Hooks solves the fundamental performance bottlenecks and management complexities inherent in running virtual machines on top of a native or hybrid Btrfs storage architecture.
While Btrfs excels at features like transparent compression, file-level subvolumes, and data scrubbing, its structural design makes it highly inefficient for heavy virtual machine disk (.qcow2 or .img) storage. Moving to a thin-provisioned LVM layer running XFS-orchestrated dynamically via Libvirt event hooks - provides enterprise-grade predictability, raw block speed, and automated lifecycle management.

The core issue with openSUSE Tumbleweed is problem with native HDMI Monitors support. OverlayFS may be setup on F45 Server on top of mixed BTRFS/XFS layout as shown below and you would have an option with Btrfs low level CLI (mv,snaphot commands) to rollback the main instance to previous safe state via Overlay instances available as options provided by Grub submenu. However, BTRFS support on F45 will stay as experimental feature vs Enterprise grade solutions provided by Suse flavors headless servers.

Final disk layout ( bare metal case )

root@server45fedora:~# hostnamectl
     Static hostname: server45fedora
           Icon name: computer-desktop
             Chassis: desktop
   Chassis Asset Tag: To be filled by O.E.M.
          Machine ID: c97053a998854caa9178705b31914bc3
             Boot ID: 17bfefb60d0b4623a61b0bc44157819b
        Product UUID: af95be8a-eace-8515-aaa1-00d861d9318b
    Operating System: Fedora Linux 45 (Server Edition)
         CPE OS Name: cpe:/o:fedoraproject:fedora:45
      OS Support End: Wed 2027-11-24
OS Support Remaining: 1y 1month
              Kernel: Linux 7.2.11-300.fc45.x86_64
        Architecture: x86-64
     Hardware Vendor: Micro-Star International Co., Ltd.
      Hardware Model: MS-7C37
     Hardware Serial: To be filled by O.E.M.
    Hardware Version: 3.0
    Firmware Version: H.60
       Firmware Date: Wed 2019-11-06
        Firmware Age: 6y 11month 2w 3d
root@server45fedora:~# findmnt -t btrfs
TARGET   SOURCE                   FSTYPE OPTIONS
/        /dev/nvme0n1p4[/@-0]     btrfs  rw,relatime,seclabel,compress=zstd:1,ssd,discard=async,space_cache=v2,subvolid=260,subvol=/@-0
├─/.snapshots
│        /dev/nvme0n1p4[/snapshots]
│                                 btrfs  rw,relatime,seclabel,compress=zstd:1,ssd,discard=async,space_cache=v2,subvolid=256,subvol=/snapsho
├─/etc/libvirt/qemu
│        /dev/nvme0n1p4[/@qemu]   btrfs  rw,relatime,seclabel,compress=zstd:1,ssd,discard=async,space_cache=v2,subvolid=267,subvol=/@qemu
├─/home  /dev/nvme0n1p4[/@home]   btrfs  rw,relatime,seclabel,compress=zstd:1,ssd,discard=async,space_cache=v2,subvolid=257,subvol=/@home
├─/var/cache
│        /dev/nvme0n1p4[/@cache]  btrfs  rw,relatime,seclabel,compress=zstd:1,ssd,discard=async,space_cache=v2,subvolid=259,subvol=/@cache
└─/var/log
         /dev/nvme0n1p4[/@log]    btrfs  rw,relatime,seclabel,compress=zstd:1,ssd,discard=async,space_cache=v2,subvolid=258,subvol=/@log
root@server45fedora:~# lsblk -f
NAME                               FSTYPE      FSVER    LABEL UUID                                   FSAVAIL FSUSE% MOUNTPOINTS
sr0
zram0                              swap        1        zram0 10432693-2e2c-4c5c-8f6e-01f787c76c37                  [SWAP]
nvme1n1  ( Tumbleweed drive )
├─nvme1n1p1                        vfat        FAT32          61BC-A4BF
├─nvme1n1p2                        ext4        1.0            c6a99ff4-3bf8-4d50-809f-db6259935a55
├─nvme1n1p3                        LVM2_member LVM2 001       aMgkVz-72ia-dHzo-8Q2p-haHX-VoKU-bv5Bce
│ ├─vg_suse-tp_suse_kvm_tmeta
│ │ └─vg_suse-tp_suse_kvm-tpool
│ │   ├─vg_suse-tp_suse_kvm
│ │   └─vg_suse-vol_suse_thin      xfs                        0f543732-acde-4d36-bc88-b75e9e8c8cc4
│ └─vg_suse-tp_suse_kvm_tdata
│   └─vg_suse-tp_suse_kvm-tpool
│     ├─vg_suse-tp_suse_kvm
│     └─vg_suse-vol_suse_thin      xfs                        0f543732-acde-4d36-bc88-b75e9e8c8cc4
└─nvme1n1p4                        btrfs                      800c9083-38bd-4fab-b916-0bce438442ab
nvme0n1  ( F45 Server's drive )
├─nvme0n1p1                        vfat        FAT32          E005-797D                               590.9M     1% /boot/efi
├─nvme0n1p2                        ext4        1.0            d2c18aab-3ead-4abe-b1a4-9ef47b6b61a4      1.2G    29% /boot
├─nvme0n1p3                        LVM2_member LVM2 001       EuwX4s-zJJ3-eL0g-IsAi-AmJC-Z7XI-bxomP6
│ ├─vg_fedora-tp_fedora_kvm_tmeta
│ │ └─vg_fedora-tp_fedora_kvm-tpool
│ │   │
│ │   ├─vg_fedora-tp_fedora_kvm
│ │   └─vg_fedora-vol_fedora_thin  xfs                        f13011c1-1835-4347-addc-8f37b23475a6    142.3G     6% /var/lib/libvirt/images
│ └─vg_fedora-tp_fedora_kvm_tdata
│   └─vg_fedora-tp_fedora_kvm-tpool
│     │
│     ├─vg_fedora-tp_fedora_kvm
│     └─vg_fedora-vol_fedora_thin  xfs                        f13011c1-1835-4347-addc-8f37b23475a6    142.3G     6% /var/lib/libvirt/images
└─nvme0n1p4                        btrfs                      ff4229bc-cf09-4b53-8edc-52611c83c4f5    248.9G     8% /var/log
                                                                                                                    /var/cache
                                                                                                                    /home
                                                                                                                    /etc/libvirt/qemu
                                                                                                                    /.snapshots
#########################################################
Convertion XFS partition been setup via Anaconda deployment phase into Thin XFS provisioned LVM  via reinitializing  #########################################################
 
# 1. Ensure the target NVMe partition is completely clean
sudo umount /dev/nvme0n1p3 2>/dev/null
sudo wipefs --all /dev/nvme0n1p3

# 2. Bind the NVMe partition to LVM with 500M metadata room
sudo pvcreate --metadatasize 500M /dev/nvme0n1p3

# 3. Create your dedicated vg_fedora Volume Group container
sudo vgcreate vg_fedora /dev/nvme0n1p3

# 4. Instantiate the Thin Pool (Using 152G to respect 80/20 strategy buffer)
sudo lvcreate -L 152G --chunksize 128K --thinpool tp_fedora_kvm vg_fedora

# 5. Carve out the virtual thin volume named 'vol_fedora_thin'
sudo lvcreate -n vol_fedora_thin -V 152G --thinpool vg_fedora/tp_fedora_kvm

# Format the thin volume enabling fast VFS-level copy-on-write pointer sharing
sudo mkfs.xfs -K -m reflink=1,crc=1 /dev/vg_fedora/vol_fedora_thin


sudo mkdir -p /var/lib/libvirt/images

# Append your optimized thin block map permanently into the layout tables
echo '/dev/vg_fedora/vol_fedora_thin   /var/lib/libvirt/images xfs defaults,noatime,logbufs=8,logbsize=256k 0 0' | sudo tee -a /etc/fstab

# Rebuild systemd configuration targets and mount the new thin pool volume
sudo systemctl daemon-reload
sudo mount -a

##################################################                                     Create the target nested storage hierarchy
##################################################                                                                
 
Apply strict operational permissions for the libvirt engine
sudo chown root:root /var/lib/libvirt
sudo chmod 711 /var/lib/libvirt
sudo chown qemu:qemu /var/lib/libvirt/images
sudo chmod 711 /var/lib/libvirt/images

# Apply SELinux context rules for KVM operation on Fedora
sudo semanage fcontext -a -t virt_image_t "/var/lib/libvirt/images(/.*)?" 2>/dev/null || true
sudo restorecon -R -v /var/lib/libvirt/images


System reboot
 
########################################################
Creating /etc/libvirt/hooks/qemu and service lvm-thin-snapshot.service                                                  ########################################################
 
root@fedoraSRV:~# cat /etc/libvirt/hooks/qemu
#!/bin/bash
GUEST_NAME="$1"
ACTION="$2"
PHASE="$3"
STORAGE_DIR="/var/lib/libvirt/images"
BACKUP_DIR="${STORAGE_DIR}/.snapshots_${GUEST_NAME}"
 
[ ! -d "$STORAGE_DIR" ] && exit 0
 
if [ "$ACTION" = "prepare" ] || [ "$ACTION" = "stopped" ]; then
    /usr/bin/systemctl start lvm-thin-snapshot.service &
 
    (
        /usr/bin/sleep 2
        /usr/bin/mkdir -p "$BACKUP_DIR"
 
        for disk_path in "${STORAGE_DIR}"/*"${GUEST_NAME}"*.qcow2; do
            [ ! -f "$disk_path" ] && continue
            disk_file=$(/usr/bin/basename "$disk_path")
            timestamp=$(/usr/bin/date +%Y%m%d_%H%M%S)
 
            /usr/bin/cp --reflink=always "$disk_path" "${BACKUP_DIR}/${disk_file}.snap_${timestamp}"
 
            # FEDORA FIX: Match Fedora execution user account permissions
            /usr/bin/chown qemu:qemu "${BACKUP_DIR}/${disk_file}.snap_${timestamp}" 2>/dev/null
        done
 
        /usr/bin/ls -tp "${BACKUP_DIR}"/* | /usr/bin/grep -v '/$' | /usr/bin/tail -n +6 | /usr/bin/xargs -I {} /usr/bin/rm -- "{}" 2>/dev/null
    ) & disown
 
elif [ "$ACTION" = "define" ] || [ "$ACTION" = "undefine" ]; then
    /usr/bin/systemctl start lvm-thin-snapshot.service &
fi
 
exit 0

 
root@fedoraSRV:~# cat /etc/systemd/system/lvm-thin-snapshot.service
[Unit]
Description=Rotate Pristine LVM Thin Pool Snapshot on Libvirt Changes
After=local-fs.target
 
[Service]
Type=oneshot
User=root
Environment=VG_NAME=vg_fedora
Environment=SNAP_NAME=snap_working_vms
Environment=THIN_VOL=vol_fedora_thin
Environment=IMG_DIR=/var/lib/libvirt/images
 
ExecStart=/bin/bash -c '\
    echo "Current allocated qcow2 image count: $(ls -1 ${IMG_DIR}/*.qcow2 2>/dev/null | wc -l)"; \
    echo "Removing old snapshot if present..."; \
    /usr/sbin/lvremove -f "${VG_NAME}/${SNAP_NAME}" 2>/dev/null || true; \
    echo "Creating pristine baseline snapshot..."; \
    /usr/sbin/lvcreate -s --name "${SNAP_NAME}" "${VG_NAME}/${THIN_VOL}"'
 
[Install]
WantedBy=multi-user.target 
 
################################
Healthy system status verification
################################
root@server45fedora:~# ls -Zla  /var/lib/libvirt/images
total 6730604
drwxr-xr-x. 4 root root system_u:object_r:virt_image_t:s0           112 Oct 23 11:32 .
drwx--x--x. 1 root root system_u:object_r:virt_var_lib_t:s0         118 Sep 28 14:43 ..
-rw-------. 1 qemu qemu system_u:object_r:virt_image_t:s0   21478375424 Oct 23 11:59 ArchPlasma.qcow2
-rw-------. 1 qemu qemu system_u:object_r:virt_image_t:s0   21478375424 Oct 23 11:31 ArchServer.qcow2
drwxr-xr-x. 2 root root system_u:object_r:virt_image_t:s0          4096 Oct 23 11:59 .snapshots_ArchPlasma
drwxr-xr-x. 2 root root system_u:object_r:virt_image_t:s0          4096 Oct 23 11:31 .snapshots_ArchServer 
 
############################################################
FEDORA 45 UNIVERSAL GLOBAL DISASTER RECOVERY ENGINE  (ZERO XML EDITS) 
############################################################ 
 #!/bin/bash

set -e
 
TARGET_MNT="/var/lib/libvirt/images"
VG_NAME="vg_fedora"
THIN_VOL="vol_fedora_thin"
SNAP_NAME="snap_working_vms"
GUEST_NAME="ArchServer" # Simply toggle this variable to match your target VM name
 
echo "=== PHASE 1: RE-ARM IMMUNE STORAGE MATRIX BASELINE ==="
sudo lvremove -f ${VG_NAME}/${SNAP_NAME} 2>/dev/null || true
sudo lvcreate -s --name ${SNAP_NAME} ${VG_NAME}/${THIN_VOL}
sudo lvs ${VG_NAME}
 
echo "=== PHASE 2: CATASTROPHIC DISASTER SIMULATION ==="
sudo virsh destroy ${GUEST_NAME} 2>/dev/null || true
 
echo "==> Waiting for hook script background backup copy to complete..."
while pgrep -f "cp --reflink=always" >/dev/null || systemctl is-active --quiet lvm-thin-snapshot.service; do
    sleep 2
done
echo "==> Hook script finished! Storage layer is quiet."

 
# Dynamically find and corrupt ONLY the disks belonging to the targeted VM
for disk in ${TARGET_MNT}/*"${GUEST_NAME}"*.qcow2; do
    [ ! -f "$disk" ] && continue
    echo "==> Corrupting: $(basename "$disk")"
    sudo dd if=/dev/urandom of="$disk" bs=1M count=500 conv=notrunc
done
 
echo "=== PHASE 3: SYNCHRONOUS WAIT-FOR-EXIT CODE FENCE ==="
sudo systemctl stop virtqemud.socket virtqemud-ro.socket virtqemud-admin.socket virtqemud.service 2>/dev/null || true
sudo pkill -9 qemu 2>/dev/null || true
sudo fuser -kM "${TARGET_MNT}" 2>/dev/null || true
 
echo "==> Executing standard physical unmount loop..."
COUNTER=1
while [ $COUNTER -le 20 ]; do
    if sudo umount ${TARGET_MNT} 2>/dev/null; then
        echo "==> SUCCESS: Filesystem detached cleanly with exit code 0."
        break
    fi
    sleep 3
    COUNTER=$((COUNTER + 1))
done
 
if [ $COUNTER -gt 20 ]; then
    exit 1
fi
 
echo "=== PHASE 4: ATOMIC METADATA MERGE ==="
sudo lvconvert --merge ${VG_NAME}/${SNAP_NAME}


echo "=== PHASE 5: PURGE TRANSIENT GRAPH FILES & FIX SECURITY ==="
sudo mount ${TARGET_MNT}
 
# 1. Force the kernel and storage layers to settle after the merge mount
sudo udevadm settle
sync
 
# 2. ISOLATED CLEANUP: Clear background tokens ONLY for the targeted guest
sudo rm -f ${TARGET_MNT}/*"${GUEST_NAME}"*.lock 2>/dev/null
sudo rm -f /var/run/libvirt/qemu/"${GUEST_NAME}".xml 2>/dev/null
sudo rm -rf /var/cache/libvirt/qemu/"${GUEST_NAME}" 2>/dev/null
sudo rm -rf /var/lib/libvirt/qemu/remembered/"${GUEST_NAME}" 2>/dev/null
 
# 3. FIXED & COMPREHENSIVE XATTR PURGE: Completely strip ALL hidden libvirt security keys
echo "==> Clearing all hidden libvirt security locks from ${GUEST_NAME}..."
for disk in ${TARGET_MNT}/*"${GUEST_NAME}"*.qcow2; do
    [ ! -f "$disk" ] && continue
    # This loops through and aggressively drops any trusted.libvirt keys frozen in the file metadata
    sudo getfattr -m "trusted.libvirt.security" --dump "$disk" 2>/dev/null | grep -oP '^trusted\.libvirt\.security\.[a-z_]+' | while read -r attr; do
        sudo setfattr -x "$attr" "$disk" 2>/dev/null || true
    done
done
 
# 4. TARGETED SECURITY REMAPPING: Process ONLY the targeted VM files
echo "==> Resetting permissions and SELinux contexts strictly for ${GUEST_NAME}..."
for disk in ${TARGET_MNT}/*"${GUEST_NAME}"*.qcow2; do
    [ ! -f "$disk" ] && continue
    sudo chown qemu:qemu "$disk"
    sudo chmod 600 "$disk"
 
    # Restore standard system-defined defaults so Libvirt can assign dynamic labels cleanly
    sudo restorecon -Fv "$disk"
done

 
# Restart systemd cgroup containment tracking profiles safely
sudo systemctl restart systemd-machined
sleep 2
 
# Re-activate the modular listener sockets
sudo systemctl start virtqemud.socket virtqemud-ro.socket virtqemud-admin.socket virtqemud.service
sleep 1
 
echo "=== PHASE 6: POWER ON RECOVERED GUEST ==="
# Verify if the domain state registry dropped during the socket tear-down
if sudo virsh list --all | grep -qw "${GUEST_NAME}"; then
    sudo virsh start ${GUEST_NAME}
else
    echo "==> Re-registering transient XML map for ${GUEST_NAME}..."
    sudo virsh define /etc/libvirt/qemu/"${GUEST_NAME}".xml 2>/dev/null || true
    sudo virsh start ${GUEST_NAME}
fi
 

 

 
 
 

Thursday, October 22, 2026

Thin XFS LVs provisioning and Libvirt hooks for State Isolated KVM Server on Debian forky

Following below is review/verification approach to Thin XFS LVs provisioning and Libvirt hooks proposed by Google AI. This post is an immediate follow up of  https://lxer.com/module/newswire/view/368300/index.html  . Regarding Debian forky OverlayFS BTRFS/XFS setup see https://lxer.com/module/newswire/view/368197/index.html                                                                                          

Version of /etc/libvirt/hooks/qemu for Debian 14 

root@debian14forky:~# cat /etc/libvirt/hooks/qemu
#!/bin/bash
GUEST_NAME="$1"
ACTION="$2"
PHASE="$3"
STORAGE_DIR="/var/lib/libvirt/images"
BACKUP_DIR="${STORAGE_DIR}/.snapshots_${GUEST_NAME}"

[ ! -d "$STORAGE_DIR" ] && exit 0

# --- State Changes Layer: Reflink Clones ---
if [ "$ACTION" = "prepare" ] || [ "$ACTION" = "stopped" ]; then
   # Fire off the automated LVM snapshot service asynchronously
   /usr/bin/systemctl start lvm-thin-snapshot.service &

   (
       /usr/bin/sleep 2
       /usr/bin/mkdir -p "$BACKUP_DIR"

       for disk_path in "${STORAGE_DIR}"/*"${GUEST_NAME}"*.qcow2; do
           [ ! -f "$disk_path" ] && continue
           disk_file=$(/usr/bin/basename "$disk_path")
           timestamp=$(/usr/bin/date +%Y%m%d_%H%M%S)

           # Atomic copy-on-write VFS creation
           /usr/bin/cp --reflink=always "$disk_path" "${BACKUP_DIR}/${disk_file}.snap_${timestamp}"
            
           # Align permissions with Debian virtual user accounts
           /usr/bin/chown libvirt-qemu:kvm "${BACKUP_DIR}/${disk_file}.snap_${timestamp}" 2>/dev/null
       done

       # Keep the last 5 operational states
       /usr/bin/ls -tp "${BACKUP_DIR}"/* | /usr/bin/grep -v '/$' | /usr/bin/tail -n +6 | /usr/bin/xargs -I {} /usr/bin/rm -- "{}" 2>/dev/null
   ) & disown

# --- Domain Mapping Tracking: Define/Undefine ---
elif [ "$ACTION" = "define" ] || [ "$ACTION" = "undefine" ]; then
   /usr/bin/systemctl start lvm-thin-snapshot.service &
fi

exit 0

root@debian14forky:~# cat /etc/systemd/system/lvm-thin-snapshot.service
[Unit]
Description=Rotate Pristine LVM Thin Pool Snapshot on Libvirt Changes
After=local-fs.target

[Service]
Type=oneshot
User=root
Environment=VG_NAME=vg_debian
Environment=SNAP_NAME=snap_working_vms
Environment=THIN_VOL=vol_debian_thin
Environment=IMG_DIR=/var/lib/libvirt/images

ExecStart=/bin/bash -c '\
   echo "Current allocated qcow2 image count: $(ls -1 ${IMG_DIR}/*.qcow2 2>/dev/null | wc -l)"; \
   echo "Removing old snapshot if present..."; \
   /usr/sbin/lvremove -f "${VG_NAME}/${SNAP_NAME}" 2>/dev/null || true; \
   echo "Creating pristine baseline snapshot..."; \
   /usr/sbin/lvcreate -s --name "${SNAP_NAME}" "${VG_NAME}/${THIN_VOL}"'

[Install]
WantedBy=multi-user.target

 
Version of Recovery from simulated disaster for Debian forky

root@debian14forky:~# cat ./virtSetup016_debian
#!/bin/bash
#=============================================================
# DEBIAN 14 PRODUCTION DISASTER RECOVERY ENGINE (SYNCHRONOUS FENCED)
#=============================================================
set -e

TARGET_MNT="/var/lib/libvirt/images"
VG_NAME="vg_debian"
THIN_VOL="vol_debian_thin"
SNAP_NAME="snap_working_vms"
GUEST_NAME="ArchPlasma" # Toggle to "ArchPlasma" when testing the other VM

echo "=== PHASE 1: RE-ARM IMMUNE STORAGE MATRIX BASELINE ==="
# Forcefully clear stale snapshots and index the current healthy file footprint
sudo lvremove -f ${VG_NAME}/${SNAP_NAME} 2>/dev/null || true
sudo lvcreate -s --name ${SNAP_NAME} ${VG_NAME}/${THIN_VOL}
sudo lvs ${VG_NAME}

echo "=== PHASE 2: CATASTROPHIC DISASTER SIMULATION ==="
sudo virsh destroy ${GUEST_NAME} 2>/dev/null || true

# Hook check loop: wait for the asynchronous VFS reflink lifecycle copy to finish
echo "==> Waiting for hook script background backup copy to complete..."
while pgrep -f "cp --reflink=always" >/dev/null || systemctl is-active --quiet lvm-thin-snapshot.service; do
   echo "    [WAIT] Hook script is actively saving safety copies. Stalling 2 seconds..."
   sleep 2
done
echo "==> Hook script finished! Storage layer is quiet."

# Catastrophically corrupt the target virtual disk image with random blocks
sudo dd if=/dev/urandom of=${TARGET_MNT}/${GUEST_NAME}.qcow2 bs=1M count=500 conv=notrunc

echo "=== PHASE 3: SYNCHRONOUS WAIT-FOR-EXIT CODE FENCE ==="
# Sever the monolithic hypervisor interfaces and persistent socket networks
sudo systemctl stop libvirtd.socket libvirtd-ro.socket libvirtd-admin.socket libvirtd.service 2>/dev/null || true
sudo pkill -9 qemu 2>/dev/null || true
sudo fuser -kM "${TARGET_MNT}" 2>/dev/null || true

echo "==> Initiating standard physical unmount loop..."
COUNTER=1
while [ $COUNTER -le 20 ]; do
   echo "    [TRY $COUNTER/20] Testing standard umount..."
   if sudo umount ${TARGET_MNT} 2>/dev/null; then
       echo "==> SUCCESS: Filesystem detached cleanly with exit code 0."
       break
   fi
   echo "    [WAIT] Kernel block maps busy. Stalling 3 seconds for clean flush..."
   sleep 3
   COUNTER=$((COUNTER + 1))
done


if [ $COUNTER -gt 20 ]; then
   echo "ERROR: Kernel refused to release filesystem within 60 seconds. Aborting."
   exit 1
fi

echo "=== PHASE 4: ATOMIC METADATA MERGE ==="
# Because the mount is completely dead, this block merge commits instantly
sudo lvconvert --merge ${VG_NAME}/${SNAP_NAME}

echo "=== PHASE 5: PURGE VOLATILE DESCRIPTORS & RE-ALIGN SECURITY ==="
sudo mount ${TARGET_MNT}

# Clear any deadlocked lock templates and volatile state trackers
sudo rm -f ${TARGET_MNT}/*.lock 2>/dev/null
sudo rm -rf /var/run/libvirt/qemu/* 2>/dev/null
sudo rm -rf /var/cache/libvirt/qemu/* 2>/dev/null

# Re-align user attributes explicitly to Debian's privilege accounts
sudo chown libvirt-qemu:kvm ${TARGET_MNT}/${GUEST_NAME}.qcow2
sudo chmod 600 ${TARGET_MNT}/${GUEST_NAME}.qcow2

# TEMPORARY SECURITY OVERRULE: Bypass stale DAC memory cache issues on ignition
sudo virsh dumpxml ${GUEST_NAME} > /tmp/${GUEST_NAME}_recovery.xml 2>/dev/null || true
if ! grep -q 'seclabel type="none"' /tmp/${GUEST_NAME}_recovery.xml 2>/dev/null; then
   sed -i '/<\/devices>/a \  <seclabel type="none" model="dac"\/>' /tmp/${GUEST_NAME}_recovery.xml 2>/dev/null || true
   sudo virsh undefine ${GUEST_NAME} 2>/dev/null || true
   sudo virsh define /tmp/${GUEST_NAME}_recovery.xml >/dev/null 2>&1 || true
fi
rm -f /tmp/${GUEST_NAME}_recovery.xml

# Restart systemd cgroups and restore daemon listen layers
sudo systemctl restart systemd-machined
sudo systemctl start libvirtd.socket libvirtd-ro.socket libvirtd-admin.socket libvirtd.service

echo "=== PHASE 6: POWER ON RECOVERED GUEST ==="
sudo virsh start ${GUEST_NAME}
echo "==========================================="
sudo virsh list --all


 

Monday, October 19, 2026

Thin XFS LVs provisioning and Libvirt hooks for State Isolated KVM Server on openSUSE Tumbleweed

UPDATE as of 10/21/26  

Please, see  update at the bottom of original post, which allows to avoid in recreating of "snap_working_vms" at user's side 

See also Thin XFS LVs provisioning and Libvirt hooks for State Isolated KVM Server on Debian forky  

END UPDATE 

Following below is review/verification approach to Thin XFS LVs provisioning and Libvirt hooks proposed by Google AI. In case of openSUSE Tumbleweed YaST Installer requires minimal manual CLI intervention due to GUI interface enables thin pools and thin LVs . In case Debian 14 network installation you have an option to associate vg_debian group with physical volume. All command stack is supposed to be executed manually upon instance reboot. 

   Yast Installer and Debian Installer behaves the same way in VENV and on bare metal performing relatively complicated BTRFS/XFS partitioning schema pretty stable. In case of Debian forky OverlayFS BTRFS/XFS setup is required ( see https://lxer.com/module/newswire/view/368197/index.html ). On openSUSE Tumbleweed you are protected by Enterprise grade BTRFS implementation (sudo snapper rollback safe-ID) 

Final disk layout



==============================================
Actually, YaST installer in GUI mode executes
==============================================
# Initialize the partition for LVM ingestion
sudo pvcreate --metadatasize 500M /dev/nvme0n1p3
 
# Instantiate your dedicated vg_suse Volume Group container
sudo vgcreate vg_suse /dev/nvme0n1p3
 
# Carve out a 180G (for instance) Thin Pool reservoir tracking array
sudo lvcreate -L 180G --thinpool tp_suse_kvm vg_suse
 
# Slice out the final Thin Volume utilizing the full pool size
sudo lvcreate -V 180G --name vol_suse_thin --thinpool vg_suse/tp_suse_kvm
You may also decouple @qemu subvolume mounted @/etc/libvirt/qemu in YaST installer partitioning phase via embedded GUI interface.
===================================================
Vol_suse_thin shouldn't be formatted and mounted
Upon reboot to Tumbleweed instance to run manually
===================================================
# Format the thin volume enabling fast VFS-level copy-on-write pointer sharing
sudo mkfs.xfs -K -m reflink=1,crc=1 /dev/vg_suse/vol_suse_thin
 
# Purge the old physical device configuration lines from your system map
sudo sed -i '\/opt/d' /etc/fstab
 
# Append your optimized thin block map permanently into the layout tables
echo '/dev/vg_suse/vol_suse_thin   /opt   xfs defaults,noatime,logbufs=8,logbsize=256k 0 0' | sudo tee -a /etc/fstab
 
# Rebuild systemd configuration targets and mount the new thin pool volume
sudo systemctl daemon-reload
sudo mount -a
 
===================================================
Debian Network installer in GUI mode executes only
===================================================
# Instantiate your dedicated vg_debian Volume Group container
sudo vgcreate vg_suse /dev/nvme0n1p3
# Initialize the partition for LVM ingestion
sudo pvcreate --metadatasize 500M /dev/nvme0n1p3
# Instantiate your dedicated vg_deabin Volume Group container
sudo vgcreate vg_debian /dev/nvme0n1p3
 
The rest CLI stack of commands remains your responsibility
upon reboot
=================================================
When KVM Hypervisor is installed on Tumbleweed ( Debain forky) You are supposed to create Libvirt hook
=================================================
# cat /etc/libvirt/hooks/qemu
#!/bin/bash
GUEST_NAME="$1"
ACTION="$2"
PHASE="$3"
STORAGE_DIR="/opt/libvirt/images"
BACKUP_DIR="${STORAGE_DIR}/.snapshots_${GUEST_NAME}"
 
[ ! -d "$STORAGE_DIR" ] && exit 0
 
if [ "$ACTION" = "prepare" ] || [ "$ACTION" = "stopped" ]; then
   (
       /usr/bin/sleep 2
       /usr/bin/mkdir -p "$BACKUP_DIR"
 
       for disk_path in "${STORAGE_DIR}"/*"${GUEST_NAME}"*.qcow2; do
           [ ! -f "$disk_path" ] && continue
           disk_file=$(/usr/bin/basename "$disk_path")
           timestamp=$(/usr/bin/date +%Y%m%d_%H%M%S)
 
           # Atomic VFS copy-on-write pointer creation
           /usr/bin/cp --reflink=always "$disk_path" "${BACKUP_DIR}/${disk_file}.snap_${timesta
mp}"
           /usr/bin/chown qemu:qemu "${BACKUP_DIR}/${disk_file}.snap_${timestamp}" 2>/dev/null
       done
 
       # Prune older operational states, retaining the last 5 configurations
       /usr/bin/ls -tp "${BACKUP_DIR}"/* | /usr/bin/grep -v '/$' | /usr/bin/tail -n +6 | /usr/bin/xargs -I {} /usr/bin/rm -- "{}" 2>/dev/null
   ) & disown
fi
exit 0
===================================
Expected disklayout on both systems
===================================
boris@fedoraServer091026:~$ ssh boris@192.168.0.30
(boris@192.168.0.30) Password:
Last login: Mon Oct 19 18:04:57 MSK 2026 on tty2
Have a lot of fun...
boris@localhost:~> lsblk -f
NAME                            FSTYPE      FSVER    LABEL UUID                                   FSAVAIL FSUSE% MOUNTPOINTS
sr0
vda
├─vda1                          vfat        FAT32          C7FA-229F                               406.3M    20% /boot/efi
├─vda2                          ext4        1.0            ce25d513-c727-41fc-b3d7-d65454842064      1.7G     4% /boot
├─vda3                          LVM2_member LVM2 001       QtA4KW-Basj-r1MV-rGny-gDMX-pFzK-WbtgvK
│ ├─vg_suse-tp_suse_kvm_tmeta
│ │ └─vg_suse-tp_suse_kvm-tpool
│ │   ├─vg_suse-tp_suse_kvm
│ │   └─vg_suse-vol_suse_thin   xfs                        c43d95f3-5e09-46d8-b14a-1790879a27fd     65.4G     9% /opt
│ └─vg_suse-tp_suse_kvm_tdata
│   └─vg_suse-tp_suse_kvm-tpool
│     ├─vg_suse-tp_suse_kvm
│     └─vg_suse-vol_suse_thin   xfs                        c43d95f3-5e09-46d8-b14a-1790879a27fd     65.4G     9% /opt
└─vda4                          btrfs                      59c74873-c215-4123-9212-d7242087e5e9     39.7G    18% /usr/local
                                                                                                                 /srv
                                                                                                                 /var
                                                                                                                 /home
                                                                                                                 /root
                                                                                                                 /etc/libvirt/qemu
                                                                                                                 /.snapshots
                                                                                                                 /
=======================================================
Recovery from emulated qcow2 corruption in libvirt-pool. Default libvirt-pool location is /opt/libvirt/images on thin XFS LV. That is due to limitation of YaST installer.  Debian 14 network installer allows you to mount /var/lib/libvirt/images on thin XFS LV in post installation phase prior of KVM Hypervisor setup.
=======================================================
localhost:~ # cat ArchServerRecovery.sh
#!/bin/bash
set -Eeuo pipefail
 
# Configuration Matrix
VM_NAME="ArchServer"
DISK_PATH="/opt/libvirt/images/ArchServer.qcow2"
VG_NAME="vg_suse"
SNAP_NAME="snap_working_vms"
THIN_VOL="vol_suse_thin"
 
echo "=== PHASE 1: PREPARING CLEAN ENVIRONMENT ==="
echo "Stopping ${VM_NAME}..."
sudo virsh shutdown "$VM_NAME"
 
echo "Waiting for VM to fully power off and release file locks..."
while [ "$(sudo virsh domstate "$VM_NAME" | tr -d '\r\n ')" != "shutoff" ]; do
    sleep 1
done
 
echo "Removing old snapshot if present..."
sudo lvremove -f "${VG_NAME}/${SNAP_NAME}" 2>/dev/null || true
 
echo "Creating pristine baseline snapshot..."
sudo lvcreate -s --name "$SNAP_NAME" "${VG_NAME}/${THIN_VOL}"
sudo lvs "$VG_NAME"
 
echo -e "\n=== PHASE 2: SIMULATING DATA DESTRUCTION DRILL ==="
echo "Injecting 500MB of pure entropy into the qcow2 block architecture..."
sudo dd if=/dev/urandom of="$DISK_PATH" bs=1M count=500 conv=notrunc
sync
 
echo -e "\n=== PHASE 3: OFFLINE BLOCK STORAGE OVERHAUL ==="
echo "Stopping virtualization stack mechanisms..."
sudo systemctl stop virtqemud.service virtqemud.socket
sudo pkill -9 qemu 2>/dev/null || true
 
echo "Unmounting XFS target disk layer..."
sudo umount /opt
 
echo "Executing LVM thin snapshot rollback merge..."
sudo lvconvert --merge "${VG_NAME}/${SNAP_NAME}"
 
echo "Remounting pristine block matrix onto /opt..."
sudo mount /opt
 
echo -e "\n=== PHASE 4: DISK INTEGRITY VERIFICATION ==="
echo "Running validation checks on ${DISK_PATH}..."
 
# Run qemu-img check and capture internal report
if sudo qemu-img check "$DISK_PATH"; then
    echo "вњ… Success: LVM snapshot merge validated. Image is 100% clean."
else
    echo "CRITICAL: Integrity check failed! The disk image remains corrupted." >&2
    exit 1
fi
 
echo -e "\n=== PHASE 5: RUNTIME RESTORATION ==="
echo "Purging leftover runtime lock infrastructure files..."
sudo rm -f /opt/libvirt/images/*.lock 2>/dev/null || true
sudo rm -f /var/run/libvirt/qemu/*.xml 2>/dev/null || true
 
echo "Restarting containment profiling layers..."
sudo systemctl restart systemd-machined
sudo systemctl start virtqemud.socket virtqemud.service
 
echo "Powering on recovered virtual guest domain..."
sudo virsh start "$VM_NAME"
echo "=== DISASTER RECOVERY DRILL COMPLETE ==="

UPDATE as of 10/21/16 

localhost:~ # cat /etc/libvirt/hooks/qemu
#!/bin/bash
GUEST_NAME="$1"
ACTION="$2"
PHASE="$3"
STORAGE_DIR="/opt/libvirt/images"
BACKUP_DIR="${STORAGE_DIR}/.snapshots_${GUEST_NAME}"

[ ! -d "$STORAGE_DIR" ] && exit 0

# --- EXISTING LOGIC: Operational reflink snapshots on state changes ---
if [ "$ACTION" = "prepare" ] || [ "$ACTION" = "stopped" ]; then
    # 🔥 FIX FOR VIRT-MANAGER: Trigger snapshot service for GUI transitions too
    /usr/bin/systemctl start lvm-thin-snapshot.service &

    (
        /usr/bin/sleep 2
        /usr/bin/mkdir -p "$BACKUP_DIR"

        for disk_path in "${STORAGE_DIR}"/*"${GUEST_NAME}"*.qcow2; do
            [ ! -f "$disk_path" ] && continue
            disk_file=$(/usr/bin/basename "$disk_path")
            timestamp=$(/usr/bin/date +%Y%m%d_%H%M%S)

            # Atomic VFS copy-on-write pointer creation
            /usr/bin/cp --reflink=always "$disk_path" "${BACKUP_DIR}/${disk_file}.snap_${timestamp}"
            /usr/bin/chown qemu:qemu "${BACKUP_DIR}/${disk_file}.snap_${timestamp}" 2>/dev/null
        done

        # Prune older operational states, retaining the last 5 configurations
        /usr/bin/ls -tp "${BACKUP_DIR}"/* | /usr/bin/grep -v '/$' | /usr/bin/tail -n +6 | /usr/bin/xargs -I {} /usr/bin/rm -- "{}" 2>/dev/null
    ) & disown

# --- NEW LAYER: Handle LVM Thin Snapshot baseline shifts on VM creation/deletion ---
elif [ "$ACTION" = "define" ] || [ "$ACTION" = "undefine" ]; then
    # Fire off the systemd service asynchronously so libvirt loop is never locked
    /usr/bin/systemctl start lvm-thin-snapshot.service &
fi

exit 0
localhost:~ # cat /etc/systemd/system/lvm-thin-snapshot.service
[Unit]
Description=Rotate Pristine LVM Thin Pool Snapshot on Libvirt Changes
After=local-fs.target

[Service]
Type=oneshot
User=root
Environment=VG_NAME=vg_suse
Environment=SNAP_NAME=snap_working_vms
Environment=THIN_VOL=vol_suse_thin
Environment=IMG_DIR=/opt/libvirt/images

ExecStart=/bin/bash -c '\
    echo "Current allocated qcow2 image count: $(ls -1 ${IMG_DIR}/*.qcow2 2>/dev/null | wc -l)"; \
    echo "Removing old snapshot if present..."; \
    /usr/sbin/lvremove -f "${VG_NAME}/${SNAP_NAME}" 2>/dev/null || true; \
    echo "Creating pristine baseline snapshot..."; \
    /usr/sbin/lvcreate -s --name "${SNAP_NAME}" "${VG_NAME}/${THIN_VOL}"'

[Install]
WantedBy=multi-user.target

 

Thursday, October 15, 2026

Debian forky OverlayFS BTRFS/XFS setup

Combining OverlayFS with a Btrfs layout on Debian Forky unlocks powerful advantages that Btrfs subvolumes and snapshots cannot achieve alone. While Btrfs handles structural versioning, snapshots, and data safety at the block/filesystem level, OverlayFS operates at the VFS layer to handle dynamic, temporary, or isolated runtime modifications. 

One more option provided is recovery main instance via booting into Overlay instance using Grub Submenu. By explicitly mounting the top-level Btrfs volume (subvolid=5) into a temporary directory like /mnt, you step outside the overlay's jurisdiction. This allows the kernel to recognize the true Btrfs layout and perform instant atomic subvolume swaps.
sudo mount -o subvolid=5   /dev/vda4   /mnt
sudo btrfs subvolume list   /mnt/@
sudo mv   /mnt/@   /mnt/@_broken
sudo btrfs subvolume   snapshot    /mnt/@snapshots/required-ID/snapshot      /mnt/@
sudo btrfs subvolume   delete   /mnt/@_broken 

Final instance btrfs/xfs  layout
boris@Debian1510:~$ hostnamectl
 Static hostname: Debian1510
       Icon name: computer-vm
         Chassis: vm 💽
      Machine ID: edf88060aa784d0f9b7f14b3c6d1a8c1
         Boot ID: e2264038aeb4455f99e854dab9d16b17
  Virtualization: kvm
Operating System: Debian GNU/Linux forky/sid
          Kernel: Linux 7.2.9+deb14-amd64
    Architecture: x86-64
 Hardware Vendor: QEMU
  Hardware Model: Standard PC _Q35 + ICH9, 2009_
Hardware Version: pc-q35-11.1
Firmware Version: edk2-20260812-9.fc45
   Firmware Date: Wed 2026-08-12
    Firmware Age: 2month 3d


boris@Debian1510:~$ findmnt -t btrfs
TARGET        SOURCE                 FSTYPE OPTIONS
/             /dev/vda4[/@]          btrfs  rw,noatime,compress=zstd:3,discard=async,space_cache=v2,subvolid=257,subvol=/@
├─/.snapshots /dev/vda4[/@snapshots] btrfs  rw,noatime,compress=zstd:3,discard=async,space_cache=v2,subvolid=258,subvol=/@snapshots
├─/home       /dev/vda4[/@home]      btrfs  rw,noatime,compress=zstd:3,discard=async,space_cache=v2,subvolid=259,subvol=/@home
├─/var/cache  /dev/vda4[/@cache]     btrfs  rw,noatime,compress=zstd:3,discard=async,space_cache=v2,subvolid=260,subvol=/@cache
└─/var/log    /dev/vda4[/@log]       btrfs  rw,noatime,compress=zstd:3,discard=async,space_cache=v2,subvolid=261,subvol=/@log
boris@Debian1510:~$ lsblk -f
NAME   FSTYPE FSVER LABEL UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
sr0
vda
├─vda1 vfat   FAT32       D643-B66B                              68.2M    12% /boot/efi
├─vda2 ext4   1.0         c8860b5b-e657-4ff2-acdb-e2a08947a7b5    1.6G     3% /boot
├─vda3 xfs                41565303-cab9-4cb6-9f9c-5ec5d8acbc0e   42.9G     2% /opt
└─vda4 btrfs              75028dc8-40ef-4c97-8944-d8850c1ee107   42.8G    13% /var/log
                                                                              /var/cache
                                                                              /home
                                                                              /.snapshots
                                                                              /
 

###################################################
On clean Debian forky KVM Guest proceed as follows
###################################################
sudo apt install inotify-tools gawk git build-essential snapper -y

1.Switch @rootfs to @ ( standard names convention)

mkdir -p /mnt/btrfs_root
mount -o subvolid=5 /dev/vda4 /mnt/btrfs_root
mkdir -p /mnt/btrfs_root/btrfs_base
btrfs subvolume snapshot /mnt/btrfs_root/@rootfs  /mnt/btrfs_root/btrfs_base/@
mv /mnt/btrfs_root/btrfs_base/@  /mnt/btrfs_root/@
rmdir /mnt/btrfs_root/btrfs_base
umount /mnt/btrfs_root
mkdir -p /mnt/system-root
mount -o subvol=@ /dev/vda4 /mnt/system-root
mount /dev/vda2 /mnt/system-root/boot
mount /dev/vda1 /mnt/system-root/boot/efi
for i in /dev /dev/pts /proc /sys /run; do mount -B $i /mnt/system-root$i; done
##########
Next step
##########
chroot /mnt/system-root /bin/bash
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=debian --recheck
grub-install --target=x86_64-efi --efi-directory=/boot/efi --removable
update-initramfs -u -k all
update-grub
exit
#########################
Upon exiting from chroot
#########################
for i in /run /sys /proc /dev/pts /dev; do umount /mnt/system-root$i; done
umount /mnt/system-root/boot/efi
umount /mnt/system-root/boot
sed -i 's/rootflags=subvol=@rootfs/rootflags=subvol=@/g' /boot/grub/grub.cfg


#############################################
Update /mnt/system-root/etc/fstab as follows
#############################################
Remove old entry and replace with
UUID=
75028dc8-40ef-4c97-8944-d8850c1ee107 / btrfs   defaults,subvol=@,compress=zstd,noatime   0       1
:wq
########
systemctl daemon-reload
mount -a
##########
System reboot


#######################################################
Log into instance back and create subvolumes per standard schema
#######################################################
findmnt -t btrfs
update-grub
mkdir -p /mnt/btrfs_base
mount -o subvolid=5 /dev/vda4 /mnt/btrfs_base
btrfs subvolume create /mnt/btrfs_base/@snapshots
btrfs subvolume create /mnt/btrfs_base/@home
btrfs subvolume create /mnt/btrfs_base/@cache
btrfs subvolume create /mnt/btrfs_base/@log
###########
Next step
###########
snapper -c root create-config /
btrfs subvolume delete /.snapshots
mkdir /.snapshots
##########################
Backup user's home folder
##########################
tar -czf boris.tar.gz boris
cp boris.tar.gz  /tmp
btrfs subvolume list /


###############################
Update /etc/fstab as follows
###############################
UUID=75028dc8-40ef-4c97-8944-d8850c1ee107 /              btrfs   defaults,subvol=@,compress=zstd,noatime   0       1
UUID=75028dc8-40ef-4c97-8944-d8850c1ee107 /home          btrfs   defaults,subvol=@home,compress=zstd,noatime   0       1
UUID=75028dc8-40ef-4c97-8944-d8850c1ee107 /var/cache     btrfs   defaults,subvol=@cache,compress=zstd,noatime   0       1
UUID=75028dc8-40ef-4c97-8944-d8850c1ee107 /var/log       btrfs   defaults,subvol=@log,compress=zstd,noatime   0       1
UUID=75028dc8-40ef-4c97-8944-d8850c1ee107 /.snapshots    btrfs   subvol=@snapshots,compress=zstd,noatime   0       0
# /boot was on /dev/vda2 during installation
UUID=c8860b5b-e657-4ff2-acdb-e2a08947a7b5 /boot           ext4    defaults        0       2
# /boot/efi was on /dev/vda1 during installation
UUID=D643-B66B  /boot/efi       vfat    umask=0077      0       1
# /opt was on /dev/vda3 during installation
UUID=41565303-cab9-4cb6-9f9c-5ec5d8acbc0e /opt            xfs     defaults        0       0
/dev/sr0        /media/cdrom0   udf,iso9660 user,noauto     0       0
:wq
##########################
/etc/fstab verification
##########################
systemctl daemon-reload
mount -a


##########################
findmnt -t btrfs
cd /home
cp /tmp/*.tar.gz .
tar -xzf boris.tar.gz
#################
sudo chmod 750 /.snapshots
sudo umount /mnt/btrfs_base
sudo snapper -c root create --description "First baseline snapshot"


#################
System reboot
#################
$ sudo apt update
$ sudo apt install inotify-tools gawk git build-essential -y
$ git clone https://github.com/Antynea/grub-btrfs.git
$ cd grub-btrfs
$ sudo make install


###########################################
Make sure grub-btrfsd.service is correct
###########################################
$ sudo systemctl edit --full grub-btrfsd.service
$ sudo systemctl daemon-reload
$ sudo systemctl enable --now grub-btrfsd.service
$ sudo update-grub
$ sudo reboot


############ Overlay Setup ############
We need to swap out Debian's default initramfs-tools and replace it with Dracut, which natively understands the Fedora-style live overlay parameters.
$ sudo apt update
$ sudo apt install dracut dracut-core -y
########################################
Inject the working parameters exclusively into the Snapshot Configuration
$ sudo nano /etc/default/grub-btrfs/config
GRUB_BTRFS_SNAPSHOT_KERNEL_PARAMETERS="'rd.live.overlay.overlayfs=1 rw'"

########################################
Force Dracut to re-build your active kernel images with overlay modules enabled
########################################
$ echo 'add_dracutmodules+=" overlayfs "' | sudo tee /etc/dracut.conf.d/overlayfs.conf
$ sudo dracut -H --hostonly-mode=sloppy --add overlayfs --force
$ sudo /etc/grub.d/41_snapshots-btrfs
#######################################
Finalize and update your master GRUB boot menu layout
$ sudo update-grub
#######################################


Overlay instance layout
############################
boris@Debian1510:~$ hostnamectl
 Static hostname: Debian1510
       Icon name: computer-vm
         Chassis: vm 💽
      Machine ID: edf88060aa784d0f9b7f14b3c6d1a8c1
         Boot ID: 8874785955e746679ce2d24ae4e5a257
  Virtualization: kvm
Operating System: Debian GNU/Linux forky/sid
          Kernel: Linux 7.2.9+deb14-amd64
    Architecture: x86-64
 Hardware Vendor: QEMU
  Hardware Model: Standard PC _Q35 + ICH9, 2009_
Hardware Version: pc-q35-11.1
Firmware Version: edk2-20260812-9.fc45
   Firmware Date: Wed 2026-08-12
    Firmware Age: 2month 3d


boris@Debian1510:~$ findmnt -t btrfs
TARGET          SOURCE                       FSTYPE OPTIONS
/run/rootfsbase /dev/vda4[/@snapshots/14/snapshot]
                                             btrfs  ro,noatime,compress=zstd:3,discard=async,space_cache=v2,subvolid=276,subvol=/
@snapshots/14/sn
/.snapshots     /dev/vda4[/@snapshots]       btrfs  rw,noatime,compress=zstd:3,discard=async,space_cache=v2,subvolid=258,subvol=/@snapshots
/home           /dev/vda4[/@home]            btrfs  rw,noatime,compress=zstd:3,discard=async,space_cache=v2,subvolid=259,subvol=/@home
/var/cache      /dev/vda4[/@cache]           btrfs  rw,noatime,compress=zstd:3,discard=async,space_cache=v2,subvolid=260,subvol=/@cache
/var/log        /dev/vda4[/@log]             btrfs  rw,noatime,compress=zstd:3,discard=async,space_cache=v2,subvolid=261,subvol=/@log
boris@Debian1510:~$ mount|grep 'on / '
LiveOS_rootfs on / type overlay (rw,relatime,lowerdir=/run/rootfsbase,upperdir=/run/overlayfs,workdir=/run/ovlwork,uuid=on)

 
boris@Debian1510:~$ lsblk -f
NAME   FSTYPE FSVER LABEL UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
sr0
vda
├─vda1 vfat   FAT32       D643-B66B                              68.2M    12% /boot/efi
├─vda2 ext4   1.0         c8860b5b-e657-4ff2-acdb-e2a08947a7b5    1.6G     3% /boot
├─vda3 xfs                41565303-cab9-4cb6-9f9c-5ec5d8acbc0e   42.9G     2% /opt
└─vda4 btrfs              75028dc8-40ef-4c97-8944-d8850c1ee107   42.8G    13% /var/log
                                                                              /var/cache
                                                                              /home
                                                                              /.snapshots
                                                                              /run/rootfsbase