Tuning the Filesystem Check at Bootup October 12, 2005
Posted by Carthik in administration, applications, ubuntu.trackback
Ubuntu forces drives to be checked once for every 30 times the filesystem is mounted. This means that on an average, once every 30 times you bootup your computer, the filesystem integrity is checked. This is very reasonable for a desktop, which is seldom rebooted. However, for a laptop, this means pain, since you may be planning on making a presentation, and Ubuntu may start a filesystem check just when you hook up your laptop to the projector and bootup! Today we will see how to disable (or force) the checking temporarily, and also how to adjust the period and frequency of the check.
To disable filesystem integrity check for the next bootup, create a file called /fastboot. So a
$sudo touch /fastboot
will disable filesystem check for the next time you bootup. Since the /fastboot file is removed during bootup, this will disable filesystem check only once – for the one time you bootup after you create the /fastboot file (which need not have anything in it — hence the touch, which only creates the file)
On the contrary to force a filesystem check the next time you bootup, create a file called /forcefsck by doing
$sudo touch forcefsck
Now, on to the more interesting business of how to change the number of bootups between filesystem checks, and modifying the period with which the filesystem is checked. The following applies to ext2 and ext3 filesystems.
tune2fs is an utility that you can use to change both the number of bootups between filesystem checks, and the number of days/weeks/months between filesystem checks.
For example to have the filesystem checked once every 60 bootups use
$sudo tune2fs -c 60
To have the filesystem check run periodically, say once a week, use
$sudo tune2fs -i 1w
changing the “w” to “d” or “m” will have the check run once daily and once monthly – you get the idea.
As always, you can read
$man tune2fs
for more detailed information and examples.







Yes, the filesystem check got me the other day precisely when I was about to do a presentation. My laptop was already hooked up to the beamer so the crowd could see the filesystem check in progress. Slightly embarrassing.
The /fastboot is cute, but belongs to the kind of thing you forget before a presentation, so I don’t think it is terribly useful. Better than nothing, I agree. It would be much nicer if one could interrupt the checking process with some key combination.
You can stop the check by pressing ctrl+c, and then ctrl+d to continue with the bootup.
I assume the command should be
sudo touch /forcefsck
th@ubuntu:~$ sudo tune2fs -i 1w
Hi-thanks for the explanation but when I run the command you indicated, I get the following.
I have little experience with Ubuntu Breezy and any help would be much appreciated. My system runs fsck every single time I boot…
tune2fs 1.38 (30-Jun-2005)
Usage: tune2fs [-c max_mounts_count] [-e errors_behavior] [-g group]
[-i interval[d|m|w]] [-j] [-J journal_options]
[-l] [-s sparse_flag] [-m reserved_blocks_percent]
[-o [^]mount_options[,...]] [-r reserved_blocks_count]
[-u user] [-C mount_count] [-L volume_label] [-M last_mounted_dir]
[-O [^]feature[,...]] [-T last_check_time] [-U UUID] device
Hello, thierry, the right format for the command is (for example):
tune2fs -i 1w /dev/hda2
you must include the device at the end.
Thanks to you, the answer to my fsck question seems obvious now.Bye!
When I run this sudo tune2fs -i 1m /dev/hda1
I always end up with this error:
tune2fs 1.38 (30-Jun-2005)
tune2fs: Bad magic number in super-block while trying to open /dev/hda1
Couldn’t find valid filesystem superblock.
Its the same result for every partiton… Can you help me ?
I just found that tune2fs works on ext2 and ext3 file systems. I also have ntfs and fat32 filesystems, so I wondered if ubuntu scans those partitions too ?
thank you for the good tip
hi,
thnx for the tips. i am defiinitly no linux guru, and its not important to me bcos i only have a linux desktop, but isn’t there some other convenient way to arrange filesystem checks for such notebooks? cron scheduling or something?
perhaps i don’t understand exactly what is involved in the checks, but could it be done after boot as well?
[...] tune2fs how to AutoFsck post Bonager [...]
With Ubuntu 8.04 during startup it now gives you the option of pressing the Escape key to skip the file system check.
People should not get too carried away with bypassing the check though, it is there for a reason. The ext3 file system is remarkably reliable but nothing is perfect. The integrity check is important to do.
[...] | ubuntu wordpress y Fent [...]
[...] | ubuntu wordpress y Fent [...]
[...] it’s possible to change or even disable this completely, I personally find it most helpful to just have a little forewarning about when it’s going to [...]