Skip to content

Instantly share code, notes, and snippets.

@ProjectInitiative
Last active May 14, 2025 18:16
Show Gist options
  • Save ProjectInitiative/3bbd010079124f7f2d217b29ca776cfc to your computer and use it in GitHub Desktop.
Save ProjectInitiative/3bbd010079124f7f2d217b29ca776cfc to your computer and use it in GitHub Desktop.
Mounted fsck for home directory

Kernel: Linux thinkpad 6.14.5 #1-NixOS SMP PREEMPT_DYNAMIC Fri May 2 06:02:16 UTC 2025 x86_64 GNU/Linux bcachefs version v1.25.2 (but when it runs, it finds extents with 1.20, even though I formatted with 1.25.2 tool chain)

Got asked multiple times for (y,n, or Y,N for all errors of this type) Y => captial Y didn't seem to be working? I got asked for each occurance after. I have two volumes, a home directory and an extra data volume. Both use snapshots. dm-3 is home directory and dm-4 is the extra volume.

When booting (boot failed even with "fsck" as a mount option)

[May14 09:04] bcachefs (dm-3): journal read done, replaying entries 595600-595600
[  +0.026529] bcachefs (dm-3): accounting_read... done
[  +0.019089] bcachefs (dm-3): alloc_read... done
[  +0.003614] bcachefs (dm-3): stripes_read... done
[  +0.000003] bcachefs (dm-3): snapshots_read... done
[  +0.000027] bcachefs (dm-3): check_allocations... done
[  +9.705253] bcachefs (dm-3): going read-write
[  +0.000961] bcachefs (dm-3): journal_replay... done
[  +0.000007] bcachefs (dm-3): check_alloc_info... done
[  +0.868895] bcachefs (dm-3): check_lrus... done
[  +0.004277] bcachefs (dm-3): check_btree_backpointers... done
[  +3.788493] bcachefs (dm-3): check_extents_to_backpointers... done
[  +1.046408] bcachefs (dm-3): check_alloc_to_lru_refs... done
[  +0.101477] bcachefs (dm-3): check_snapshot_trees... done
[  +0.000015] bcachefs (dm-3): check_snapshots... done
[  +0.000069] bcachefs (dm-3): check_subvols...
[  +0.000023] subvol root 4096:4294967133 has wrong bi_subvol field: got 0, should be 1, exiting
[  +0.000003] bcachefs (dm-3): Unable to continue, halting
[  +0.000001] bcachefs (dm-3): bch2_check_subvols(): error fsck_errors_not_fixed
[  +0.001323] bcachefs (dm-3): bch2_fs_recovery(): error fsck_errors_not_fixed
[  +0.000002] bcachefs (dm-3): bch2_fs_start(): error starting filesystem fsck_errors_not_fixed
[  +0.001537] bcachefs (dm-3): unclean shutdown complete, journal seq 595608
[  +0.155283] bcachefs: bch2_fs_get_tree() error: fsck_errors_not_fixed
[  +0.049731] bcachefs (dm-4): starting version 1.20: directory_size opts=background_compression=zstd:15,fsck
[  +0.000005] bcachefs (dm-4): recovering from unclean shutdown
[ +14.355908] bcachefs (dm-4): journal read done, replaying entries 64678-64678
[  +0.013666] bcachefs (dm-4): accounting_read... done
[  +0.014887] bcachefs (dm-4): alloc_read... done
[  +0.001530] bcachefs (dm-4): stripes_read... done
[  +0.000002] bcachefs (dm-4): snapshots_read... done
[  +0.000013] bcachefs (dm-4): check_allocations... done
[ +12.512120] bcachefs (dm-4): going read-write
[  +0.010250] bcachefs (dm-4): journal_replay... done
[  +0.000008] bcachefs (dm-4): check_alloc_info... done
[  +0.395574] bcachefs (dm-4): check_lrus... done
[  +0.003239] bcachefs (dm-4): check_btree_backpointers... done
[  +6.616244] bcachefs (dm-4): check_extents_to_backpointers... done
[  +1.668524] bcachefs (dm-4): check_alloc_to_lru_refs... done
[  +0.162440] bcachefs (dm-4): check_snapshot_trees... done
[  +0.000028] bcachefs (dm-4): check_snapshots... done
[  +0.000045] bcachefs (dm-4): check_subvols...
[  +0.000018] subvol root 4096:4294967254 has wrong bi_subvol field: got 0, should be 1, exiting
[  +0.000003] bcachefs (dm-4): Unable to continue, halting
[  +0.000001] bcachefs (dm-4): bch2_check_subvols(): error fsck_errors_not_fixed
[  +0.000128] bcachefs (dm-4): bch2_fs_recovery(): error fsck_errors_not_fixed
[  +0.000001] bcachefs (dm-4): bch2_fs_start(): error starting filesystem fsck_errors_not_fixed
[  +0.001288] bcachefs (dm-4): unclean shutdown complete, journal seq 64686
[  +0.111479] bcachefs: bch2_fs_get_tree() error: fsck_errors_not_fixed
[May14 09:05] bcachefs (dm-4): starting version 1.20: directory_size opts=background_compression=zstd:15
[  +0.000005] bcachefs (dm-4): recovering from unclean shutdown
[ +14.249633] bcachefs (dm-4): journal read done, replaying entries 64678-64678
[  +0.015013] bcachefs (dm-4): accounting_read... done
[  +0.014769] bcachefs (dm-4): alloc_read... done
[  +0.001717] bcachefs (dm-4): stripes_read... done
[  +0.000003] bcachefs (dm-4): snapshots_read... done
[  +0.014470] bcachefs (dm-4): going read-write
[  +0.002666] bcachefs (dm-4): journal_replay... done
[  +0.000008] bcachefs (dm-4): resume_logged_ops... done
[  +0.000002] bcachefs (dm-4): delete_dead_inodes... done
[May14 09:10] bcachefs (dm-3): starting version 1.20: directory_size opts=background_compression=lz4
[  +0.000004] bcachefs (dm-3): recovering from unclean shutdown
[ +11.879696] bcachefs (dm-3): journal read done, replaying entries 595600-595600
[  +0.027066] bcachefs (dm-3): accounting_read... done
[  +0.011949] bcachefs (dm-3): alloc_read... done
[  +0.005158] bcachefs (dm-3): stripes_read... done
[  +0.000003] bcachefs (dm-3): snapshots_read... done
[  +0.012504] bcachefs (dm-3): going read-write
[  +0.001536] bcachefs (dm-3): journal_replay... done
[  +0.000014] bcachefs (dm-3): resume_logged_ops... done
[  +0.001085] bcachefs (dm-3): delete_dead_inodes... done
[May14 09:16] bcachefs (dm-4): clean shutdown complete, journal seq 65358
[  +2.680376] bcachefs (dm-4): starting version 1.20: directory_size opts=background_compression=zstd:15,fsck
[  +0.000008] bcachefs (dm-4): recovering from clean shutdown, journal seq 65358
[  +0.013469] bcachefs (dm-4): accounting_read... done
[  +0.004957] bcachefs (dm-4): alloc_read... done
[  +0.001588] bcachefs (dm-4): stripes_read... done
[  +0.000002] bcachefs (dm-4): snapshots_read... done
[  +0.000012] bcachefs (dm-4): check_allocations... done
[ +12.952239] bcachefs (dm-4): going read-write
[  +0.009793] bcachefs (dm-4): journal_replay... done
[  +0.000004] bcachefs (dm-4): check_alloc_info... done
[  +0.453924] bcachefs (dm-4): check_lrus... done
[  +0.003126] bcachefs (dm-4): check_btree_backpointers... done
[  +6.827293] bcachefs (dm-4): check_extents_to_backpointers... done
[  +1.803105] bcachefs (dm-4): check_alloc_to_lru_refs... done
[  +0.166978] bcachefs (dm-4): check_snapshot_trees... done
[  +0.000032] bcachefs (dm-4): check_snapshots... done
[  +0.000050] bcachefs (dm-4): check_subvols...
[  +0.000022] subvol root 4096:4294967254 has wrong bi_subvol field: got 0, should be 1, exiting
[  +0.000004] bcachefs (dm-4): Unable to continue, halting
[  +0.000001] bcachefs (dm-4): bch2_check_subvols(): error fsck_errors_not_fixed
[  +0.000010] bcachefs (dm-4): bch2_fs_recovery(): error fsck_errors_not_fixed
[  +0.000001] bcachefs (dm-4): bch2_fs_start(): error starting filesystem fsck_errors_not_fixed
[  +0.001245] bcachefs (dm-4): unclean shutdown complete, journal seq 65360
[  +0.021292] bcachefs: bch2_fs_get_tree() error: fsck_errors_not_fixed
[ +22.842419] bcachefs (dm-4): starting version 1.20: directory_size opts=background_compression=zstd:15
[  +0.000004] bcachefs (dm-4): recovering from unclean shutdown
[May14 09:17] bcachefs (dm-4): journal read done, replaying entries 65360-65360
[  +0.013048] bcachefs (dm-4): accounting_read... done
[  +0.014550] bcachefs (dm-4): alloc_read... done
[  +0.001495] bcachefs (dm-4): stripes_read... done
[  +0.000002] bcachefs (dm-4): snapshots_read... done
[  +0.013094] bcachefs (dm-4): going read-write
[  +0.002274] bcachefs (dm-4): journal_replay... done
[  +0.000867] bcachefs (dm-4): resume_logged_ops... done
[  +0.000009] bcachefs (dm-4): delete_dead_inodes... done
[ +15.652734] bcachefs (dm-4): clean shutdown complete, journal seq 65389
[  +1.558912] bcachefs (dm-4): starting version 1.20: directory_size opts=background_compression=zstd:15,fsck
[  +0.000008] bcachefs (dm-4): recovering from clean shutdown, journal seq 65389
[  +0.011783] bcachefs (dm-4): accounting_read... done
[  +0.004574] bcachefs (dm-4): alloc_read... done
[  +0.001435] bcachefs (dm-4): stripes_read... done
[  +0.000002] bcachefs (dm-4): snapshots_read... done
[  +0.000011] bcachefs (dm-4): check_allocations... done
[ +12.578447] bcachefs (dm-4): going read-write
[  +0.010152] bcachefs (dm-4): journal_replay... done
[  +0.000867] bcachefs (dm-4): check_alloc_info... done
[  +0.413167] bcachefs (dm-4): check_lrus... done
[  +0.002890] bcachefs (dm-4): check_btree_backpointers... done
[  +6.755346] bcachefs (dm-4): check_extents_to_backpointers... done
[  +1.767021] bcachefs (dm-4): check_alloc_to_lru_refs... done
[  +0.169542] bcachefs (dm-4): check_snapshot_trees... done
[  +0.000014] bcachefs (dm-4): check_snapshots... done
[  +0.000045] bcachefs (dm-4): check_subvols...
[  +0.000016] subvol root 4096:4294967254 has wrong bi_subvol field: got 0, should be 1, exiting
[  +0.000003] bcachefs (dm-4): Unable to continue, halting
[  +0.000001] bcachefs (dm-4): bch2_check_subvols(): error fsck_errors_not_fixed
[  +0.000012] bcachefs (dm-4): bch2_fs_recovery(): error fsck_errors_not_fixed
[  +0.000002] bcachefs (dm-4): bch2_fs_start(): error starting filesystem fsck_errors_not_fixed
[  +0.001106] bcachefs (dm-4): unclean shutdown complete, journal seq 65392
[  +0.034750] bcachefs: bch2_fs_get_tree() error: fsck_errors_not_fixed


