Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Proper way to do a FSCK?

0 views
Skip to first unread message

Russ Allbery

unread,
Mar 4, 1999, 3:00:00 AM3/4/99
to
Jeff Gostin <jgo...@shell2.ba.best.com> writes:

> I'd like to do a real, full fsck of /dev/hda3. It's a flat filesystem,
> so if I can fsck it, it'll get the entire shebang. I've tried it from
> runlevel 3 (I just wanted to see if there were errors, I wasn't going to
> fix them yet), and all I got was a "clean" message. It didn't actually
> go through the entire scan.

fsck -f. You have to look in the e2fsck(8) man page to find the option
because it's ext2fs-specific and fsck is just a driver (and the man page
is unintuitively named something different than the actual program).

--
Russ Allbery (r...@stanford.edu) <URL:http://www.eyrie.org/~eagle/>

Richard Kettlewell

unread,
Mar 4, 1999, 3:00:00 AM3/4/99
to
Jeff Gostin <jgo...@shell2.ba.best.com> writes:

> I'd like to do a real, full fsck of /dev/hda3. It's a flat
> filesystem, so if I can fsck it, it'll get the entire shebang. I've
> tried it from runlevel 3 (I just wanted to see if there were errors,
> I wasn't going to fix them yet), and all I got was a "clean"

> message. It didn't actually go through the entire scan. I tried it
> from single user as well (init s), with the same result. I also
> tried to "mount -o remount,ro /", knowing it'd probably fail, then
> tried it again, with no change in results.

Have you tried the -f option to fsck? (See the man page for e2fsck or
fsck.ext2, depending.)

> What I'm -trying- to get is a full fsck, as if the FS weren't
> unmounted cleanly. Why? Because I think I've got bad blocks, and
> would -really- like to keep it from trashing my -entire- FS.

But you've got backups, right?

My understanding is that once a (modern) hard disc starts to actually
show up errors its well on its way to being completely unusable.
BICBW.

Tony Finch

unread,
Mar 4, 1999, 3:00:00 AM3/4/99
to
Richard Kettlewell <rich...@chiark.greenend.org.uk> wrote:
>
>My understanding is that once a (modern) hard disc starts to actually
>show up errors its well on its way to being completely unusable.

IME that is what happens. As soon as we start seeing errors on a
disk it's round filing cabinet time for it.

(Gods, I wish we had RAID on more of the servers.)

Tony.
--
f.a.n.finch d...@dotat.at fa...@demon.net

Matthew E Cross

unread,
Mar 4, 1999, 3:00:00 AM3/4/99
to

In article <36dea6c6$0$2...@nntp1.ba.best.com>,
Jeff Gostin <jgo...@shell2.ba.best.com> wrote:
>
>Oh well. I tried "fsck -f /dev/hda3" from single-user, and surprise of
>surprises, nothing is awry according to it. Now I'm becoming a bit
>concerned. Either the problem is sporadic (see my response to Richard's), or
>it's marginal enough that fsck doesn't care, but some lower level (device
>driver?) does.

AFAIK, fsck does not attempt to read all the data blocks on a disk, only the
meta-blocks, like directories and inodes (or whatever they're called in ext2).
And I can almost guarantee that it doesn't read unused blocks. I'm not sure
if fsck has an option to do a full surface scan.

Though I suspect that your problem is either a kernel/driver bug or some
other hardware problem. I've seen this happen on systems with poorly
terminated SCSI buses or flaky cabling.

Is there something in particular that usually triggers the problem? How
can you reproduce it? Once you can reproduce it, then you can try
changing things (such as cabling, termination, or swapping controllers)
until you can no longer reproduce it.

Good luck,
-Matt


Mark Ferguson

unread,
Mar 4, 1999, 3:00:00 AM3/4/99
to
In article <36dea6c6$0$2...@nntp1.ba.best.com>,
Jeff Gostin <jgo...@shell2.ba.best.com> wrote:
>Russ Allbery <r...@stanford.edu> wrote:
>: fsck -f. You have to look in the e2fsck(8) man page to find the option

>: because it's ext2fs-specific and fsck is just a driver (and the man page
>: is unintuitively named something different than the actual program).
>
>Silly linux man pages. BLAH. :/

>
>Oh well. I tried "fsck -f /dev/hda3" from single-user, and surprise of
>surprises, nothing is awry according to it. Now I'm becoming a bit
>concerned. Either the problem is sporadic (see my response to Richard's), or
>it's marginal enough that fsck doesn't care, but some lower level (device
>driver?) does.
>

You could have faulty memory, which can be difficult to
test, or possibly your disk problems live in your swap space
and not the regular file system.

--
Mark Ferguson <Mark.F...@Stanford.EDU>

David Damerell

unread,
Mar 4, 1999, 3:00:00 AM3/4/99
to
Jeff Gostin <jgo...@shell2.ba.best.com> wrote:
>Well, that's the wierd part. I don't get errors in syslog/messages about bad
>blocks, though it sure -feels- like bad blocks. If I attempt to call up a
>particular binary, the system'll sit there thinking about it for a while.
>While this is happenning, anything that attempts to read or write to the
>disk _appears_ to hang. The system doesn't appear to be locked up, as I can
>still do things, as long as they don't need disk IO. It sounds like the
>drive's trying to read,

As regards the sound; can you hear (perhaps with the case off) if it is
spinning down and then back up again?
--
David/Kirsty Damerell. dame...@chiark.greenend.org.uk
| |I hear the fan of a big machine, Two days, I'm in between, break; | |
|---|lost, code fall through, Loop forever then process kill. Hermes is|---|
| | |broken and lyra's down, lyra's down. "Chimaera, my Nameserver"| | |

Bill Cole

unread,
Mar 4, 1999, 3:00:00 AM3/4/99
to
In article <36dec8d8$0$2...@nntp1.ba.best.com>, Jeff Gostin
<jgo...@shell2.ba.best.com> wrote:

>Matthew E Cross <prof...@sidehack.sat.gweep.net> wrote:
>: Though I suspect that your problem is either a kernel/driver bug or some


>: other hardware problem. I've seen this happen on systems with poorly
>: terminated SCSI buses or flaky cabling.
>

>I wouldn't rule that out at all. The cable's been reseated, as has the power
>"d-connector". It's straight EIDE into the primary EIDE "bus", and is the
>only thing on its chain.
>
>: Is there something in particular that usually triggers the problem? How


>: can you reproduce it? Once you can reproduce it, then you can try
>: changing things (such as cabling, termination, or swapping controllers)
>: until you can no longer reproduce it.
>

>Not really, no. Well, I shouldn't say that. This one particular binary has
>the problem (there may be more, I haven't found them). I'll try loading it
>again and see what happens. However, this same binary has loaded without a
>problem in the past. I know, things change. Just giving another data point
>-- that, at one point, this was "Fine". :)


Having read the whole thread to this point, I am simply shocked not to
have run across other people suggesting:

1. badblocks. See the man page. You can theoretically make ext2fsck take
the badblocks output as input and force-remap stuff. Then drop a couple
hundred on a new disk and dump the whole old dying disk to it.

2. You did check the jumpers on the drive after pulling the other one,
right? Some disks have 4 settings: cable select, slaveless master, master
with slave, and slave. This would be a slaveless master. It sounds like it
had been a master with slave. I think thry is that some IDE subsystems
with the right cable can autoconfigure this stuff, but I've never seen it
work. <#include "IDE is crap rant">

--
Bill Cole


Russ Allbery

unread,
Mar 4, 1999, 3:00:00 AM3/4/99
to
Matthew E Cross <prof...@sidehack.sat.gweep.net> writes:

> AFAIK, fsck does not attempt to read all the data blocks on a disk, only
> the meta-blocks, like directories and inodes (or whatever they're called
> in ext2). And I can almost guarantee that it doesn't read unused
> blocks. I'm not sure if fsck has an option to do a full surface scan.

badblocks. But the man page says frightening things about how it's not
maintained, was only tested against some ancient version of Linux, etc.

Kai Henningsen

unread,
Mar 4, 1999, 3:00:00 AM3/4/99
to
prof...@sidehack.sat.gweep.net (Matthew E Cross) wrote on 04.03.99 in <7bmajs$pfv$1...@sidehack.sat.gweep.net>:

> In article <36dea6c6$0$2...@nntp1.ba.best.com>,


> Jeff Gostin <jgo...@shell2.ba.best.com> wrote:
> >
> >Oh well. I tried "fsck -f /dev/hda3" from single-user, and surprise of
> >surprises, nothing is awry according to it. Now I'm becoming a bit
> >concerned. Either the problem is sporadic (see my response to Richard's),
> >or it's marginal enough that fsck doesn't care, but some lower level
> >(device driver?) does.
>

> AFAIK, fsck does not attempt to read all the data blocks on a disk, only the
> meta-blocks, like directories and inodes (or whatever they're called in
> ext2). And I can almost guarantee that it doesn't read unused blocks. I'm
> not sure if fsck has an option to do a full surface scan.

It has an option to run badblocks as a subprocess. The man page should
tell how. Read it. That's what it's there for.

> Though I suspect that your problem is either a kernel/driver bug or some
> other hardware problem. I've seen this happen on systems with poorly
> terminated SCSI buses or flaky cabling.

/dev/hda3 would be an IDE, not a SCSI, drive. Places to check: BIOS IDE
config, any calls to hdparm, and of course the IDE driver config in the
kernel, especially with regard to chipset bugs (there are quite a number,
it seems).

Kai
--
http://www.westfalen.de/private/khms/
"... by God I *KNOW* what this network is for, and you can't have it."
- Russ Allbery (r...@stanford.edu)

David Damerell

unread,
Mar 5, 1999, 3:00:00 AM3/5/99
to
Jeff Gostin <jgo...@shell2.ba.best.com> wrote:
>David Damerell <dame...@chiark.greenend.org.uk> wrote:
>: As regards the sound; can you hear (perhaps with the case off) if it is

>: spinning down and then back up again?
>As it happens, the case is off. It doesn't sound like it's spinning down
>then up. At least, it doesn't /sound/ like it is. Are you thinking of a
>"power save" feature?

No. I'm asking random silly questions which might have very interesting
answers. 'Guessing', as we call it in the tech support line of work.
--
David/Kirsty Damerell, dame...@chiark.greenend.org.uk. All Hail Discordia!
| | And then they came and took me out, The men of doom and malice: | |
|---|Destroyed my life, removed my sense, Gave me the poisoned chalice.|---|
| | | My betrayal's life to me... Elder Sign: Treachery | | |

Jim Kingdon

unread,
Mar 5, 1999, 3:00:00 AM3/5/99
to
> I'll look into badblocks. The man page seems to indicate the use of that
> program is risky, at best, due to lack of testing. Does it work ok?

In my experience, it seems to (that is, the disk for which badblocks
reported problems really is having them, as far as I know).

I also think that the Red Hat install calls badblocks if you check the
little box for that. So in summary, as far as I know the man page is
out of date.

I could be wrong on all of this, I'm sure asking on one of the Red Hat
lists, or some place like that, would be more likely to find someone
who knows a bit more about this.

Mark Baker

unread,
Mar 18, 1999, 3:00:00 AM3/18/99
to
In article <bill-04039...@192.168.1.1>,
bi...@scconsult.com (Bill Cole) writes:

> 2. You did check the jumpers on the drive after pulling the other one,
> right? Some disks have 4 settings: cable select, slaveless master, master
> with slave, and slave. This would be a slaveless master. It sounds like it
> had been a master with slave. I think thry is that some IDE subsystems
> with the right cable can autoconfigure this stuff, but I've never seen it
> work. <#include "IDE is crap rant">

You know how floppy drives have the half-twisted cable? Essentially, that's
what IDE cable select does. I've never seen a suitable cable anywhere,
though, and since you have to change a jumper to put the drive into cable
select mode I'm not sure what it gains you.

Peter da Silva

unread,
Mar 19, 1999, 3:00:00 AM3/19/99
to
In article <7crl1j$68j$1...@aziraphale.demon.co.uk>,

Mark Baker <ma...@aziraphale.demon.co.uk> wrote:
>You know how floppy drives have the half-twisted cable? Essentially, that's
>what IDE cable select does. I've never seen a suitable cable anywhere,
>though, and since you have to change a jumper to put the drive into cable
>select mode I'm not sure what it gains you.

*boggle*

You have to be kidding.

That half twisted hard drive cable on the POS IBM PC is why IDE can only
address two devices. The ST506 interface supported 4, and the ESDI interface
supported 7... it's just that because of the stupid twisted cables IBM
came up with to save people setting jumpers almost no controllers have been
able to address them. And since IDE is just (boggle) the controller registers
from a WD1003 on a bus extender, it's limited to 2 drives.

The more I learn about IDE and its dysfunctional family the more I'm amazed
it's become the standard. IDE is *harder* to get right than SCSI, it's slower,
it's less convenient...

The commercial success of a product is inversely proportional to its technical
quality.

--
This is The Reverend Peter da Silva's Boring Sig File - there are no references
to Wolves, Kibo, Discordianism, or The Church of the Subgenius in this document
"[I]f we can make a society that's reasonably safe for women then men should be
reasonably safe from the occasional same-gender advance too." -- Anthony DeBoer

Jim Kingdon

unread,
Mar 19, 1999, 3:00:00 AM3/19/99
to
> And since IDE is just (boggle) the controller registers from a WD1003
> on a bus extender, it's limited to 2 drives.

The more severe limitation on the number of drives is the fact that
you don't have anything like SCSI disconnect, so trying to use both
IDE drives at the same time will be slow. I consider this to be a
reasonable choice - it avoids the kind of "error handling state
machine" stuff which comes up with SCSI.

Generally speaking I'm more of a fan of the "include several ports
rather than bottleneck everyone on one bus" approach. Not that the
IDE way of implementing the concept (with an IRQ for every IDE
channel) is ideal.

> The more I learn about IDE and its dysfunctional family the more I'm
> amazed it's become the standard. IDE is *harder* to get right than
> SCSI

I guess one's mileage may vary. Given all the hassles and potential
hassles with the n different SCSI connectors, SCSI termination, and
the like, I'm not sure I see it that way (in terms of ease of setup).

Personally I'm rooting for firewire. But I suppose they'll find some
way to screw that up too :-).

Peter da Silva

unread,
Mar 19, 1999, 3:00:00 AM3/19/99
to
In article <p4whfrh...@panix7.panix.com>,

Jim Kingdon <kin...@panix7.panix.com> wrote:
>The more severe limitation on the number of drives is the fact that
>you don't have anything like SCSI disconnect, so trying to use both
>IDE drives at the same time will be slow. I consider this to be a
>reasonable choice - it avoids the kind of "error handling state
>machine" stuff which comes up with SCSI.

You say that like there was some design decision that led to this. I watched
the whole sorry mess develop. I was running boxes with 4 and 6 ST506 and ESDI
drives in them. Performance was acceptable. The pre-IDE environment really did
support large numbers of drives without pain. Not on PCs, but that was the
fault of the twisted cable.

>I guess one's mileage may vary. Given all the hassles and potential
>hassles with the n different SCSI connectors, SCSI termination, and
>the like, I'm not sure I see it that way (in terms of ease of setup).

If IDE had been designed as a simple 1-2 drive interface from the start
that would be true, but IDE is actually a complete AT-bus interface (the
drives actually generate interrupt signals like an expansion card!) on each
disk. When you have two drives the drives have to engage in a complex dance
to avoid stepping on each other's toes, because the original WD1003 interface
never had anything in it to handle multiple *interface cards* with shared
IRQs, shared I/O ports, and shared DMA!

>Personally I'm rooting for firewire. But I suppose they'll find some
>way to screw that up too :-).

It's designed. It's not this horrible emulation on top of emulation mess that
is IDE.

Jim Kingdon

unread,
Mar 19, 1999, 3:00:00 AM3/19/99
to
> If IDE had been designed as a simple 1-2 drive interface from the start
> that would be true, but IDE is actually a complete AT-bus interface (the
> drives actually generate interrupt signals like an expansion card!) on each
> disk.

Eeesh, it is beginning to come back to me - I knew there was a reason
I've been trying to not think too hard about such things :-).

I think it is possible - to some extent - to rationalize it post facto
as a simple 1-2 drive interface but I'm not going to deny it is ugly.
Even a quick glance at the Linux IDE code confirms that (of course, in
addition to whether it is ugly conceptually, there is still the issue
of whether implementations are broken which can happen to even a nice
spec).

> >Personally I'm rooting for firewire. But I suppose they'll find some
> >way to screw that up too :-).
>
> It's designed. It's not this horrible emulation on top of emulation
> mess that is IDE.

Whether firewire fulfills its promise probably has more to do with
camcorders and other things, and whether Apple looses their mind and
tries to monopolize it. Lots of bigger forces at work than which one
would be a cleaner interface to hard disks.

David Damerell

unread,
Mar 19, 1999, 3:00:00 AM3/19/99
to
Jim Kingdon <kin...@panix7.panix.com> wrote:
>I guess one's mileage may vary. Given all the hassles and potential
>hassles with the n different SCSI connectors, SCSI termination, and
>the like, I'm not sure I see it that way (in terms of ease of setup).

These days n is equal to two for internal devices; and I must say I
greatly prefer termination issues (where there is one right thing to do
and it works) to IDE master/ slave/ why does it only work this way round?
faffing.
--
David/Kirsty Damerell. dame...@chiark.greenend.org.uk
CUWoCS President. http://www.chiark.greenend.org.uk/~damerell/ Hail Eris!
|___| You bought a mask: I put it on: you never thought to ask me if I wear
| | | it when you're gone. The Sisters of Mercy: When You Don't See Me.

Peter da Silva

unread,
Mar 20, 1999, 3:00:00 AM3/20/99
to
In article <p4wr9ql...@panix7.panix.com>,

Jim Kingdon <kin...@panix7.panix.com> wrote:
>Eeesh, it is beginning to come back to me - I knew there was a reason
>I've been trying to not think too hard about such things :-).

I have a friend who claims that the PC "architecture" is why he's so
cynical, and why he finds no pleasure any more in programming.

>I think it is possible - to some extent - to rationalize it post facto
>as a simple 1-2 drive interface but I'm not going to deny it is ugly.

Retcon! Retcon! And they should have left Spock dead.

>Whether firewire fulfills its promise probably has more to do with
>camcorders and other things, and whether Apple looses their mind and
>tries to monopolize it. Lots of bigger forces at work than which one
>would be a cleaner interface to hard disks.

Oh, I don't deny that. I'm just talking about why it's acceptable to actually
root (ahem, barrack) for it.

Jim Kingdon

unread,
Mar 21, 1999, 3:00:00 AM3/21/99
to
> I have a friend who claims that the PC "architecture" is why he's so
> cynical, and why he finds no pleasure any more in programming.

I am cynical and find no pleasure any more in programming for reasons
which have nothing to do with the PC "architecture" :-).

