ext3-shutdown-forcedcheck

Differences between revisions 4 and 5
Revision 4 as of 2006-08-31 01:09:30
Size: 2987
Editor: 200
Comment:
Revision 5 as of 2006-08-31 01:42:27
Size: 2950
Editor: 200
Comment:
Deletions are marked like this. Additions are marked like this.
Line 35: Line 35:
This functionality will be incorporated into the umountfs and umountroot scripts.
Line 41: Line 43:
== Implementation ==

=== Basic ===

This functionality will be incorporated into the umountfs and umountroot scripts.

=== Advanced ===
Line 52: Line 46:

== Implementation ==

Summary

At shutdown, check which ext2/ext3/ext4 partitions need imminent check: mount count or limit date reached or about to be, so this almost never happens at boot time, thus avoiding 'losing the lottery'.

Rationale

The third extended filesystem (ext3) is Ubuntu's default partition type, and also Linux' one, so it is with good reason that people want to use it. The only reproach that can be done to it compared to its main competitor Reiserfs is that it regularly runs a check (every 30-odd mounts or 180 days).

The idea is to leverage this 'issue' by losing time at shutdown when the user has gone home or to sleep, rather than at boot time when he desperately needs to read that e-mail so he can go to his meeting that started 5 minutes ago...

Use cases

Scope

There are two levels of functionality envisaged here: basic and advanced.

Basic

A script will check the status of all ext2/ext3/ext4 partitions when they are being unmounted or re-mounted read-only and decide whether to check them.

Advanced

As an advanced feature, it would go as far as making sure it never needs to check all of them at once, to limit the shutdown postponing, by checking some ahead of time (maybe only for those in /etc/fstab).

Design

Basic

The code will look at ext2/ext3/ext4 partitions, get the limit date and number of mounts left for the next forced check (using 'tune2fs -l'). If the limit date is past or present, or if the mounts left are 0, the check occurs on the concerned partition(s).

This functionality will be incorporated into the umountfs and umountroot scripts.

Advanced

On top of the basic functionality, if no partition required checking, a list is created, ordered by mounts left and size (in this order, both ascending). If, for any entry, the partition order in the list exceeds the mount count left, the first partition in the list is checked and the script exits.

Why not check more? Well, we ideally want to check only one at a time, and some partitions might be mounted only occasionally, so let's not be needlessly greedy!

This functionality will be incorporated into the umountfs script only.

A simple and straightforward way to deal with / (which cannot be checked in umountfs) is to artificially set the mount count to max, to force umountroot into running the check.

Implementation

Code

Data preservation and migration

Outstanding issues

It maybe that we need a 'Plane shutdown' option to skip that and shut down quicker, although suspending to disk may work imminently (Edgy) and become the usual way to shutdown laptops when travelling for most of us...

BoF agenda and discussion


CategorySpec

ext3-shutdown-forcedcheck (last edited 2008-08-06 16:37:14 by localhost)