Andrew Latham

Hard Disk Drive Checks on Headless or Remote Servers

The Problem

Setting up remote servers or even local servers that have no keyboard or monitor often called headless requires some thought. File system and hard disk drive checks for example can be troublesome. During start up of any modern Linux distribution a check for the number of mounts or duration since the last check can cause a complete disk inspection often called fsck or file system checker. This is a perfectly normal and safe thing for all systems. If you do not have access to the server or headless system you may not be able answer questions for the fsck program if it finds an issue. Very often one simple press of the Y key is all you need to do. If your server is hundreds of miles away or does not have an easy method of attaching a keyboard this is difficult.

The Solution

In Modern Debian distributions you can change this in the /etc/default/rcS file. Change FSCKFIX=no to FSCKFIX=yes. You can read more about this in the /etc/init.d/ and /etc/init.d/ and see what happens during startup. In Redhat based systems and others it is also very easy configure by creating the file /etc/sysconfig/autofsck and adding AUTOFSCK_TIMEOUT=5 and AUTOFSCK_DEF_CHECK=yes to the file.