AutoFsck

Differences between revisions 5 and 6
Revision 5 as of 2007-04-22 04:10:27
Size: 5647
Editor: 203-173-155-88
Comment:
Revision 6 as of 2007-04-22 04:42:03
Size: 5648
Editor: 203-173-155-88
Comment:
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
AutoFsck ensures that the automatic disk check will no longer inconvenience you by making you boot times very long. AutoFsck ensures that the automatic disk check will no longer inconvenience you by making your boot times very long.

AutoFsck is a set of scripts which automate periodic disk checking in such a way that it no longer bothers the user every 30 boots, and is streamlined in a friendly graphical user interface.

AutoFsck ensures that the automatic disk check will no longer inconvenience you by making your boot times very long.

How Does it Work?

It's really very simple. A record is kept of how many times your computer boots, and every time a user logs in this record is checked. If the record shows that your computer has booted less than 25 times, nothing happens, the user does not see anything. If however, the record shows that your computer has booted 25 times or more, you are presented with a question box, asking if you want to check your disks. If you select no, the system is set to ensure that it will not check your disks on the next boot (in case you need your computer in a hurry), after the next boot you will be asked again, and again, until you agree to have your disks checked. When you say yes, your disks are not checked immediately, but will be checked when you shut your computer down.

After 25 boots, you are presented with this dialogue upon login:

http://musther.googlepages.com/autofsckdb.png

Download

[http://musther.googlepages.com/AutoFsck.tar.gz Click here to download AutoFsck v1.0] - see below for installation instructions.

Installation

Installing AutoFsck is easy:

  • Download the archive from the link above. Save it somewhere that you can find it again, I suggest downloading to your desktop.
  • Right click on the file and choose 'Extract Here'.
  • Double click on the newly created folder AutoFsck

  • Inside that folder you will see five files, double click on the one called 'install'
  • When prompted to either select the 'Run' button.
  • Follow the on screen instructions
  • When the installation has finished, close the folder AutoFsck and then delete 'AutoFsck' and 'AutoFsck.tar.gz' from your desktop.

  • You're done! I hope you find AutoFsck useful.

Further Information About AutoFsck

AutoFsck was created by Jonathan Musther (jmusther@gmail.com), it is released under the [http://www.gnu.org/copyleft/gpl.html GNU General Public License], please use it and modify it as you want to.

It was designed specifically for Ubuntu, and has so far been tested on:

  • Ubuntu 6.06LTS - The Dapper Drake
  • Ubuntu 6.10 - The Edgy Eft
  • Ubuntu 7.04 - The Feisty Fawn

If you know of other systems on which AutoFsck works, Ubuntu or otherwise, please add them here.

AutoFsck is likely to work on any GNU/Linux system which uses GDM (the Gnome Display Manager) for its graphical login, but it will not currently work on Kubuntu, Xubuntu or other non-Gnome based systems. Support for KDE and other desktop environments is something I plan to work on.

Inclusion in Ubuntu

From the activity on the forums regarding the annoyance of the forced disk checks, I feel that AutoFsck, or at least something with it's functionality should be included in the main Ubuntu Distribution as a dependency of Ubuntu-Desktop (as it is of dubious use on the server etc).

If you (the users) agree, please help me promote AutoFsck and get it included in the next release - 7.10 The Gusty Gibbon.

Feedback, Suggestions, Comments etc

If you have any feedback, suggestions or comments, please post them below or email me; jmusther@gmail.com

Feedback/Descussion

  • I'm looking for somebody to create an AutoFsck.deb for Ubuntu, if there are any takers, please email me.

Technical Details

AutoFsck.tar.gz contains five files:

  • AutoFsck

  • Default
  • install
  • mountcount
  • readme

We can discount readme and install, and focus on the others.

mountcount is copied to /etc/init.d/mountcount.sh and called by init every time the system boots, it increments a file (/usr/share/mountcount) by 1 ever time.

AutoFsck is copied to /etc/X11/gdm/PostLogin/AutoFsck and is called by Default, which is copied to /etc/X11/gdm/PostLogin/Default. The reason for Default calling AutoFsck is that people may wish to include other commands in Default.

Default is called (as root) by gdm after a successful login and before the session is started, the content of /usr/share/mountcount is evaluated, and if below 25, the script exits. If the value is 25, the script uses zenity to ask the user if she wants to schedule disk checks to occur at shutdown.

If the user says no, the script issues the command: touch /fastboot which will prevent disk checks on the next boot, the script then exits.

If the user says yes, the script issues the command: touch /forcefsck which will force disk checks on the next boot, it then creates another script which will cause the system to restart rather than shut down (when commanded to do so), and yet another script which causes the computer to shut down immediately after booting. At this time /usr/share/mountcount is also reset to 0.

The upshot of this is that when the user shuts down her computer, the following takes place.

  • System starts to shut down, moves to the appropriate init level and runs scripts
  • First generated script is run, it removes itself and sends the system to init 6 - restart
  • The system restarts, and because of /forcefsck it checks the disks
  • When it reaches the appropriate init level it executes the second generated script which sends the system to init 0 - halt, and then removes itself.
  • The system halts.

All checks are done and the system is powered down. The cycle is ready to continue again.

AutoFsck (last edited 2011-11-24 01:58:57 by cpe-76-167-227-87)