Mounting home manually once recovered boot

Running fsck online
bcachefs (dm-3): check_alloc_info... done
bcachefs (dm-3): check_lrus... done
bcachefs (dm-3): check_btree_backpointers... done
bcachefs (dm-3): check_backpointers_to_extents...bcachefs (dm-3): backpointers_to_extents: 45%, done 1391/3057 nodes, at backpointers:0:297554411520:0
 done
bcachefs (dm-3): check_extents_to_backpointers... done
bcachefs (dm-3): check_alloc_to_lru_refs... done
bcachefs (dm-3): check_snapshot_trees... done
bcachefs (dm-3): check_snapshots... done
bcachefs (dm-3): check_subvols...subvol root 4096:4294967133 has wrong bi_subvol field: got 0, should be 1, fix? (y,n, or Y,N for all errors of this type) Y
 done
bcachefs (dm-3): check_subvol_children... done
bcachefs (dm-3): delete_dead_snapshots... done
bcachefs (dm-3): check_indirect_extents... done
bcachefs (dm-3): check_root... done
bcachefs (dm-3): check_subvolume_structure...subvolume loop, fix? (y,n, or Y,N for all errors of this type) Y
bcachefs (dm-3): bch2_check_subvolume_structure(): error ENOENT_bkey_type_mismatch
bcachefs (dm-3): bch2_fsck_online_thread_fn(): error ENOENT_bkey_type_mismatch
error closing fd: Unknown error 2151 at c_src/cmd_fsck.c:89

