#33 Specifically state if disk was repaired

Some_future_release
open
3
2012-10-09
2005-04-21
Anonymous
No

This is a terrrific tool. I have one question however. when the disk
repair is run the mesage says the disk was either repaired or is OK.
My understanding is that it is a good idea to run "fsck" again (and if
necessary again etc.) if the disk was repaired. In this way repairs
that could not be done at the first pass are done in the next pass. In
other word keep running "fsck" until it comes up "Appears to be
OK".

In Applejack the ambiguous wording as to the status of the repair
means that the user never really knows if a repair was done.

Would it be possible to indicate if the disk was actually repaired? Or
is my knowledge so shallow that it really is not necessary. I am far
from an expert in either operating systems or disk repair.

James Latta
jameslatta@mac.com

Discussion

  • Logged In: YES
    user_id=583959

    What makes this difficult is that the fsck utility returns
    either a 0 or a 1 when it has finished running. 0 means it
    ran successfully, but that can either mean that there were
    no problems, or it can mean that if there were problems,
    they were fixed. A zero is a zero, so I can't really
    determine within the programme whether the disk was
    repaired. What you can do, though, is look at the output
    from the fsck "disk repair" routine. If you see it fixing
    things, and still reporting "Success!" at the end, then you
    know your disk was repaired. If all you get are a bunch of
    lines saying "checking..." but no lines providing any errors
    found on the disk, then your disk was probably fine to begin
    with.

     
  • Marcel_75
    Marcel_75
    2005-05-12

    Logged In: YES
    user_id=1277239

    @first: thx a lot for this great tool!

    But the problem James Latta was talking about is IMHO a really big
    problem.
    It's right what James was thinking/talking: the problem with fsck is, that it
    can only repair one problem per run. So if fsck found problems and
    repaired them, you need to run fsck again and again as "The Macintosh
    HD appears to be OK" is displaying!
    If not (and this time AppleJack don't do it "right" I think) you maybe have
    file system problems you should repair as fast as possible.
    I know the problem kwidholm was talking about later, but I hope Kristofer
    will find a good solution?
    So far I will run fsck -f manually in SingleUserMode and if anything was
    repaired successfully, I start AppleJack.
    Maybe it's a good idea to talk about this phenomenom in the readme of
    AppleJack?

    Cheers,
    Marcel Dietzmann

     
  • Logged In: YES
    user_id=583959

    It looks like I'll have to say this again :-)

    There is no way for me to be able to guess whether the 0
    when fsck has finished is because there were no errors, or
    if the 0 means that there were errors, but they were fixed.
    I can't see your machine running, I can only write the
    script on the basis of what fsck gives back to me.

    I'll make it really simple: I CAN'T do anything about this.

    If you use AppleJack in auto mode, and are bothered by this,
    then I recommend using AppleJack in manual mode and just
    re-running the disk repair as often as you like.

    Maybe there's some brilliant programmer out there who could
    figure out a way to do this, but to me, a 0 is a 0, and
    unless you want AppleJack to run forever and ever re-doing
    disk repair, it has to stop once it gets a 0 exit code from
    fsck. Sorry.

     
  • Logged In: YES
    user_id=583959

    I should add if there are any really brilliant
    bash-scripters out there familiar with fsck and if they can
    figure out a way to do this, I'd be more than happy to
    implement this feature request. I'll leave the request open
    in the hopes someone might contribute.

     
  • Logged In: YES
    user_id=583959

    Another addendum...

    In my own experience (which is of course a terrible guide to
    go by, but I'll share it anyway), I have never had fsck exit
    with a 0 and then have it encounter problems when run again.
    My understanding has been that a 0 on exit meant that all
    problems encountered had been repaired successfully.

    Next time you have disk errors, try this out in AppleJack.
    See if it reports "Success! Either no problems or all
    problems were fixed", and then run the disk repair routine
    again. If you see that fsck finds more problems after having
    received the success message, let me know, so I can get rid
    of my hypothesis.