I resolved that situation on TrueNAS SCALE and OpenMediaVault, which both build on Debian by removing every file md* inside
ls -R /usr/share/initramfs-tools/*|grep ^md
and update the init
and now no more time waiting for mdadm which randomly mount raid's
ps: I also took the time to remove every file which was pointed at btrfs, dm, lvm, ...
You can set the individual ext* file systems to require an fsck on every mount using
tune2fs -c 1 /dev/sda1 # replace with each device name
fsck.xfs is a no-op. It just returns true. No fsck.zfs exists. I haven't checked for other file system types. No systemd service is required.
Create the file /etc/systemd/system/MyFsckScript.service (feel free to replace "MyFsckScript", don't change the rest) with the following content:
Now run: systemctl enable fsck and ...
The impact of your startup scripts and the resulting setup will mostly affect interactive shells; to determine the resulting resource consumption, you don’t need to go to huge lengths. Open a terminal window, so that your default shell starts with its default setup, then start a shell without loading the startup scripts, and from that shell, run ps -F: