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 […]
Is there a way to force the filesystem checks, when they occur, not at BOOT time (when most of the time you are in a hurry to work) but at SHUTDOWN time (when you most of the time are not that much bothered if you have to wait) ? Thanks !
Yes, there is a solution for check the file sys on shutdown:
See this
https://wiki.ubuntu.com/AutoFsck
Good luck
Thank you ! 🙂
Very useful and detailed article. It was helpful for me.
Thanks a lot!
hey nice post thanx for it… i have got another problem related with it if u dont mind. I am using win xp and ubuntu 10.4 dual booting. I am okey with file system checks it does it sometimes without a problem with the ntfs partition and ubuntu partition but for the last check i got this message “The disk drive for /media/25C74B07FB07878 is not ready or not present continue waiting or press s to skip or M for manual recovery” i waited for it but nothing happened. Then now i have to press “s” to skip everytime. Do u have any ideas for this problem thanx in advance
I assume the command should be
sudo touch /forcefsck
As I site possessor I believe the content material here is rattling wonderful , appreciate it for your hard work. You have done a formidable job and our entire community will be grateful to you. You should keep it up forever! Good Luck. http://www.fakeray-ban.com.
Thanks sharing outstanding informations. Your current websiteis thus cool. We have been impressed by the main things that you’ve for this blog. The item reveals just how nicely anyone perceive this specific subject. I’m attracted to this fantastic website given and it has now presented me a dedication to have success for a number of purpose, and so thanks.You should keep it up forever! Good Luck. http://www.ray-banknockoff.com.
For a lot individuals now diet capsules are becoming a way of life. They come off them afterwards put the fat again on..
Supper.. Thanx…
hey come off them afterwards put the fat again on..
I must express some thanks to the writer just for rescuing me from this type of challenge. Just after looking through the search engines and meeting notions that were not powerful, I was thinking my entire life was well over. Being alive devoid of the solutions to the issues you have sorted out through your main site is a serious case, and the kind which might have in a negative way affected my career if I had not noticed your site. Your actual expertise and kindness in taking care of all things was invaluable. I don’t know what I would have done if I had not discovered such a solution like this. I’m able to at this time look forward to my future. Thanks very much for your skilled and amazing guide. I will not hesitate to endorse the blog to anybody who needs and wants support about this situation.