AutoFsckspec

Differences between revisions 3 and 4
Revision 3 as of 2007-04-22 22:15:57
Size: 5617
Editor: dD5764BF4
Comment:
Revision 4 as of 2007-04-23 01:35:25
Size: 6633
Editor: 203-173-155-88
Comment:
Deletions are marked like this. Additions are marked like this.
Line 77: Line 77:

  * I've seen this proposed somewhere else (I'm sorry I can't remember where), but the problem is that many users don't see the need for running fsck, and would skip it every time. I've lost count of the number of times I've called to work on a windows desktop with a really messed up filesystem because the user keeps cancelling the boot time scandisk. I appreciate your situation and understand why the AutoFsck implementation isn't right for you, but I'm not sure what would be the best alternative. I don't think many users want to wait at boot time. I wonder if it's possible to move the fsck to be done on shutdown and then have an option to cancel it. So in the dialogue which allows you to select Shutdown, Suspend etc, there's a little note when you're due for an fsck which says 'When you shut down your filesystem will be checked for errors, if this is not a convenient time, click the 'fast shutdown' button'. The 'fast shutdown' button would only need to be available when a disk check is due.

Introduction

This is not the main AutoFsck page, that is at the page AutoFsck. This page is the spec which is linked to by the Launchpad blueprint. If you wish to see end user information, or download and use AutoFsck, please visit the main page.

About

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.

Rationale

The automatic 30 mount fsck is time consuming, but needed. The problem is that the user never knows how close they are to hitting the 30 mounts, so the long boot delay may come at a very inconvenient time.

Use Cases

Peter doesn't know that he has not run fsck for a while. He has prepared a presentation with Open Office and just turned on his laptop to show it. When peter logs in, he is told that he has not run fsck in 25 boots and asked if he would like it to run when he shuts down his laptop. He knows he isn't in a rush after the presentation so he says yes. When peter shuts down his laptop later, it runs fsck and then powers down.

Jane is a student who runs Ubuntu on her laptop. She is late for a lecture and needs to get up and running quickly. When she logs in she is asked if she would like to run fsck when she shuts down, she will be rushing off to the next lecture and so wont have time to wait, she selects no. When she boots up her laptop for the next lecture she is prompted again, again she is in a rush and selects no. When she boots up her laptop in the evening, she is prompted a third time, and knowing that she has nowhere urgent to go later, says yes. When she shuts down her computer for the evening it runs fsck and powers down.

Melanie runs Ubuntu on her desktop. She needs to quickly copy a file to her USB drive to take to University with her, when she logs in she is asked if she wants the computer to run fsck when it shuts down, knowing that she is leaving the house and doesn't need it, she says yes. She copies the file and then shuts down the computer, as she leaves it is running fsck and shutting down.

NOTE: The prompt will not refer to fsck, but to checking disks for errors, or something equally user friendly.

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).

The project aim is to include AutoFsck in Gusty Gibbon (7.10)

Technical Details

[http://musther.googlepages.com/AutoFsck.tar.gz 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.

Feedback, Suggestions, Comments etc

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

Feedback/Discussion

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

  • I leave my laptop & desktop on for days or weeks, so I don't know at boot-time whether I will have time for 'fsck' at the next reboot or not. A dialog (even if it's a console dialog) that allows deferring 'fsck' at every boot sounds more like the correct solution to me... -- JanClaeys

    • I've seen this proposed somewhere else (I'm sorry I can't remember where), but the problem is that many users don't see the need for running fsck, and would skip it every time. I've lost count of the number of times I've called to work on a windows desktop with a really messed up filesystem because the user keeps cancelling the boot time scandisk. I appreciate your situation and understand why the AutoFsck implementation isn't right for you, but I'm not sure what would be the best alternative. I don't think many users want to wait at boot time. I wonder if it's possible to move the fsck to be done on shutdown and then have an option to cancel it. So in the dialogue which allows you to select Shutdown, Suspend etc, there's a little note when you're due for an fsck which says 'When you shut down your filesystem will be checked for errors, if this is not a convenient time, click the 'fast shutdown' button'. The 'fast shutdown' button would only need to be available when a disk check is due.

AutoFsckspec (last edited 2008-08-06 17:00:43 by localhost)