koverstreet / bcachefs-tools

http://bcachefs.org
GNU General Public License v2.0
116 stars 88 forks source link

bcachefs mount fails on boot since bcachefs-tools 1.9.0 #308

Open Flowdalic opened 2 months ago

Flowdalic commented 2 months ago

Starting with bcachefs-tools 1.9.0 my bcachefs mount fails on boot (i.e., with systemd mount unit), but suceeeds if I manually mount it.

I have the following fstab entry

UUID=acfd231c-8554-42dd-a69f-01a648984d01   /data-scratch   bcachefs    defaults    0 2

which works fine with bcachefs-tools 1.7.0. However, as soon s I upgrade to 1.9.0 or 1.9.1, the mount fails on boot. Unfortunately, there seems to be no error message in the journal:

Jun 27 07:41:58 neo-pc.sch systemd[1]: Mounting /data-scratch...
Jun 27 07:41:58 neo-pc.sch (udev-worker)[1072]: md126: Process 'bcache-register /dev/md126' failed with exit code 1.
Jun 27 07:41:58 neo-pc.sch systemd-networkd[1061]: eno1: Link UP
Jun 27 07:41:58 neo-pc.sch systemd[1]: data\x2dscratch.mount: Mount process exited, code=exited, status=1/FAILURE
Jun 27 07:41:58 neo-pc.sch systemd[1]: data\x2dscratch.mount: Failed with result 'exit-code'.
Jun 27 07:41:58 neo-pc.sch systemd[1]: Failed to mount /data-scratch.
Jun 27 07:41:58 neo-pc.sch systemd[1]: Dependency failed for Local File Systems.

is all I got. Note that this is a system with a bcache block device and a bcachefs filesystem, both are separate (of course). Not sure if this matters.

Can reliable reproduce with 1.9.0 and 1.9.1, problem disappears always once I downgrade back to 1.7.0.

tmuehlbacher commented 2 months ago

Do you have the means to add -v to bcachefs mount in your setup? Otherwise a bisect would be useful but it looks like that would not be possible to automate in terms of testing, so probably a bit of work.

Flowdalic commented 2 months ago

Do you have the means to add -v to bcachefs mount in your setup?

Unfortunately I see no obvious way to do so with systemd's mount unit. :/

That said, I was surprised that bcachefs-tools seems to exit with a non-zero exit status without emitting an error message. Is this expected behavior?

Any other ideas on how to approach the issue? I ran out of ideas…

tmuehlbacher commented 2 months ago

It looks like it already fails with the bcache-register, not even bcachefs.

Can you try if it's better with #309 if you set BCACHEFS_LOG=trace for the environment of that service? The env variable is introduced with that PR.