systemd-fsck terminated by signal PIPE
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Raspbian |
New
|
Undecided
|
Unassigned |
Bug Description
I have my Raspberry Pi 4 configured to perform a file system check to both the SDCard and my external HDD using an USB enclosure which is connected to one of the USB 3.0 ports. Here's the cmdline.txt file and /etc/fstab:
cmdline.txt
``
root=PARTUUID=
``
/etc/fstab
``
proc /proc proc defaults 0 0
PARTUUID=
PARTUUID=
/var/lib/unifi/logs /var/log/unifi auto defaults,
PARTUUID=
/mnt/disk/
/mnt/disk/docker /var/lib/docker auto defaults,
``
However, the filesystem check for the HDD fails, with the following errors outputted to syslog, dmesg.log and journalctl -b:
```
systemd-fsck[308]: fsck terminated by signal PIPE.
systemd[1]: systemd-
systemd[1]: systemd-
systemd[1]: Failed to start File System Check on /dev/disk/
```
This was working correctly in Buster, but suddenly one day it stopped working: The fsck.ext4 process started running in the background until it finished but the drive wasn't mounted to /mnt/disk as it should.
I had no time at that moment to debug the issue and Bullseye was around the corner, so I decided to wait until Bullseye before re-enabling the filesystem check for the HDD. Yesterday, PiOS Bullseye was released and I re-enabled the filesystem check. Same problem as with Buster, so I decided to debug the issue.
After some digging using htop to see the startup process, I saw the following systemd-fsck processes running:
``
/sbin/fsck -y -T -l -M -f -C5 /dev/disk/
/lib/systemd/
fsck.ext4 -y -f -C5 /dev/sda1
``
Only ``fsck.ext4`` is taking up memory and CPU time at boot, so it confirms that it's the actual process performing the check while the others are waiting for results. After some time (2 min. aprox.), fsck.ext4 disappears and /sbin/fsck and systemd-fsck do it as well. *This is the point where the syslog, dmesg and journalctl log is written to the journal*.
I ran fsck.ext4 command manually in the following way (messages were translated from Spanish, sorry for the mispellings):
``
ferferga@pi:- $ sudo fsck.ext4 -y-f-C 5 /dev/sda1
Error al validar el descriptor de ficheros 5: Bad file descriptor
e2fsck: Invalid completion information file descriptor
ferferga@pi:- $ sudo fsck.ext4 -y -f /dev/sdal
e2fsck 1.46.2 (28-Feb-2021)
Paso 1: Verifying i-nodes, blocks and sizes
...
``
As you can see, the filesystem check went successfully as soon as I removed the ``-C5`` parameter. However, everything it's really strange because, as I said above, when system boots the fsck process is actually taking CPU time and memory, it's not exiting straightaway.
It's important to note that the drive passes all the filesystem checks and works perfectly, so I discard that fsck exists because the drive is corrupted or something like that. I also checked all the unit files of systemd-fsck and I'm not able to find where that parameter is appended by the systemd daemon, so I guess it's something that the binary itself decides. Honestly I'm not sure what else to check, but it looks like systemd-fsck rely in the -C parameter of fsck that it's not supported anymore.
Some other useful information:
Output of uname -a:
``
Linux pi 5.10.63-v7l+ #1459 SMP Wed Oct 6 16:41:57 BST 2021 armv7l GNU/Linux
``
Output of e2fsck:
``
e2fsck 1.46.2 (28-Feb-2021)
``
Output of fsck --version:
``
fsck from util-linux 2.36.1
``
Output of systemd --version:
``
systemd 247 (247.3-6+rpi1)
+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +ZSTD +SECCOMP +BLKID +ELFUTILS +KMOD +IDN2 -IDN +PCRE2 default-
``
Thank you very much in advance for all the support.