Diagnosing and Fixing Btrfs Snapshot Failures on AlmaLinux 9
When AlmaLinux 9 fails to create or restore a Btrfs snapshot, a diagnostic checklist can pinpoint the culprit—corrupted metadata, space shortages, wrong mount options, kernel mismatches, or duplicate names. Follow the ordered checks, apply the targeted fixes, and know when to seek escalation.
08 Dec 2025, 17:25 UTC

Recognizable Condition
When you try to create or restore a Btrfs snapshot on AlmaLinux 9 and receive an error such as error code 5 or the mount reports Btrfs: filesystem is read‑only, you’re likely dealing with a snapshot‑related issue. These symptoms can stem from corrupted metadata, insufficient space, wrong mount options, kernel mismatches, or duplicate names.
Common Causes and Quick Diagnostics
| Cause | Diagnostic Indicator |
|---|---|
| Corrupted metadata | btrfs check reports errors; dmesg | grep btrfs shows “Btrfs: failed to read metadata” |
| Insufficient space on underlying device | Mount fails with “Btrfs: filesystem is read‑only” or btrfs filesystem df shows unused space < 1 MiB |
Wrong mount options (missing subvol=) | Snapshot not visible in btrfs subvolume list; /etc/fstab lacks correct subvol= entry |
| Kernel/driver mismatch | Recent dmesg entries contain Btrfs: unsupported feature or unknown inode type |
| Duplicate snapshot name | Creation command returns “snapshot already exists” or btrfs subvolume list shows duplicate names |
Ordered Diagnostic Checklist
- Verify filesystem and subvolume list
Run
to confirm the device is recognized and to list all subvolumes.sudo btrfs filesystem show - Inspect recent kernel logs
Execute
. Look for error messages that point to metadata or driver problems.dmesg | grep -i btrfs - Check free space on the filesystem
Use
. Ensure there is at least 10 MiB of free space for snapshot operations.sudo btrfs filesystem df /mnt/btrfs - Confirm mount options
Open/etc/fstabor the relevant.mountunit and verify thesubvol=option points to the intended snapshot or root subvolume. - List subvolumes to see if snapshot exists
Run
. The snapshot should appear with its correct name.sudo btrfs subvolume list /mnt/btrfs - Run an offline integrity check if errors were found
Ifbtrfs checkreported problems, unmount the filesystem (sudo umount /mnt/btrfs) and run
wheresudo btrfs check --repair /dev/sdX/dev/sdXis the device containing the Btrfs volume.
Fixes Tied to Findings
- Corrupted metadata – After
btrfs check --repair, reboot and verify withbtrfs filesystem showthat the subvolumes list is intact. - Insufficient space – Extend the underlying LVM logical volume or move the snapshot to a different subvolume with more free space.
- Wrong mount options – Edit
/etc/fstabto includesubvol=/@(or the appropriate path) and run
or reboot.sudo systemctl daemon-reload sudo systemctl restart local-fs.target - Kernel/driver mismatch – Upgrade to a kernel that fully supports Btrfs snapshotting (e.g., 6.6 or later). Verify with
uname -randcat /proc/filesystems | grep btrfs. - Duplicate snapshot name – Delete or rename the conflicting snapshot:
and then recreate the new one.sudo btrfs subvolume delete /mnt/btrfs/old_snapshot
Escalation Criteria
If you exhaust the checklist and still see persistent btrfs check errors, kernel panics during Btrfs operations, or data loss in critical directories, consider escalating to:
- AlmaLinux support forums or mailing lists for kernel‑specific bugs.
- Hardware support if SMART tests reveal disk errors.
- Professional data recovery services if the filesystem integrity is compromised.
Practical Verification
After applying a fix, confirm success by:
- Re‑running
btrfs filesystem showto ensure the snapshot appears. - Mounting the snapshot explicitly:
and verifying file contents.sudo mount -o subvol=mysnap /dev/sdX /mnt/tmp - Checking
dmesgfor any lingering Btrfs warnings.
Limitations and Precautions
- All commands assume AlmaLinux 9 with kernel 6.6 or later. Earlier kernels may lack full snapshot support.
- Running
btrfs check --repairon a mounted filesystem is unsafe and can cause data loss. Always unmount or use a live environment. - Changes to
/etc/fstabrequire a reboot or a full reload of systemd units to take effect. - Duplicate snapshot names are case‑sensitive; ensure uniqueness per subvolume.
- Disk health issues (e.g., SMART errors) can masquerade as Btrfs problems; run
smartctl -a /dev/sdXbefore repair.
Example: Correcting a Missing subvol= Option
Suppose the snapshot daily-20241019 was created but is not visible because the mount points to the root subvolume. The fstab entry might look like:
/dev/sda1 /btrfs btrfs defaults,errors=remount-ro 0 0
To mount the snapshot, edit /etc/fstab to:
/dev/sda1 /btrfs btrfs defaults,subvol=daily-20241019,errors=remount-ro 0 0
Then reload systemd and restart the mount:
sudo systemctl daemon-reload
sudo systemctl restart local-fs.target
Verify with mount | grep /btrfs that the snapshot is active.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.