[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: running fsck out of a script; drive never shows being checked



On Tue, Jun 08, 2004 at 08:51:51PM -0400, Silvan wrote:
> I'm wondering if I'm missing the point of something somehow.
> 
> I have a script that fscks hdb, then mounts it and makes a backup of hda.  I 
> run this as a nightly cron job, and it mails me a report every morning.
> 
> The associated bit of the script is:
> 
> echo running fsck on /dev/hdb partitions...
> echo start time: `date`
> 
> if ! (fsck -n /dev/hdb2); then
>     echo "ERROR!  Problem encountered running fsck on /dev/hdb2!"
>     echo "Abort, abort, abort!!!"
>     exit 1
> fi
> 
> echo end time: `date`
> 
> The most recent report (and the 41 before it) claim the drive has never been 
> checked.
<snip> 

It sounds like a "feature".  From bug#249116:

    Sender: Theodore Ts'o <tytso@thunk.org>
    <snip>

    So even if you fsck manually, in both cases, e2fsck will know when the
    fsck was last done.

    There's only one exception to this.  If you use e2fsck -n (or if you
    use fsck -n, which passes the -n option to e2fsck), this explicitly
    requests of e2fsck that **no** changes be made the the filesystem.
    This includes trying to fix any filesystem corruptions, but it also
    includes changing the superblock to the reflect the fact that e2fsck
    was run in the first place.

						    - Ted

-- 
Chris Harris <charris@rtcmarketing.com>
-------------------------------------------
GNU/Linux --- The best things in life are free.



Reply to: