If the raspberry pi doesn't shut down cleanly, it forces a fsck at boot. My filesystem is on a 64GB micro SD card and it takes quite a while to fsck. But before that can finish a couple of services timeout, so it ends up in emergency mode. This even though the filesystem is really fine.
This is a problem for me because I want this raspberry pi to run unattended and headless. If it goes into emergency mode after a power outage it'll just disappear from the network and I won't be able to do anything about it until I can physically access it again. Raspbian shouldn't require that much care and attention.
I can reproduce the problem by forcing it to check the filesystem with "sudo tune2fs -c 10 -C 15 /dev/mmcblk0p2". (If you do this, note that this causes it to always go to emergency mode. So make sure you can log in to the console to switch it back again with "sudo tune2fs -c -1".)
Googling the problem, it seems that some other people have run into this:
It's also been suggested that the fsck is unnecessary:
But since this is my root filesystem I can't remove it from fstab. I tried adding "noauto,x-systemd.automount" to the options in fstab, but it didn't change anything.
Does anyone have a recipe for any of these?
- lengthening the timeout
- preventing an fsck on startup
- preventing the filesystem being marked as dirty on unexpected power loss