Mounting volume manually

[  +1.333192] bcachefs (dm-3): dirent points to inode that does not point back:
                u64s 8 type dirent 1185863:7978347666253517277:4294967257 len 0 ver 0: wireplumber -> 1539556 type dir
                inum: 1539556:4294967135 
                mode=40700
                flags=(19300000)
                journal_seq=595070
                hash_seed=40453bf795df7029
                hash_type=siphash
                bi_size=0
                bi_sectors=0
                bi_version=0
                bi_atime=44188747530185
                bi_ctime=561230813172379
                bi_mtime=561230813172379
                bi_otime=3270941005684
                bi_uid=1000
                bi_gid=1000
                bi_nlink=0
                bi_generation=0
                bi_dev=0
                bi_data_checksum=0
                bi_compression=0
                bi_project=0
                bi_background_compression=0
                bi_data_replicas=0
                bi_promote_target=0
                bi_foreground_target=0
                bi_background_target=0
                bi_erasure_code=0
                bi_fields_set=0
                bi_dir=0
                bi_dir_offset=0
                bi_subvol=0
                bi_parent_subvol=0
                bi_nocow=0
                bi_depth=2
                bi_inodes_32bit=0
[  +0.000014] bcachefs (dm-3): inconsistency detected - emergency read only at journal seq 595673
[  +0.023768] bcachefs (dm-3): unclean shutdown complete, journal seq 595673
[  +0.136384] Initializing XFRM netlink socket
[  +0.097383] rfkill: input handler enabled
[  +0.988851] bcachefs (dm-3): dirent points to inode that does not point back:
                u64s 8 type dirent 4115:4788777817878249414:4294967257 len 0 ver 0: gstreamer-1.0 -> 10241 type dir
                inum: 10241:4294967135 
                mode=40775
                flags=(19300000)
                journal_seq=595063
                hash_seed=fd5f451d87ca12
                hash_type=siphash
                bi_size=0
                bi_sectors=0
                bi_version=0
                bi_atime=44178662298638
                bi_ctime=561233699238565
                bi_mtime=561233699238565
                bi_otime=1512841998542
                bi_uid=1000
                bi_gid=1000
                bi_nlink=0
                bi_generation=0
                bi_dev=0
                bi_data_checksum=0
                bi_compression=0
                bi_project=0
                bi_background_compression=0
                bi_data_replicas=0
                bi_promote_target=0
                bi_foreground_target=0
                bi_background_target=0
                bi_erasure_code=0
                bi_fields_set=0
                bi_dir=0
                bi_dir_offset=0
                bi_subvol=0
                bi_parent_subvol=0
                bi_nocow=0
                bi_depth=1
                bi_inodes_32bit=0
