Recovering btrfs/luks system - failed to stat resume device

Hello all. I’m looking for some help recovering my system!

After a couple of updates (without rebooting, stupidly), my computer won’t boot: I enter my boot password and can get to the GRUB menu, but whichever entry I select (including old btrfs snapshots), I get dumped to a command line with the following error messages:

mount: /openswap_keymount: fsconfig() failed: No such file or directory.
Failed to open key file.
umount: openswap_keymount: not mounted
Failed to stat resume device '/dev/mapper/luks_<long UUID>': No such file or directory
mount: /new_root: fsconfig() failed: No such file or directory.
ERROR: Failed to mount '/dev/mapper/luks_<a different long UUID>' on real root

So far, I’ve tried booting into a live USB, but haven’t been able to mount my system:

> cryptsetup open --type luks /dev/nvme0n1p2 luks
[prompts for password, works fine]
> mount /dev/mapper/luks /mnt
mount: /mnt: fsconfig() failed: No such file or directory.
       dmesg(1) may have more information after failed mount system call.

The only clue I can get from dmesg is BTRFS error (device dm-0 state E): open_ctree failed: -2.

Looking for any advice about where to go from here.

Your mount procedure is wrong.
You can’t mount the /dev/mapper/xyz device directly - mount the BTRFS subvolumes on it in the correct order instead.

A little further down in this post you find the correct procedure for a BTRFS file system.

[HowTo] Recovering from an interrupted update/upgrade

Instead of /dev/sdaX in the example use your decrypted /dev/mapper/xyz

My experience with BTRFS is non existent - can’t help there.

The basic rescue steps is provided in Basic Manjaro Linux Rescue and Recovery topic.

Thanks for the replies. There’s probably a 9/10 chance this is just me being stupid, but I still can’t get my filesystem to mount.

When I do mount -t btrfs -o subvol=@ /dev/mapper/luks /mnt, I still get the fsconfig() failed error. I’ve tried with various different options including subvol=/ and specifying zstd compression, but no luck.

I also ran btrfs check on the filesystem and it didn’t find any errors, which leads me to think I’m just being an idiot.

What am I doing wrong?

So, just to verify every step along the way:
what do you see right after booting the ISO

lsblk -f

And what do you see after decrypting the device with:

sudo cryptsetup open /dev/sda2 encrypted
(sda2 is an example - use the device name shown from the previous command
the word “encrypted” is an arbitrary word you can choose)

run:
lsblk -f
again

After booting the live USB:

> lsblk -f
NAME        FSTYPE      FSVER            LABEL            UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
loop0       squashfs    4.0                                                                          0   100% /run/miso/sfs/livefs
loop1       squashfs    4.0                                                                          0   100% /run/miso/sfs/mhwdfs
loop2       squashfs    4.0                                                                          0   100% /run/miso/sfs/desktopfs
loop3       squashfs    4.0                                                                          0   100% /run/miso/sfs/rootfs
sda         iso9660     Joliet Extension MANJARO_KDE_2507 2025-08-12-07-04-46-00                     0   100% /run/miso/bootmnt
├─sda1      iso9660     Joliet Extension MANJARO_KDE_2507 2025-08-12-07-04-46-00                              
└─sda2      vfat        FAT12            MISO_EFI         3EA4-A0A2                                           
nvme0n1                                                                                                       
├─nvme0n1p1 vfat        FAT32                             16EA-A163                                           
├─nvme0n1p2 crypto_LUKS 1                                 d14b91a2-3549-4488-a3df-5c02d1e20bce                
└─nvme0n1p3 crypto_LUKS 1                                 2e8fc1b0-5c7b-4372-ab43-53273723e444

After opening both encrypted partitions with cryptsetup:

> lsblk -f
NAME        FSTYPE      FSVER            LABEL            UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
loop0       squashfs    4.0                                                                          0   100% /run/miso/sfs/livefs
loop1       squashfs    4.0                                                                          0   100% /run/miso/sfs/mhwdfs
loop2       squashfs    4.0                                                                          0   100% /run/miso/sfs/desktopfs
loop3       squashfs    4.0                                                                          0   100% /run/miso/sfs/rootfs
sda         iso9660     Joliet Extension MANJARO_KDE_2507 2025-08-12-07-04-46-00                     0   100% /run/miso/bootmnt
├─sda1      iso9660     Joliet Extension MANJARO_KDE_2507 2025-08-12-07-04-46-00                              
└─sda2      vfat        FAT12            MISO_EFI         3EA4-A0A2                                           
nvme0n1                                                                                                       
├─nvme0n1p1 vfat        FAT32                             16EA-A163                                           
├─nvme0n1p2 crypto_LUKS 1                                 d14b91a2-3549-4488-a3df-5c02d1e20bce                
│ └─luksp2  btrfs                                         6bbcbad2-6920-42e3-801d-68ba01f5e76f                
└─nvme0n1p3 crypto_LUKS 1                                 2e8fc1b0-5c7b-4372-ab43-53273723e444                
  └─luksp3  swap        1                swap             d48e4365-25c6-4c1c-9af0-b944b8792c64

Yet still:

> sudo mount -t btrfs -o subvol=@ /dev/mapper/luksp2 /mnt                                                                                      
mount: /mnt: fsconfig() failed: No such file or directory.

I have no experience with BTRFS, but there must be methods to check/repair the file system.

I have read about

btrfs check
btrfs rescue
btrfs scrub
btrfs-find-root

man btrfs
in general

but I don’t know when and how to use them - and never did.

Although I use btrfs I’m no expert. Have you tried mounting without the sub-volume:

sudo mount -t btrfs /dev/mapper/luksp2 /mnt

And if that works, what does ls /mnt show? Or what does sudo btrfs subvolume list /mnt show.

I’m wondering if the sub-volume name is not what you expect.

After looking through dmesg output a little bit more, I noticed that on trying to mount my filesystem, I got always got the following error:

BTRFS: error (device dm-0) in btrfs_replay_log:2104: errno=-2 No such entry 
(Failed to recover log tree)

A quick search brought me to this topic on the archlinux forums.

I was able to mount my filesystem read-only using mount -o ro,rescue=all /dev/mapper/luksp2 /mnt, do a backup, unmount and then run btrfs rescue zero-log /dev/mapper/luksp2 to clear the btrfs log tree, which was apparently causing the problem. Then I was able to chroot into my system and run an update. My system boots fine now!

2 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.