For me, PC's have basically meant cheap unix boxes with choices in
terms of OS vendors (with the corresponding benefits of competition).

Now, back to cynicism (or whatever we want to call it). I guess I'm
not finding the kind of community effort that existed in the old
usenet/unix/gnu/bsd/&c days (which I fully realize may be my
idealization of those days as much as the days themselves). Trying to
make a living from free software perhaps hasn't helped - I feel all
kinds of pressures and anxieties in terms of trying to keep the
revenue flowing in. Should I get a sysadmin job - the kind where I
have free time to do what I want as long as I'm on call when needed
and the machines keep running? I'm not completely sure I'd enjoy that
either...

Oh, and in a much more random (and, I hope, entertaining) comment on
the community, I did recently come up with what I thought was kind of
a cute piece - the License Codes at
http://www.cyclic.com/~kingdon/licenses.html
It is probably most fun if you have read the incessant license
flamewars places like slashdot (or any place rms goes, or any place
Tim O'Reilly goes - if you've been around you know the flamewars I'm
talking about :-)).

Peter da Silva

unread,
Mar 21, 1999, 3:00:00 AM3/21/99
to
In article <p4woglm...@panix7.panix.com>,

Jim Kingdon <kin...@panix7.panix.com> wrote:
>Oh, and in a much more random (and, I hope, entertaining) comment on
>the community, I did recently come up with what I thought was kind of
>a cute piece - the License Codes at
> http://www.cyclic.com/~kingdon/licenses.html

You forgot:

E-- The terms of the license are not only unenforcible but contradictory
(eg, "this public domain software is copyright by...)

E- The terms of the license are unenforcible (eg. shareware).

E+ The terms of the license are based on actual legal legwork and
are probably enforcible.

E++ The terms of the license are written by a lawyer (the rest of the
flags are probably ? if this is set).

R- This license disclaims any political (religious) goals.

R+ This license is guided by political goals.

R++ This license was written by a politician (the rest of the flags are
probably ? if this is set).

Jim Kingdon

unread,
Mar 21, 1999, 3:00:00 AM3/21/99
to
> R++ This license was written by a politician (the rest of the flags
> are probably ? if this is set).

ER++ This license was written by a politician who is a lawyer.

ER+++ A politician wrote a law which was used by a bureaucrat to
write regulations which described how to write the license.

0 new messages