[  +0.107900] rfkill: input handler disabled
[  +0.070952] nvme nvme0: using unchecked data buffer
[  +0.474851] bcachefs (dm-3): dirent points to inode that does not point back:
                u64s 7 type dirent 1247259:1334536482454387248:4294967257 len 0 ver 0: tags -> 1490909 type dir
                inum: 1490909:4294967135 
                mode=40755
                flags=(19300000)
                journal_seq=595069
                hash_seed=6f64e5f375e3a899
                hash_type=siphash
                bi_size=0
                bi_sectors=0
                bi_version=0
                bi_atime=44188644527820
                bi_ctime=561243516435990
                bi_mtime=561243516435990
                bi_otime=3102359751064
                bi_uid=1000
                bi_gid=1000
                bi_nlink=0
                bi_generation=0
                bi_dev=0
                bi_data_checksum=0
                bi_compression=0
                bi_project=0
                bi_background_compression=0
                bi_data_replicas=0
                bi_promote_target=0
                bi_foreground_target=0
                bi_background_target=0
                bi_erasure_code=0
                bi_fields_set=0
                bi_dir=0
                bi_dir_offset=0
                bi_subvol=0
                bi_parent_subvol=0
                bi_nocow=0
                bi_depth=2
                bi_inodes_32bit=0
