CLI methods for rescuing a corrupted Btrfs filesystem on Fedora¶
Tested on: Fedora 44 KDE Plasma
Scenario 1: You can reach a TTY / Command Line Terminal¶
If your system boots to a black screen, terminal prompt, or you can press Ctrl + Alt + F3 to reach a login prompt:
Method A: Quick Snapper Rollback (If Snapper is functional)¶
- Log in with your username and password.
- List available snapshots:
- Roll back to a snapshot number created before the issue occurred (e.g., #2):
- Reboot your system:
Scenario 2: System Won't Boot at All (Using a Fedora Live USB)¶
If an update completely broke the bootloader or kernel, boot into a Fedora Live USB and restore the root snapshot directly from your 1TB secondary drive (/mnt/storage/btrfs-backups/).
1. Boot Fedora Live USB & Open Terminal¶
Identify primary and secondary NVMe partitions.
- Insert your Fedora Live USB drive and boot into it.
- Open the terminal.
- Identify your drive partitions using
lsblk: - Primary 500GB SSD:
/dev/nvme0n1p3(or similar main Btrfs partition). - Secondary 1TB SSD:
/dev/nvme1n1p1(contains yourbtrfs-backupsfolder).
2. Mount Primary and Secondary Drives¶
Mount subvolid=5 to access top-level Btrfs structure. Create temporary mount points and mount both drives:
# Mount top-level root of your primary 500GB drive
sudo mkdir -p /mnt/primary
sudo mount -o subvolid=5 /dev/nvme0n1p3 /mnt/primary
# Mount your 1TB backup drive
sudo mkdir -p /mnt/backup
sudo mount /dev/nvme1n1p1 /mnt/backup
3. Move Broken Root Subvolume¶
Preserve the broken subvolume just in case. In Fedora Btrfs, your active operating system lives in a subvolume named root. Rename it out of the way:
4. Send Backup from 1TB SSD to Primary SSD¶
Stream the backup from the 1TB drive back to the 500GB primary drive.
- List the backups stored on your 1TB drive to find the timestamp you want to restore:
- Send and receive the snapshot (replace
ROOT.20260813T1431with your actual backup folder name):
5. Rename Subvolume & Enable Write Access¶
Make the restored snapshot active and writable.
- Rename the transferred snapshot back to
root:
- Backups transferred via
btrfs send/receiveare marked read-only. Remove the read-only flag so Fedora can boot and write to it normally:
6. Clean Up & Reboot¶
Unmount clean and restart. Unmount the partitions and reboot back into your restored OS:
Post-Recovery Cleanup¶
Once you successfully log back into Fedora:
- You can safely delete the broken root directory leftover from the recovery step:
- Run
sudo btrbk runto create a fresh baseline snapshot on your 1TB drive.