On Sat, Jun 14, 2008 at 09:02:01PM +0200, David wrote:
> Package: e2fsprogs
> Version: 1.40.8-2
> Severity: wishlist
> 
> 1) Let users cleanly interrupt fsck
> 
> If users hit ctrl+c (or maybe ESC), fsck should guarantee that the
> filesystem is in a relatively safe state before terminating.
> 
> fsck probably does do this already, but some users on the threads
> weren't sure, and thought that hitting ctrl+C might be an unsafe
> operation.

"man e2fsck.conf".   Short version; place in /etc/e2fsck.conf:

[options]
        allow_cancelation = true

At this point, it is up to whatever system (sysvinit, upstart),
etc. to allow a ^C to be passed to the fsck process, but as long as it
receives a SIGINT signal, it will do the right thing.

> 2) Allow 'info gathering' fsck mode, while partition is mounted r/w.
> 
> 2.1) Let fsck (or some related utility) scan for errors while the
> partitions are mounted read/write. This will probably find a lot of
> bogus errors. This can be run in the background by the desktop
> environment, while the user is logged in.

You can't really do the 'info gathering' thing with the hopes of
speeding up a read/write check, but what you *can* do is check for
errors, and if the filesystem is clean, reset the last fsck and number
of mounts since last fsck count.  This requires that the filesystem be
located on an LVM volume, however.  The shell script to do this is
attached.  It is suitable for running out of a cron job, or from a
desktop session while the user is logged in.

This also answers your wishlist from sysvinit:

>3) Let the user run fscks (scheduled or user-forced) at other times
>besides boot

Regards,

                                                - Ted

#!/bin/sh

VG=closure
VOLUME=root
SNAPSIZE=100m
[EMAIL PROTECTED]

TMPFILE=`mktemp -t e2fsck.log.XXXXXXXXXX`

set -e
START="$(date +'%Y%m%d%H%M%S')"
lvcreate -s -L ${SNAPSIZE} -n "${VOLUME}-snap" "${VG}/${VOLUME}"
if nice logsave -as $TMPFILE e2fsck -p -C 0 "/dev/${VG}/${VOLUME}-snap" && \
   nice logsave -as $TMPFILE e2fsck -fy -C 0 "/dev/${VG}/${VOLUME}-snap" ; then
  echo 'Background scrubbing succeeded!'
  tune2fs -C 0 -T "${START}" "/dev/${VG}/${VOLUME}"
else
  echo 'Background scrubbing failed! Reboot to fsck soon!'
  tune2fs -C 16000 -T "19000101" "/dev/${VG}/${VOLUME}"
  if test -n "$RPT-EMAIL"; then 
    mail -s "E2fsck of /dev/${VG}/${VOLUME} failed!" $EMAIL < $TMPFILE
  fi
fi
lvremove -f "${VG}/${VOLUME}-snap"
rm $TMPFILE




-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to