koverstreet / bcachefs

Other
633 stars 69 forks source link

error reading superblock: Not a bcachefs superblock layout #695

Closed Lykos153 closed 1 week ago

Lykos153 commented 2 weeks ago

I've got three disks formatted with encrypted bcachefs that I haven't mounted for the last couple of weeks. Today, when I tried to unlock them, I got

$ bcachefs unlock -k session /dev/sdc1
bcachefs (/dev/sdc1): error reading default superblock: Not a bcachefs superblock (got magic 9194d698-484b-a2e1-6b8d-0126c8fb0200)
bcachefs (/dev/sdc1): error reading superblock: Not a bcachefs superblock layout
Error opening /dev/sdc1: invalid_sb_layout

Interestingly, lsblk now shows all three disks as ceph_bluestore:

lsblk -o+PARTLABEL,FSTYPE | grep -P 'NAME|bcachefs'
NAME        MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINTS PARTLABEL                     FSTYPE
└─sdc1        8:33   0 119,2G  0 part              disk-ata-samsung-830-bcachefs ceph_bluestore
└─sde1        8:65   0 111,8G  0 part              disk-ata-samsung-840-bcachefs ceph_bluestore
└─sdh1        8:113  1   2,7T  0 part              ata-hdd-W1F1HFPJ-bcachefs     ceph_bluestore

I'm on NixOS unstable which currently ships bcachefs 1.7.0-unstable-2024-05-09. As I don't remember exactly when I formatted them, I can't tell what version of bcachefs I had back then.

koverstreet commented 2 weeks ago

Now how would that have happened? Were you playing with ceph?

Lykos153 commented 2 weeks ago

One would think that, but no, not at all. Ceph was never installed on my workstation. And even if Ceph was somehow accidentally installed and run, why would it only target the disks labeled with bcachefs instead of wrecking havoc on random disks?.. Very strange indeed.

I was thinking, how does lsblk detect the file system type? Do bcachefs and bluestore share any magic numbers?

Lykos153 commented 1 week ago

Closing, I've reformatted the disks and hope I won't see this again. This issue was mainly meant as a FYI.

After thinking about it some more... I did run the rook test suite on that machine which creates a Ceph cluster in a VM. It should have never been able to access the host's block devices and even if it could, the question remains why it would precisely target those three (out of nine) devices. The thought is so scary that I rather stop thinking about it.