How do I schedule FSCK to run automatically?

Using cron to schedule an FSCK

By default, a fsck is forced after 30 reboots or 180 days.

To avoid issues such as this, we recommend scheduling fsck to run a basic weekly check on your server to identify and flag errors. Doing so can prevent unwanted, forced fsck from running in situations such as this one. You can then, plan for a time at which a full system fsck is run.

For more info on running fsck please click here.

For more info on scheduling tasks under Linux click here.

The following example syntax will add a weekly scheduled 'scan-only' fsck and output the results to a log file for review.

crontab -e

enter the following text substituting *partition* with your root partition.

@weekly fsck -nv /dev/*partition* > /var/log/weekly_fsck

When saving, do not change the existing file name.

PLEASE NOTE- This does not eliminate the need for a fsck, You will still need to schedule a manual fsck so any issue that are found can be corrected.

To Force a fsck using shutdown command

 # shutdown -rF now

Bypass a fsck using shutdown command

 # shutdown -rf now

Note: Capital F will Force a FSCK, lowercase f skips a FSCK.

FSCK will sometimes require the root password be entered on the console in order to repair some issues with the filesystem, contact our support department if your server does not respond after a reboot

  • 2 Users Found This Useful
Was this answer helpful?

Related Articles

How do I bind my additional IPs?

These instructions are for CentOS / Fedora specifically.By default, we only binds your first...

How do I run a traceroute?

Both Windows and Linux have the ability of diagnosing the health of a connection between a source...

Why is cPanel/WHM not loading?

There are two main reasons why cPanel/WHM isn't loading that we've seen.Brand New ServerIf you...

How to install cPanel on CentOS

Installation Notes A CentOS or Red Hat server that is going to have cPanel installed needs a...

How do I set the Primary Interface in WHM?

Under Basic cPanel/WHM Configuration, there is an area called Primary Interface. By default, if...