Lost BTRFS Partition after system freeze - recoverable?
Posted: 09 Mar 2025, 19:27
Hello,
I use encrypted BTRFS root on my Linux Notebook (cryptsetup). Yesterday the system suddenly froze, no chance to recover the system without a hard reset. After turning it off and on, the following error occurred:
Followed by an emergency shell. I did not accidentally overwrite parts of the disk nor something that produced heavy disk load. The system just crashed and killed the filesystem.
After doing some research, I tried the following commands:
So, it seems that the partition is completely dead, except the `dump-super --force` part, which clearly shows that BTRFS Partition is in there. `smartctl` did not show any errors. I have no idea how this could have happened, any advice, e.g. using testdisk to recover the partition?
Best,
sandreas
I use encrypted BTRFS root on my Linux Notebook (cryptsetup). Yesterday the system suddenly froze, no chance to recover the system without a hard reset. After turning it off and on, the following error occurred:
Code: Select all
No valid Btrfs found on /dev/mapper/root
ERROR: cannot open file system
After doing some research, I tried the following commands:
Code: Select all
# still open after failed boot in emergency shell, so luksClose first to be sure
cryptsetup luksClose /dev/mapper/root
# reopen
cryptsetup luksOpen /dev/nvme0n1p1 root
btrfs check /dev/mapper/root
# No valid Btrfs found on /dev/mapper/root
# ERROR: cannot open file system
btrfs filesystem show /dev/mapper/root
# ERROR: no btrfs on /dev/dm-0
mount -t btrfs -o ro,usebackuproot /dev/mapper/root /mnt
# mount: /mnt: wrong fs type, bad option, bad superblock on /dev/mapper/root, missing codepage or helper program, or other error.
btrfs check --super 1 /dev/mapper/root
# No valid Btrfs found on /dev/mapper/root
# ERROR: cannot open file system
btrfs rescue chunk-recover /dev/mapper/root
# read super block error
# recover prepare error
# Chunk tree recovery failed
btrfs rescue super-recover -v /dev/mapper/root
# No valid Btrfs found on /dev/mapper/root
# Usage or syntax errors
btrfs rescue zero-log /dev/mapper/root
# No valid Btrfs found on /dev/mapper/root
# ERROR: could not open ctree
btrfs inspect-internal dump-tree --force /dev/mapper/root
# ERROR: device scan of /dev/mapper/root failed: Input/output error
btrfs inspect-internal dump-super /dev/mapper/root
# superblock: bytenr=65536, device=/dev/mapper/root
# --------------------------------------------------------
# ERROR: bad magic on superblock on /dev/mapper/root at 65536 (use --force to dump it anyway)
btrfs inspect-internal dump-super --force /dev/mapper/root
# this at least dumps some data
So, it seems that the partition is completely dead, except the `dump-super --force` part, which clearly shows that BTRFS Partition is in there. `smartctl` did not show any errors. I have no idea how this could have happened, any advice, e.g. using testdisk to recover the partition?
Best,
sandreas