6

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?

4

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.

  • Thanks for the idea about the sixth field, I almost forgot about it! I'll still looking for what would be the most proper way to implement this; specifically, it looks like the fsck -p, which is what the rc script calls, is not really documented whether it cares about noauto or not. E.g. it looks like my /mirrors partition, which I've already marked as noauto back in the day, might actually be delaying the boot due to having a non-zero sixth field. – cnst Jul 2 '14 at 18:41
3

I believe that adding nobootwait to the fstab entries would work, but openbsd may not implement that. mountalll, used with Upstart, does. I think systemd does too.

  • Thanks for the idea! I believe it might be GNU/Linux-specific, but it's nonetheless interesting to see how other systems have solved this issue. – cnst Jul 2 '14 at 18:43
1

Remove/comment the entries in /etc/fstab which you to want to avoid automatic mount while booting. Then make a entry in /etc/rc.local file in the complete mount command format

1

Mount them read-only, when possible, and the fsck won't be necessary.

But you really need to be more specific (what partitions are you talking about? Were's just guessing without an fstab) and especially understand that things happen like that for a reason. E.g. sshd is on /usr and your user profile is on /home. Assuming these are separate partitions, what's the point of starting sshd if both of the filesystems are dirty?

Your problem isn't when these partitions are checked, it's how long they take to be checked. There are a few options on making these checks quicker: change the density of inodes (newfs -i), mark /usr as read-only (and mount -uw if needed, e.g. when installing packages) and split very large partitions into smaller ones, etc...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.