I have a PC which has an HDD for data storage and an NVME-SSD for system components. I installed Manjaro via the “erase disk” option to the NVME-drive.
The HDD contains a BTRFS fileystem directly on the device with not partition-table or the like. I did not select this drive anywhere during the installation.
When running cfdisk /dev/sda
I get the following
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 64 4769207 4769144 2,3G 0 Empty
/dev/sda2 4769208 4777399 8192 4M ef EFI (FAT-12/16/32)
Free space 4777984 3907029167 3902251184 1,8T
When I run btrfs check /dev/sda
I get
[seb@athene ~]$ sudo btrfs check /dev/sda
Opening filesystem to check...
checksum verify failed on 22134784 wanted 0x25272c51 found 0x983f4607
checksum verify failed on 22134784 wanted 0x14652fb6 found 0x1b1c3832
checksum verify failed on 22134784 wanted 0x25272c51 found 0x983f4607
bad tree block 22134784, bytenr mismatch, want=22134784, have=12897599460455243095
Couldn't read chunk tree
ERROR: cannot open file system
My /etc/fstab
reads like
UUID=AC0B-E9A2 /boot/efi vfat umask=0077 0 2
UUID=6747c9fe-d6c9-40f1-8711-54533f56fbc9 / btrfs subvol=/@,defaults 0 0
UUID=6747c9fe-d6c9-40f1-8711-54533f56fbc9 /home btrfs subvol=/@home,defaults 0 0
UUID=6747c9fe-d6c9-40f1-8711-54533f56fbc9 /var/cache btrfs subvol=/@cache,defaults 0 0
UUID=6747c9fe-d6c9-40f1-8711-54533f56fbc9 /var/log btrfs subvol=/@log,defaults 0 0
UUID=e112ce71-8e9e-4ffb-b3d7-a0fcc0903586 swap swap defaults,noatime 0 0
and running blkid
gives
/dev/nvme0n1p3: LABEL="swap" UUID="e112ce71-8e9e-4ffb-b3d7-a0fcc0903586" TYPE="swap" PARTUUID="9ad7fe92-191f-234f-9210-8f50340f2cd3"
/dev/nvme0n1p1: LABEL_FATBOOT="NO_LABEL" LABEL="NO_LABEL" UUID="AC0B-E9A2" BLOCK_SIZE="512" TYPE="vfat" PARTUUID="92929a65-8d76-5d49-88f2-93f25ba8aa1c"
/dev/nvme0n1p2: UUID="6747c9fe-d6c9-40f1-8711-54533f56fbc9" UUID_SUB="26bd9ebf-c56b-4a06-aaf2-293f45979251" BLOCK_SIZE="4096" TYPE="btrfs" PARTLABEL="root" PARTUUID="3f7e1a67-c5ba-f146-abc2-140243f56ad7"
/dev/sda2: SEC_TYPE="msdos" LABEL_FATBOOT="MISO_EFI" LABEL="MISO_EFI" UUID="E681-61D6" BLOCK_SIZE="512" TYPE="vfat"
What happened to the BTRFS device? During the setup there was no notification that this device would be even touched.
Do I have any chance of getting back my files on this drive? If so, how?
EDIT:
When I run gparted
it correctly shows me /dev/sda
to be a BTRFS-device and nothing else in the partition table.
EDIT2:
After some more trying things out with spastically shaking hands, I installed testdisk
and then ran it on /dev/sda
with partition table type None
. There it quickly finds the following:
Disk /dev/sda - 2000 GB / 1863 GiB - CHS 243201 255 63
Partition Start End Size in sectors
>P btrfs 0 0 1 243201 80 63 3907029168
Structure: Ok.
Keys T: change type,
Enter: to continue
btrfs blocksize=4096, 2000 GB / 1863 GiB
However, I cannot write this new partition table, since I selected “None” as type.
EDIT3:
It seems like the superblocks are also intact:
[seb@athene ~]$ sudo btrfs rescue super-recover -v /dev/sda
All Devices:
Device: id = 1, name = /dev/sda
Before Recovering:
[All good supers]:
device name = /dev/sda
superblock bytenr = 65536
device name = /dev/sda
superblock bytenr = 67108864
device name = /dev/sda
superblock bytenr = 274877906944
[All bad supers]:
All supers are valid, no need to recover