Mount filesystems after boot to avoid fsck delay for sshd

filesystemsfsckopenbsdstartup

I'm trying to optimise the overall downtime and improve availability in case of system failure.

I'm specifically concerned about the reboot (e.g. after a kernel panic) taking so long that I don't actually know if the system is or is not doing OK, since I don't have the serial console to a particular server.

What would be the proper way to mount all non-essential filesystems immediately after boot in OpenBSD, instead of prior to sshd?

I have about two dozen filesystems, what I'm thinking is that perhaps only the most essential ones should be fsck'ed and mounted first, then sshd be started, then all the rest are fsck'ed and mounted immediately afterwards.

What would be the best practice to do something like that?

Best Answer

Edit your /etc/fstab file so that the fourth field of the file systems you want to delay mounting have the noauto option set.

You can then set up a script that you either run manually, or set up in the rc scripts to run after SSH is started to fsck and mount the remaining file systems.

From reading the man page for OpenBSD /etc/fstab, you may also want to set the sixth field to 0 to stop any fsck of the file systems in question. It depends on whether you want to fsck them manually or not.

Related Question