Skip to main content
Topic: early-fs-fstab.target and fsck failed (Read 1424 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

early-fs-fstab.target and fsck failed

Code: [Select]
sudo dinitctl list

Code: [Select]
...
[{+}     ] fsck-root
[     {X}] early-fs-fstab.target
[     {-}] fsck
[{+}     ] early-console.target
...

Code: [Select]
dinit 0.18.0-5
dinit-base 0.18.0-5
dinit-rc 0.4.7-1

Code: [Select]
sudo dinitctl status early-fs-fstab.target
Code: [Select]
Service: early-fs-fstab.target
    State: STOPPED (failed to start; exited - status 64)

All other services run just fine. Haven't notice any issues with it but wanted to report just in case.

Re: early-fs-fstab.target and fsck failed

Reply #1
TLDR: probably nothing to worry about as your important devices are still being mounted,
else you would be having further problems.



Just "solved" this on my machine so I will walk you through what I did and what might be the problem for you as well.

Looking inside early-fs-fstab.target, we have:

Code: [Select]
type       = scripted
command    = /usr/bin/mount -a -t nonfs,nonfs4,nosmbfs,nocifs,nocodafs,noncpfs,noshfs,nofuse,nofuseblk,noglusterfs,nodavfs,nofuse.glusterfs -O no_netdev
restart    = false
depends-on = early-fs-pre.target
depends-ms = fsck
waits-for  = early-root-rw.target

Interpretation: when early-fs-fstab.target is called by dinit, it runs the following command once before finishing the service:

Code: [Select]
mount -a -t nonfs,nonfs4,nosmbfs,nocifs,nocodafs,noncpfs,noshfs,nofuse,nofuseblk,noglusterfs,nodavfs,nofuse.glusterfs -O no_netdev
This command tries to mount all the devices listed at /etc/fstab, except for the drives with the
types that are explicitly excluded in the command  with the -t flag and the 'no' prefix (e.g. mount -t nonfs: ignore any drive that is of the nfs type. Same logic for the other drive types).
Knowing this, it is easy to infer that the problem is likely some badly declared entry at /etc/fstab.
In my case, the entries on the file that were causing errors were these two:

Code: [Select]
# /dev/sdc1 LABEL=ARTIX_202308
UUID=2023-08-13-15-59-29-00 /run/artix/bootmnt iso9660 ro,relatime,nojoliet,check=s,map=n,blocksize=2048,iocharset=utf8 0 0

# /dev/loop0
/dev/loop0          /run/artix/sfs/rootfs squashfs  ro,relatime,errors=continue,threads=single 0 0

As you can see the specified mount-points were /run/artix/bootmnt and /run/artix/sfs/rootfs respectively, but checking these locations i noticed /run/artix does not exist on my computer.
I'm not really sure what these mount points are supposed to be (maybe they are used for the first install of the OS?), and I don't remember setting them up myself either, but since they were causing the error (and weren't  getting mounted anyways), I just commented them out:

Code: [Select]
# /dev/sdc1 LABEL=ARTIX_202308
# UUID=2023-08-13-15-59-29-00 /run/artix/bootmnt iso9660 ro,relatime,nojoliet,check=s,map=n,blocksize=2048,iocharset=utf8 0 0

# /dev/loop0
# /dev/loop0          /run/artix/sfs/rootfs squashfs  ro,relatime,errors=continue,threads=single 0 0

And just like that, the error is gone! Well, at least it was gone for me. Note that this doesn't actually fix anything as the entries are still
not being mounted, though the system itself works fine without them. I chose to do this because as I said I'm not sure as to what those entries are for and thus would rather leave them commented out.


NOTE: I got all of this knowledge from just reading the relevant files and the man entry for dinit/mount, so if anyone  has any corrections and/or an explanation as to what these two fstab entries are (I also have a commented out 'overlay' entry that I don't understand), please respond!

 

Re: early-fs-fstab.target and fsck failed

Reply #2
@bizio thanks for such a detailed reply! I inspected my fstab can't spot anything. Got couple ntfs drives and btrfs subvolumes gonna be pain to debug. Last time I edited fstab on my debian server I wasn't able to ssh to it on next reboot and ended up reinstalling debian because I couldn't recover (even after chroot'ing and editing fstab back), so I'm little hesitant about touching it on my daily driver :D



Forgot to add this to original post:

Code: [Select]
sudo dinitctl status early-fs-fstab.target
Code: [Select]
Service: early-fs-fstab.target
    State: STOPPED (failed to start; exited - status 64)

Not sure where to see logs or something more then just status code



self-note:
Code: [Select]
/usr/lib/dinit.d/early-fs-fstab.target

Re: early-fs-fstab.target and fsck failed

Reply #3
Not sure where to see logs or something more then just status code

There isn't any logging for the service configured via the service description file, and mount doesn't do any logging of its own, so unfortunately, you can't.

However, the service description file settings are documented so you can easily add logging by editing the file. See the "log-type", "logfile", "log-buffer-size" settings in particular.

Re: early-fs-fstab.target and fsck failed

Reply #4
Code: [Select]
/usr/lib/dinit.d/easrly-fs-fstab.target

Code: [Select]
type       = scripted
command    = /usr/bin/mount -a -t nonfs,nonfs4,nosmbfs,nocifs,nocodafs,noncpfs,noshfs,nofuse,nofuseblk,noglusterfs,nodavfs,nofuse.glusterfs -O no_netdev
restart    = false
depends-on = early-fs-pre.target
depends-ms = fsck
waits-for  = early-root-rw.target
log-type = file
logfile = /var/log/early-fs-fstab.log

Code: [Select]
sudo touch /var/log/early-fs-fstab.log

After reboot log file is empty, did I do something wrong?

Re: early-fs-fstab.target and fsck failed

Reply #5
I have even on a normal install (some tablet with buggy gpu which hangs once in a while), failure to boot with that service even if the volume repaired successfully from the unclean unmount.
It really shouldn't, i mean if fsck succeeded in repairing it doesn't exit with >1 is that right? Or it's 0 just if there's a clean filesystem with nothing to check?

Re: early-fs-fstab.target and fsck failed

Reply #6
I have even on a normal install (some tablet with buggy gpu which hangs once in a while), failure to boot with that service even if the volume repaired successfully from the unclean unmount.
It really shouldn't, i mean if fsck succeeded in repairing it doesn't exit with >1 is that right? Or it's 0 just if there's a clean filesystem with nothing to check?

via "man fsck":

Code: [Select]
       The exit status returned by fsck is the sum of the following
       conditions:

       0
           No errors

       1
           Filesystem errors corrected

       2
           System should be rebooted

       4
           Filesystem errors left uncorrected

The sample rootfscheck script included in the Dinit source distribution shows how 2/4 can be handled.

Re: early-fs-fstab.target and fsck failed

Reply #7
Thanks, so that is what's missing not working just right here, the /usr/lib/dinit/fsck script looks similar.
I think the case argument for code 1 works correctly on another pc i just tested an unclean unmount with, but i don't see the echo...
... and the case argument for 2 it seems it gets stuck, also saw no echod text and probably that command "reboot --use-passed-cfd -r" doesn't pass and exits the script itself with non 0 then? @konimex
Sorry but i don't have the energy to test further.

Code: [Select]
        # it's a bitwise-or, but we are only checking one filesystem
            case $? in
            0) ;; # nothing
            1) # fixed errors
                echo "WARNING: The root filesystem was repaired, continuing boot..."
                sleep 2
            ;;
            2) # system should be rebooted
                echo "WARNING: The root filesystem was repaired, rebooting..."
                sleep 5
                reboot --use-passed-cfd -r
            ;;
            4) # uncorrected errors
                echo "WARNING: The root filesystem has unrecoverable errors."
                echo "         A recovery shell will now be started for you."
                echo "         The system will be rebooted when you are done."
                sulogin
                reboot --use-passed-cfd -r
            ;;
            *) ;;
        esac

