Home page
Articles for Windows, Linux, OS X
Mac tips and articles
Mac tips
Windows 8 tips and articles
Windows 7 tips and articles
Vista Tips
XP Tips
Linux tips and articles
Read the blog
Online store
Windows, Linux, OS X programs

Linux tips and tweaks

Check the hard disk drive for errors

When starting your Linux PC you may have occasionally experienced a slow bootup. The reason is that the operating system is checking the hard disk drive for errors. It does this automatically and it may be set to check that the disk is OK every 20th or 30th boot up.

If you are having problems with your PC, Linux or an application, such as a crash or program freeze, you might want to check the hard disk drive for errors just to make sure that it is OK. The problem is, how do you force the operating system to check the disk right now without waiting for the next scheduled checkup, which could be 15 or 20 starts away? It is actually quite straightforward when you know how.

There is more than one way to do this and you can try both. First you need to open a Terminal window. The command you need is touch /forcefsck. It needs to be when logged in as root, so use su or sudo as necessary. For example, in Ubuntu type sudo touch /forcefsck. now just close the Terminal window and restart Linux.

Another way to force a disk check is to use the shutdown command with a couple of command line switches. Shutdown shuts down the PC as you might expect, but if you use the -r switch it restarts and if you also add -F then it forces a disk check. In Ubuntu, for example, you would type sudo shutdown -r -F now. The last parameter is when to shut down and now means right now (you could enter a number for the number of minutes to wait before shutting down). On my PC running Ubuntu this does indeed shut down and restart, but it doesn't run a disk check. Try it and see if it works on your PC.

Check for disk errors