Today for some reason my laptop start in read only mode, when I try to restore a btfrs partition, it try to start but only a yellow screen appear and when I re try to run the last snapshot then emergency mode start

Hello, thanks for answering, as I’m telling you, I’m new to this environment, you know that it detects them as in the /dev folder, otherwise in /run/media when I try to check them from USB LIVE and yes my drive is encrypted

try to check them

This is you mounting the partition (to /run/media). Once you see the content, it’s mounted.
Reboot and don’t mount (i. e. don’t click on the drive in e.g. Dolphin). Work in terminal. You need to luksOpen the partition (that’s just decryting and not mounting).

sudo cryptsetup luksOpen /dev/YOURSYSTEMROOTPARTITION    systemroot

then you can sudo btrfs check /dev/mapper/systemroot
or make the image like described above.

Mounted, means like you described, you see the files in /run/media/… afterwards, is when you click on the in Dolphin or other file managers too.
Then you get error messages in sudo dmesg | grep "BTRFS"


sudo journalctl  -p3  
1 Like

thanks for your guide, I was analyzing the partitions with gpart, once it finish I start with those commands

Good idea to check and/or backup as soon as possible …
Because the title description could indicate a failing drive.

Yes! Do these steps first:

Reboot your live environment

And see to get all (or all you need) from btrfsimagemounted

1 Like

this is the output:
sudo cryptsetup luksOpen /dev/nvme0n1p2 systemroot
sudo btrfs check /dev/mapper/systemroot

Opening filesystem to check...
Checking filesystem on /dev/mapper/systemroot
UUID: 26104594-05bf-4666-9597-41ce148cfe64
[1/7] checking root items
[2/7] checking extents
tree extent[144273260544, 16384] parent 8796999598080 has no tree block found
tree extent[144273260544, 16384] parent 906575872 has no backref item in extent tree
incorrect global backref count on 144273260544 found 6 wanted 5
backpointer mismatch on [144273260544 16384]
ERROR: errors found in extent allocation tree or chunk allocation
[3/7] checking free space tree
[4/7] checking fs roots
[5/7] checking only csums items (without verifying data)
[6/7] checking root refs
[7/7] checking quota groups
ERROR: bytenr ref not found for parent 8796999598080
ERROR: not enough memory: accounting for refs for qgroups
ERROR: failed to check quota groups
found 713982095360 bytes used, error(s) found
total csum bytes: 677695472
total tree bytes: 2638954496
total fs tree bytes: 1693843456
total extent tree bytes: 135331840
btree space waste bytes: 437251418
file data blocks allocated: 1451661459456
 referenced 722020425728

Moderator edit: In the future, please use proper formatting: [HowTo] Post command output and file content as formatted text

Gpart does not seem to support btrfs, so better don’t use it.

Ok, before we do anything with the broken drive or filesystem itself, we’ll try to make an image of it. Do you have another drive at hand? Then make the image.

1 Like

ok thanks, i stop gpart when i see your first suggestion.

yes i have another ssd m2 installed on my lap, is empty/clean not encrypted

Is there a filesystem on it?

yes, btfrs the same space of the damaged one

Make the image file then and save it on it to save your data. You need more storage space afterwards for the rescued files. Got any?

yes in another ssd to USB,

sudo dd if=/dev/mapper/systemroot of=/your/path/to/another/storage/device/btrfsimage bs=1M

When done, mount the image to rescue/save/back up the data, for instance your >10gb files:
sudo mount -o ro,rescue=nologreplay /your/path/to/another/storage/device/btrfsimage /run/media/manjaro/btrfsimagemounted

this commands will help for the image creation and backup?

The image is a big file where all the individual files of the partition are in.
The first command makes the image.
The second one mounts it with some safety mount options ( ro,rescue=nologreplay).
Once mounted you are hopefully able to see the files.
Then you can copy them to your USB drive.

1 Like

ok thanks, im making the image right now… i think will take some time

I do:

sudo dd if=/dev/mapper/systemroot of=/dev/nvme1n1 bs=1M                                                                                                                      
906090+1 records in
906090+1 records out


sudo mount -o ro,rescue=nologreplay /dev/nvme1n1 /run/media/manjaro/backo    

the backo is the label of the nvme1n1 (the other clean installed ssd) but give me:

 mount: /run/media/manjaro/backo: mount(2) system call failed: File exists.
dmesg(1) may have more information after failed mount system call.

Ok … is there a file in /dev called nvme1n1 now? And if so, how big is it? What live system are you using, what desktop?

dev/nvme1n1 is empty, im using manjaro live kde

this is my lblk output:

loop0 7:0 0 67.8M 1 loop /run/miso/sfs/livefs
loop1 7:1 0 1.1G 1 loop /run/miso/sfs/mhwdfs
loop2 7:2 0 1.7G 1 loop /run/miso/sfs/desktopfs
loop3 7:3 0 653.7M 1 loop /run/miso/sfs/rootfs
sda 8:0 1 0B 0 disk
sdb 8:16 1 29.3G 0 disk /run/miso/bootmnt
├─sdb1 8:17 1 3.6G 0 part
└─sdb2 8:18 1 4M 0 part
nvme0n1 259:0 0 953.9G 0 disk
├─nvme0n1p1 259:1 0 300M 0 part
├─nvme0n1p2 259:2 0 884.9G 0 part
│ └─systemroot 254:0 0 884.9G 0 crypt /run/media/manjaro/261045lsblk94-05bf-4666-9597-41ce148cfe64
└─nvme0n1p3 259:3 0 68.7G 0 part
nvme1n1 259:4 0 953.9G 0 disk
└─nvme1n1p1 259:6 0 953.9G 0 part

is the dd command, used succesfully?

ok i see now, i can recover my important files!!!