Re: early-fs-fstab.target and fsck failed

Reply #8
Thanks, so that is what's missing not working just right here, the /usr/lib/dinit/fsck script looks similar.

Right, looks like it's incorrectly assuming an exact return value of 1, 2, or 4, rather than a bitmask. I don't think you'll ever get 2 by itself, it would always be combined with 1 (at least).

Quote
I think the case argument for code 1 works correctly on another pc i just tested an unclean unmount with, but i don't see the echo...
... and the case argument for 2 it seems it gets stuck, also saw no echod text and probably that command "reboot --use-passed-cfd -r" doesn't pass and exits the script itself with non 0 then?

I suspect --use-pass-cfd won't work with bash (I think, from memory, bash closes "extra" file descriptors), so that's one potential cause of problems, but note that option is not needed if the control socket was already created (eg if /run has already been mounted with a tmpfs via the initial ram disk, which I think should normally be the case for Artix?)

Re: early-fs-fstab.target and fsck failed

Reply #9
Code: [Select]
sudo dinitctl status early-fs-fstab.target
Code: [Select]
Service: early-fs-fstab.target
    State: STOPPED (failed to start; exited - status 64)
same issue here. same exit code. Nothing unusual in fstab as well.
And I still don't see the way to fix it.

Re: early-fs-fstab.target and fsck failed

