From my second fsck, I falsely get told "/: clean" almost instantly
without much happening unless I resort to the kluges I see Google
suggests e.g.
/sbin/tune2fs -c 5 -C 5 /dev/hd$v$n
That works, but I see tune2fs -c -C have side effects (that as yet I'm
too ignorant to understand or confidently undo) in:
/sbin/tune2fs -l /dev/hd$v$n
Is there actually no more direct way to tell fsck that I typed the
verb fsck because I actually do mean for fsck to run again, not just
echo the stale cached results of its last run?
I care because often when I force fsck to run again I find and fix
more trouble. Running again on demand saves me the time - and more
importantly the interaction - of rebooting.
Via Google I hear there is a tradition of fsck -y means yes I said
fsck because I meant fsck. But fsck -y doesn't work here.
Anybody know? How do I persuade fsck to run again? Here in
comp.unix.shell do I find people interested in this question, besides
me? Or is there a better place nearby?
Thanks in advance, Pat LaVarre
P.S. The exercise of writing this post suggest to me I could try
mounting and unmounting after fsck. While that writes who knows what
to my disk, it might often write nothing very harmful and yet still
persuade fsck to run again. Even so, I'd like to learn how to tell
fsck to run when I want it to run, for example so I can observe,
without actually asking to write anything, whether or not I do get the
same results twice in a row.
I assume from your suggested commands that you are using linux and
that you are using an ext2 filesystem.
RTFM for e2fsck and you will find that it takes a -f flag to do what
you want.
On my particular distribution (based on debian) if I pass a -f flag
to fsck, it gets passed on to e2fsck and does what you want.
Hope this helps
Adam
BTW this is a newsgroup about shell scripting on Unix and not
a Linux howto group, there are plenty of those about, but this aint
one.
-f Force checking even if the file system seems clean.
Remember that you should not fsck a filesystem that is mounted
read-write.
>
> Via Google I hear there is a tradition of fsck -y means yes I said
> fsck because I meant fsck. But fsck -y doesn't work here.
>
"-y" just tells fsck to assume a "y" answer to any question it might
otherwise ask.
--
Thanks to Nigeria, any email with the word "urgent" in the subject
or address will be deleted.
Precisely the answer I needed, thank you, I see my error was that I
read `man fsck`.
Can anyone say how I should have divined that e2fsck runs when I type
fsck? Now that kindly you folk have shared this answer with me, I
find such other hints as:
$
$ sudo /sbin/fsck --help 2>&1 | grep -- -f
-f Force checking even if filesystem is marked
clean
$
$ man fsck | egrep -i 'A..L..S..O|\([0-9]\)'
...
SEE ALSO
fstab(5), mkfs(8), fsck.minix(8), fsck.ext2(8) or
e2fsck(8),
fsck.xiafs(8).
...
$
$ ls -l /sbin/*fsck
-rwxr-xr-x 3 root root 44716 Feb 19 2003 /sbin/dosfsck
-rwxr-xr-x 3 root root 548792 Jan 24 2003 /sbin/e2fsck
-rwxr-xr-x 1 root root 20664 Jan 24 2003 /sbin/fsck
-rwxr-xr-x 1 root root 264668 Feb 6 2003
/sbin/reiserfsck
Pat LaVarre
You guess correctly, I'm too new to find this distinction clear and
precise and reproducible.
I am working not only in Linux but also in Mac OS X.
I am guessing comp.unix.shell is about more than just `man bash` and
`man csh` e.g. I am guessing `man which` is ok here too.
Also if there is an answer for what tells me to `man e2fsck` rather
than `man fsck`, I'm guessing that answer fits here too.
Also I think an answer fits here if there is an answer for feeding yes
to fsck despite fsck rejecting `yes | fsck` by design, other than my
own:
http://members.aol.com/plscsi/tools/1sh/
I agree teaching me about `man e2fsck` doesn't fit here, but I didn't
know `man e2fsck ; fsck -f -y / ; fsck -f -y /` was my answer til
after people here gave it to me.
> not a Linux howto group,
> there are plenty of those about,
I agree, this link as yet I am failing to click thru.
> ...
I hope to see us create a counterexample to my theory that all online
metadiscussion grows without bound.
Pat LaVarre
Anyway, many UNIX (and LINUX, etc.) implementations implement fsck as a
front end which just automagically calls the appropriate filesystem type
specific lower level fsck program (e.g. e2fsck, fsck.e3fs, fsck.ufs,
fsck.vxfs, ... whatever).
The best way to "divine" that information is examine the filesystem
type, and examine the fsck executable and/or source, to determine what
filesystem types it may automatically recognize, and how it does so and
deals with them. The fsck man page(s) may also have relevant
information and/or pointers.
> Precisely the answer I needed, thank you, I see my error was that I
> read `man fsck`.
>
> Can anyone say how I should have divined that e2fsck runs when I type
> fsck? Now that kindly you folk have shared this answer with me, I
> find such other hints as:
I'm not familiar with GNU/Linux, but `man -k fsck` should show you both commands.
--
Kevin Rodgers
> > I see my error was that I read `man fsck` ...
> > how ... should [I] have divined that e2fsck runs when I type fsck?
> > Now ... I find such other hints as:
>
> I'm not familiar with GNU/Linux, but `man -k fsck`
> should show you both commands.
Works superbly thanks.
This post ends with a log of `time man -k fsck`, that output includes
a [fsck] hint after e2fsck, sorry about the spurious line breaks that
free posting via google inserts.
Now that I know the answer, that hint reminds me that by typing fsck I
may run e2fsck. However, here `man man` of -k points to `man apropos`
which neglects to confirm my conjecture that [square brackets] around
a verb denote an alias.
Also now that I know the answer, I now see the SYNOPSIS usage line of
`man fsck` is meant to suggest `man e2fsck` after `man fsck`:
fsck [ -sACVRTNP ] [ -t fstype ] [filesys ... ] [--] [
fs-specific-
options ]
If you visually fix the line break after "fs-specific-", then you get
the word "fs-specific-options" which seemingly is meant to tell you to
`man e2fsck` after you `man fsck` when you're using the ext3 fs.
Also in the body of `man fsck` at the end of the DESCRIPTION we have:
"In actuality, fsck is simply a front-end for the various file
system checkers (fsck.fstype) available under Linux ... Please see
the file system-specific checker manual pages for further details."
Pat LaVarre
$
$ uname -msr
Linux 2.4.20-24.9smp i686
$ cat /etc/redhat-release
Red Hat Linux release 9 (Shrike)
$ time man -k fsck
dosfsck (8) - check and repair MS-DOS file systems
dosfsck [fsck] (8) - check and repair MS-DOS file systems
e2fsck (8) - check a Linux second extended file system
e2fsck [fsck] (8) - check a Linux second extended file system
fsck (8) - check and repair a Linux file system
fsck.jfs [fsck] (8) - initiate replay of the JFS transaction
log, and check and repair a JFS formatted device
reiserfsck (8) - check a Linux Reiserfs file system
xchkdmp (8) - dump the contents of a JFS fsck log file
created with xchklog
xchklog (8) - extract a log from the JFS fsck workspace
into a file
real 0m0.664s
user 0m0.600s
sys 0m0.020s
$
From man fsck:
In actuality, fsck is simply a front-end for the various file
system
checkers (fsck.fstype) available under Linux. The file
system-specific
checker is searched for in /sbin first, then in /etc/fs and
/etc, and
finally in the directories listed in the PATH environment
variable.
Please see the file system-specific checker manual pages for
further
details.
> The best way to "divine" that information is examine the filesystem
> type, and examine the fsck executable and/or source, to determine what
> filesystem types it may automatically recognize, and how it does so and
> deals with them. The fsck man page(s) may also have relevant
> information and/or pointers.
--
+ Regards, +
+ Nick +
+ +
+ My email address is real +