Posted by: Odzangba | November 26, 2007

Skip Forced Disk Check At Boot on Ubuntu

Last week, I expressed my distaste for the way Ubuntu (and most linux distros) forces disk checks on users. I got even more irritated by this ridiculous behaviour this week when I reinstalled Ubuntu 7.04 on my sister’s laptop… it was actually a downgrade from 7.10 and I might go into the reasons behind that in a later post. Anyway, she dual boots with MS Windows on a 120GB hard drive and her disk structure is your typical dual boot kind – 20GB ntfs partition for windows, 15GB ext3 partition with a 2GB swap partition for Ubuntu, and an 80GB fat32 data partition. After the installation, ubuntu started forcing a disk check on the 80GB partition AT EVERY BOOT. That increased the boot time to something like four minutes. This is intolerable on an intel core 2 duo with 1GB of RAM… even my old pentium II takes 1 minute 15 seconds to become fully armed.

In last week’s post, I described how to use the tune2fs utility to  influence the system’s decision to force a disk check on ext3 file systems; that utility is useless with FAT32 file systems. There is a simpler way of doing this and it involves editing that sweet little configuration file – /etc/fstab. That’s the file that controls how most of your storage devices are mounted. A typical line in this file looks like this:

UUID=cd26de7d-85ff-48cd-9d52-9a02bf4ff078    /     ext3    defaults     0       1

We’re concerned only with the last digit because that is the information ubuntu uses to decide whether to force a disk check or not. A value of zero means do-not-check and any other positive number tells the system to check that storage device at boot. So all I had to do was to change the “one” to “zero” and the forced check was disabled. Since checking your disks regularly is a good idea, I set up a cron job to do that once a week… the world was a sweet place again. 😀


Responses

  1. Good job. Its typical for you to always find neat solutions to every day linux problems. Since i do not digg up such info, relying on your blog in referrence to these kind of issues goes down well with me. Hope you keep it up.

  2. Thanks for the compliment bbaka, I’ll keep up the linux spirit

  3. Thank you for this post 🙂 I will try that now. I have a 1TB drive and about 4 other large drives on a server and it really peeved us the other day waiting for the dang thing to reboot.. Can you imagine how long all those huge disks took? Even if that that happens just once in a blue moon, we still needed to speed it up. Murphy’s Law being what it is, you will need to reboot at the worst possible time.

    What are you running in your cron job?
    presumably fsck.. What parameters do you suggest? How do you report on errors found?

  4. hello this is very useful tip.

    do you know how to skip/cancel the disk check once it started & continue booting normally?

    i had similar issue on my debian machine. i booted from an UBUNTU Live CD
    , edited the /etc/fstab & put “pass 0” on the Debian found on the hard disk.

    This solved the issue.

    But am looking a way to do it on the spot once it starts.This disk check is annoying.

    My Email: vicky (at) linuxmail (dot) org

  5. Great job, that was to the point 😀


Leave a comment

Categories