Reply #10
On my system (with dinit 0.19.0-1) I get unknown reason from dinitctl:
Code: [Select]
❯ sudo dinitctl status early-fs-fstab.target
Service: early-fs-fstab.target
    State: STOPPED (failed to start; unknown reason)

Although in /var/log/daemon.log I find:
Code: [Select]
2024-10-18T07:35:32+02:00 phoenix dinit[1]: Service early-fs-fstab.target command failed with exit code 64
2024-10-18T07:35:32+02:00 phoenix dinit[1]: service early-fs-fstab.target failed to start.

Maybe we should update to dinit 0.19.1, since there have been important fixes ?

Quote
Fixes:
  • Resolve issue causing service restarts to hang (affected "bgprocess" and "internal" services).
  • Fix handling of "depends-ms.d" service setting (q66).
  • Bump protocol version reported by dinit so that full exit status of processes is actually reported (on OSes that support it) (q66).
  • dinitcheck warns about non-absolute executable paths in service descriptions (Yao Zi).

Re: early-fs-fstab.target and fsck failed

Reply #11
with dinit-0.19.1-1

dinitctl list
Code: [Select]
[     {X}] early-fs-fstab.target
[     {-}] fsck

dinitctl status early-fs-fstab.target
Code: [Select]
Service: early-fs-fstab.target
    State: STOPPED (failed to start; exited - status 64)



Re: early-fs-fstab.target and fsck failed

Reply #12
Well, first of all, thanks for updating dinit to 0.19.1.

There is a slight improvement - dinitctl now reports the exit code (64):
Code: [Select]
❯ sudo dinitctl status early-fs-fstab.target
Service: early-fs-fstab.target
    State: STOPPED (failed to start; exited - status 64)

But the pesky early-fs-fstab.target is still failing:
Code: [Select]
2024-10-19T09:42:00+02:00 phoenix dinit[1]: Service early-fs-fstab.target command failed with exit code 64
2024-10-19T09:42:00+02:00 phoenix dinit[1]: service early-fs-fstab.target failed to start.

* edited do correct a typo

Re: early-fs-fstab.target and fsck failed

Reply #13
I noticed that the random-seed service is also failed; I started it (and it remains active).
After that I manually started the early-fs-fstab.target service; it did not bail out, but it did not finish starting either :

The command
Code: [Select]
dinitctl start early-fs-fstab.target
hangs indefinitely.

When interrogating dinit about the status of early-fs-fstab.target , I get this:
Code: [Select]
dinitctl status early-fs-fstab.target
Service: early-fs-fstab.target
    State: STARTING
    Activation: explicitly started

Re: early-fs-fstab.target and fsck failed

Reply #14
I have just updated to 0.19.1 and after issuing the command:

Code: [Select]
dinitctl status early.fs.fstab.target

I get the following output:

Code: [Select]
Service: early-fs-fstab.target
    State: STOPPED (dependency failed/terminated)

(from a root terminal btw)

Edited for typos.