@ProjectInitiative
Copy link
Author

Some additional errors I have seen but weren't able to capture in the recovery console:

EEXIST_str_hash_set, exit code -1. I deleted all snapshots and this error went away, but the ones above persist.

@ProjectInitiative
Copy link
Author

Mounting the Extra volume manually succeeds, but is unusable:

ls -al tmpfs
ls: cannot access 'tmpfs/.Trash-1000': No such file or directory
ls: cannot access 'tmpfs/Games': No such file or directory
ls: cannot access 'tmpfs/rpi-backups': No such file or directory
ls: cannot access 'tmpfs/ISOs': No such file or directory
ls: cannot access 'tmpfs/gdrive-backup': No such file or directory
ls: cannot access 'tmpfs/accident-09152022': No such file or directory
ls: cannot access 'tmpfs/pve-backup': No such file or directory
ls: cannot access 'tmpfs/lost+found': No such file or directory
ls: cannot access 'tmpfs/photos': No such file or directory
ls: cannot access 'tmpfs/quickemu': No such file or directory
ls: cannot access 'tmpfs/USB-Backup': No such file or directory
ls: cannot access 'tmpfs/lepotato.img': No such file or directory
ls: cannot access 'tmpfs/linux-vol': No such file or directory
ls: cannot access 'tmpfs/VMs': No such file or directory
ls: cannot access 'tmpfs/ventoy-backup': No such file or directory
total 4
drwxr-xr-x 2 root root    0 May 14 09:17 .
drwxr-xr-x 5 root root 4096 May  7 20:05 ..
d????????? ? ?    ?       ?            ? accident-09152022
d????????? ? ?    ?       ?            ? Games
d????????? ? ?    ?       ?            ? gdrive-backup
d????????? ? ?    ?       ?            ? ISOs
-????????? ? ?    ?       ?            ? lepotato.img
d????????? ? ?    ?       ?            ? linux-vol
d????????? ? ?    ?       ?            ? lost+found
d????????? ? ?    ?       ?            ? photos
d????????? ? ?    ?       ?            ? pve-backup
d????????? ? ?    ?       ?            ? quickemu
d????????? ? ?    ?       ?            ? rpi-backups
d????????? ? ?    ?       ?            ? .Trash-1000
d????????? ? ?    ?       ?            ? USB-Backup
d????????? ? ?    ?       ?            ? ventoy-backup
d????????? ? ?    ?       ?            ? VMs

@ProjectInitiative
Copy link
Author

Note: I added the fsck mount option because if there was an unclean shutdown, the system failed to boot due to some cleanup needing to be done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment