koverstreet / bcachefs

Other
695 stars 72 forks source link

Unable to Remount After Disk Failure: `insufficient_devices_to_start` #778

Open kznrluk opened 3 days ago

kznrluk commented 3 days ago

To verify the operation during disk failure, I simulated disk corruption using the following steps:

  1. sudo bcachefs format with replicas=3

    sudo bcachefs format \
    --errors=continue \
    --replicas=3 \
    --label=hdd.hdd1 /dev/sda \
    --label=hdd.hdd2 /dev/sdb \
    --label=hdd.hdd3 /dev/sdc \
    --label=hdd.hdd4 /dev/sdd \
    --label=hdd.hdd5 /dev/sde \
    --label=hdd.hdd6 /dev/sdf \
    --label=hdd.hdd7 /dev/sdg \
    --label=hdd.hdd8 /dev/sdh \
    --durability=0 --discard \
    --label=nvme.cache1 /dev/nvme1n1 \
    --foreground_target=nvme \
    --promote_target=nvme \
    --background_target=hdd
  2. sudo mount -t bcachefs /dev/sdb /mnt/ada

  3. copy some files

  4. sudo umount /mnt/ada

  5. sudo sgdisk -Z /dev/sda

After this, an error occurs upon attempting to remount:

$ sudo mount -t bcachefs /dev/sdb /mnt/ada
Error: Invalid argument

Dmesg:

[  971.114364] bcachefs: bch2_fs_open() bch_fs_open err opening /dev/nvme1n1: insufficient_devices_to_start
[  971.361971] bcachefs: bch2_fs_get_tree() error: insufficient_devices_to_start

I also tried alternative methods as listed below, but all resulted in errors:

$ sudo mount.bcachefs -o very_degrated UUID=c4549463-cef5-43c0-bfea-af87901c32fa /mnt/ada
Error: Invalid argument

[ 1106.538576] bcachefs: bch2_fs_open() bch_fs_open err opening /dev/nvme1n1: insufficient_devices_to_start
[ 1106.819125] bcachefs: bch2_fs_get_tree() error: insufficient_devices_to_start

$ sudo mount -t bcachefs -i -v /dev/sdb:/dev/sdc:/dev/sdd:/dev/sde:/dev/sdf:/dev/sdg:/dev/sdh:/dev/nvme1n1 -o ro,nochanges,very_degrated /mnt/ada
mount: /mnt/ada: wrong fs type, bad option, bad superblock on /dev/sdb:/dev/sdc:/dev/sdd:/dev/sde:/dev/sdf:/dev/sdg:/dev/sdh:/dev/nvme1n1, missing codepage or helper program, or other error.
       dmesg(1) may have more information after failed mount system call.

[ 1202.235591] bcachefs: bch2_fs_open() bch_fs_open err opening /dev/sdb: insufficient_devices_to_start
[ 1202.449424] bcachefs: bch2_fs_get_tree() error: insufficient_devices_to_start

Environment information:

$ uname -a
Linux alo 6.12.0-rc6-1-mainline #1 SMP PREEMPT_DYNAMIC Sun, 10 Nov 2024 07:34:03 +0000 x86_64 GNU/Linux
$ bcachefs version
1.12.0

sudo bcachefs show-super -l /dev/sdb is here: https://gist.github.com/kznrluk/30588b5a1a284e40934a5d3aec819d3e

kznrluk commented 3 days ago

I have done this several times and all the errors I see in the kernel log seem to be NVMe for cache. Also note that I am using Linux 6.12.0-rc6.

thememika commented 2 days ago

You destroyed your superblock, it's not possible to start the filesystem. If it's multi device filesystem, maybe you can use degraded or very_degraded mount options.