I have a headless Ubuntu 12.04 server in a datacenter 1500 miles away. Twice now on reboot the system decided it had to fsck. Unfortunately Ubuntu ran fsck in interactive mode, so I had to ask someone at my datacenter to go over, plug in a console, and press the Y key. How do I set it up so that fsck runs in non-interactive mode at boot time with the -y
or -p
(aka -a
) flag?
If I understand Ubuntu's boot process correctly, init invokes mountall which in turn invokes fsck. However I don't see any way to configure how fsck is invoked. Is this possible?
(To head off one suggestion; I'm aware I can use tune2fs -i 0 -c 0
to prevent periodic fscks. That may help a little but I need the system to try to come back up even if it had a real reason to fsck, say after a power failure.)
In response to followup questions, here's the pertinent details of my /etc/fstab. I don't believe I've edited this at all from what Ubuntu put there.
UUID=3515461e-d425-4525-a07d-da986d2d7e04 / ext4 errors=remount-ro 0 1
UUID=90908358-b147-42e2-8235-38c8119f15a6 /boot ext4 defaults 0 2
UUID=01f67147-9117-4229-9b98-e97fa526bfc0 none swap sw 0 0
/etc/default/rcS
are not really valid in 2019, with Ubuntu 16 and Ubuntu 18 now using systemd. I don't know the full story for systemd but thefsck.repair
configuration / kernel command line option seems relevant. The docs currently say its default ispreen
, which means-p
. It can also be set toyes
for-y
./etc/default/grub
may be the place to set this. I'd be grateful if someone more knowledgeable would provide a modern systemd answer.