jump to navigation

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.

Comments»

1. foobar - January 24, 2006

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.

2. Carlos Javier - February 12, 2006

You can stop the check by pressing ctrl+c, and then ctrl+d to continue with the bootup.

3. Anand - February 26, 2006

I assume the command should be
sudo touch /forcefsck

4. thierry (switzerland) - March 25, 2006

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

5. C0r3Dump - April 28, 2006

Hello, thierry, the right format for the command is (for example):

tune2fs -i 1w /dev/hda2

you must include the device at the end.

6. thierry - June 13, 2006

Thanks to you, the answer to my fsck question seems obvious now.Bye!

7. milke.kv - July 9, 2006

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 ?

8. milke.kv - July 10, 2006

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 ?

9. renaud - July 29, 2006

thank you for the good tip

10. stairwayoflight - August 5, 2006

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?

11. The 1420N Blog » Annoying 30th Boot FSCK - January 18, 2008

[...] tune2fs how to AutoFsck post Bonager [...]

12. codeslinger - August 4, 2008

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.

13. Tip: Cambiar el numero de arranques necesario para forzar el chequeo de integridad del sistema de archivos « Ubuntu Life - November 26, 2008

[...] | ubuntu wordpress y Fent [...]

14. Tip: Cambiar el numero de arranques necesario para forzar el chequeo de integridad del sistema de archivos « Yo Soy Linux! - January 19, 2009

[...] | ubuntu wordpress y Fent [...]

15. Prior warning about Ubuntu’s disk checks « ændrük - May 2, 2009

[...] 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 [...]

16. Goodbye Windows - March 17, 2010

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 !

17. artur.szilagyi - April 16, 2010

Yes, there is a solution for check the file sys on shutdown:
See this

https://wiki.ubuntu.com/AutoFsck

Good luck

Goodbye Windows - April 16, 2010

Thank you ! :-)

18. Arian - May 16, 2010

Very useful and detailed article. It was helpful for me.
Thanks a lot!

19. aenesias - August 22, 2010

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

20. seks izle - September 29, 2010

I assume the command should be
sudo touch /forcefsck

21. andy mike - July 6, 2011

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.

22. rayban111025 - July 6, 2011

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.

23. webchat - September 11, 2011

For a lot individuals now diet capsules are becoming a way of life. They come off them afterwards put the fat again on..

24. Chat - November 13, 2012

Supper.. Thanx…

25. Sohbet - November 13, 2012

hey come off them afterwards put the fat again on..


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 545 other followers

%d bloggers like this: