Archive for September, 2008

When OpenBSD boots it checks all file system with fsck in preen mode. In this mode fsck not only checks file systems but can also frepair minor problems such as:

  • Unreferenced inodes
  • Link counts in inodes too large
  • Missing blocks in the free map
  • Blocks in the free map also in files
  • Counts in the super-block wrong

All these problems are correctable without any data loss. However, when something more serious happens to your file system, fsck -p won’t even try repairing it, it will exit with an error and wait for the administrator to make the decision of what and how should be repaired. This means that the boot procedure will be stopped and the system will drop to shell and wait for manual intervention.

What an admin usually does to fix it at this time is to run fsck or fsck -y by hand. This requires console access to manually type these commands and respond to fsck’s prompts.

FreeBSD has an rc option called fsck_y_enable to automate this process so it doesn’t require manual intervention.

This simple patch adds something similar to OpenBSD’s rc script.