Btrfs volume recover

hi all.

i can’t find a solution to my problem, so i hope it’s fine to start a new topic (and hopefully in the right category)

i had a 100GB (99%full) btrfs root. so i mounted a 30GB USB stick and added it to root. then i did a btrfs balance, and started to delete some timeshift backups**, to create empty space. meanwhile, while i’m working on, the system slowly shuttet down (no clue why!), so in the the end i couldn’t type any command in the terminal (somthing like “couldn’t auto complete command…” after each new letter). and after a reboot the system couldn’t start again.

in a trace of novice panic, i created a live usb stick, what was unluckily the usb device i added to my root volume before.

i installed the newest manjaro from this stick on an empty harddisk and tried to recover my old btrfs root volume, where is one device missing now.

what i have done yet:

# mount /dev/sdb2 /mnt 
mount: /mnt: fsconfig-Systemaufruf ist fehlgeschlagen: Datei oder Verzeichnis nicht gefunden. 
      dmesg(1) könnte nach einem fehlgeschlagenen mount-Systemaufruf 
      weitere Informationen liefern.

# btrfs check /dev/sdb2 
Opening filesystem to check... 
bad tree block 207186542592, bytenr mismatch, want=207186542592, have=0 
Couldn't read tree root 
ERROR: cannot open file system

# btrfsck /dev/sdb2 
Opening filesystem to check... 
bad tree block 207186542592, bytenr mismatch, want=207186542592, have=0 
Couldn't read tree root 
ERROR: cannot open file system

# btrfs filesystem show 
Couldn't read tree root 
Label: 'Manjaro S'  uuid: 8ca6a712-532c-4a31-91f9-2320037ae9e8 
       Total devices 2 FS bytes used 84.70GiB 
       devid    1 size 97.66GiB used 86.06GiB path /dev/sdb2 
       *** Some devices missing

# mount -t btrfs -o rootflags=recovery,nospace_cache,clear_cache /dev/sdb2 /mnt/test/ 
mount: /mnt/test/: fsconfig system call failed: btrfs: Unknown parameter 'rootflags'. 

# btrfs subvolume list /dev/sdb2 
ERROR: not a directory: /dev/sdb2 
ERROR: can't access '/dev/sdb2' 

# mount -o ro,nodatacow /dev/sdb2 /mnt 
mount: /mnt: fsconfig-Systemaufruf ist fehlgeschlagen: Datei oder Verzeichnis nicht gefunden.

# btrfs restore /dev/sdb2 /run/media/x/backup 
bad tree block 207186542592, bytenr mismatch, want=207186542592, have=0 
Couldn't read tree root 
Could not open root, trying backup super 
bad tree block 207186542592, bytenr mismatch, want=207186542592, have=0 
Couldn't read tree root 
Could not open root, trying backup super 
ERROR: superblock bytenr 274877906944 is larger than device size 104857600000 
Could not open root, trying backup super


# btrfs rescue chunk-recover /dev/sdb2 
Scanning: DONE in dev0                         
open with broken chunk error 

# btrfs rescue fix-device-size /dev/sdb2 
Couldn't read tree root 
ERROR: could not open btrfs 

# btrfs rescue clear-ino-cache /dev/sdb2 
Couldn't read tree root 
ERROR: could not open btrfs 

# btrfs rescue super-recover /dev/sdb2 
All supers are valid, no need to recover 

# btrfs rescue zero-log /dev/sdb2 
Couldn't read tree root 
ERROR: could not open ctree


as you maybe can see: i am a total beginner, and copied the commands from researching in some forum for similar problems. without success yet.

**on this point i realised that timeshift with btrfs can only do backups on the same device than creating from, so all my backups are on this volume.

hopefully someone here can help me !?

Thanks a lo and best regards

Welcome to the Manjaro community.

As a new forum user, please take some time to familiarise yourself with Forum requirements; in particular, the many ways to use the forum to your benefit:


The Update Announcements should be checked frequently for important update related information.

These announcements contain a Known Issues and Solutions section and should generally be checked before posting a request for support.


Someone will no doubt help with your issue when they are able. Output of the following command (formatted according to forum requirements) may be useful for those wishing to help:

inxi --admin --verbosity=8 --filter --no-host --width

Be prepared to provide more information and outputs from other commands when asked.

Regards.

At this point you have passed the point where it was advisable to ask for help.

That is understandable, but now that the USB stick that had become part of the btrfs volume has been deleted, I can no longer help. :footprints:

Although I cannot help, I can offer

advice:

If the data is valuable to you:
Make a 1:1 copy of what you still have.
Don’t experiment with the original, only with the copy.
Or even better: seek professional help.

and explain what went wrong (for those who don't want to experience the same thing)

At this point seek advice: in Out of space

You created a RAID with an USB-Stick

Do not perform a balance without first deleting something!!!

After enough has been deleted, a “careful” balance should be used. How exactly is explained in the wiki in Out of space

  • The aim is to free up as many chunks as the USB stick provides + at least 5 additional chunks (1GB each).
  • Then you have to be patient and wait until the balance has finished. If necessary, leave the computer on overnight.
  • Then the USB stick can be removed from the RAID again (see wiki).
  • Your main goal is to rescue your system
  • You should not do anything heavy, while the balance is running !
  • Your balance may need to read/write a lot of data from / to a possibly slow USB-stick
  • Do not delete additional files while the balance is running

There can be various reasons for this. But a btrfs RAID starts even after a reset if all devices are present. Changing the fstab or grub.cfg is not necessary for this.

Perhaps you have removed the USB stick?

(It is now part of your btrfs file system, and without it the btrfs file system is not complete)

At this point you have destroyed your RAID

What to learn:
  • Make Backups !!!
  • Use Timeshift (delete old snapshots)
  • mantain your system
  • keep your btrfs under 85%
  • if unsure ask for help

:footprints:

1 Like