Skip to contentSkip to conversation

A couple of questions

DISCUSSION Steve Pratt 8 participants 16 messages May 16, 2002 – May 18, 2002

lore
Share & tools
lore
#0 lore raw
Quoted 4 lines · Oleg Drokin

Hello!

Quoted 1 line · Steve Pratt
Quoted 1 line
Quoted 1 line

superblock. Neither 3.5 nor 3.6 superblock appear to have a label

field,

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 1 line

but mkfs has an option for it.

Labels are supported in reiserfs v3.6 format. (2.4 supopr was merged

into

Quoted 2 lines
Quoted 2 lines
Quoted 1 line

2.4.19-pre3, if I remember correctly).

Ok, so it looks like I can use the option and if they have the right

kernel

Quoted 6 lines
Quoted 1 line

code it will just work.

In fact even kernel without "support" will work.
Support is only means that the space in superblock is marked as used by label/uuid instead of being marked as "reserved".
You cannot query uuid/label from withing the kernel, anyway.

Ok. This is fine.

Quoted 8 lines
Quoted 3 lines
Quoted 2 lines

You can circumvient this by echo Yes | reiserfsck ... if you need.

Actually this is not trivial in fork/exec in C code. Especially when I

I think it is.

Quoted 2 lines

want to preserve the return code from the fsck. If you know of a coding trick to do this I would be interested.

(pseudocode removed) ...

Thanks! I have this working now.

One extra question on this. I assume that if in Fix mode and errors are encountered that fsck.resiserfs will prompt to fix each error and that there is no way to have it answer 'Yes' automatically like the ext2 -y option.

If not then I will probably have to take Jonathan Briggs suggestion of a third process to answer 'Yes' repeatedly.

Steve

#1 lore raw

Hello!

Quoted 4 lines · Steve Pratt

One extra question on this. I assume that if in Fix mode and errors are encountered that fsck.resiserfs will prompt to fix each error and that there is no way to have it answer 'Yes' automatically like the ext2 -y option.

I am unaware of a situation where reiserfsck asks any question in the middle of repairing.
It may ask for more than one confirmation in the beginning (one of the cases being when it thinks it may replay a journal, but it is not sure). But these cases are really the cases where you want to pass the question to user and get his opinition to pass it to fsck.
I think they all are looks very similar, so you can find them quickly in output stream (something like some text and then "(y/n):" sequence of characters).

When fs bugs are fixed, this is done without any questions asked, and though this is somewhat questionable approach, this is how it done at present.

Quoted 2 lines

If not then I will probably have to take Jonathan Briggs suggestion of a third process to answer 'Yes' repeatedly.

This is very dangerous approach. There is exactly one "extra" confirmation, the one at the beginning, where reiserfsck asks if you really want to run it. All of the others are really important. (well, may be not all, but most of them for sure)

Bye,
Oleg

#2 lore raw
In reply to Steve Pratt
Quoted 83 lines · Steve Pratt
Quoted 6 lines · Oleg Drokin

Hello!

Quoted 6 lines
Quoted 3 lines · Steve Pratt
Quoted 3 lines
Quoted 3 lines

superblock. Neither 3.5 nor 3.6 superblock appear to have a label

field,

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 3 lines

but mkfs has an option for it.

Labels are supported in reiserfs v3.6 format. (2.4 supopr was merged

into

Quoted 6 lines
Quoted 6 lines
Quoted 3 lines

2.4.19-pre3, if I remember correctly).

Ok, so it looks like I can use the option and if they have the right

kernel

Quoted 6 lines
Quoted 3 lines

code it will just work.

Quoted 6 lines

In fact even kernel without "support" will work.
Support is only means that the space in superblock is marked as used by label/uuid instead of being marked as "reserved".
You cannot query uuid/label from withing the kernel, anyway.

Ok. This is fine.

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

You can circumvient this by echo Yes | reiserfsck ... if you need.

Quoted 16 lines
Quoted 3 lines

Actually this is not trivial in fork/exec in C code. Especially when I

I think it is.

Quoted 4 lines

want to preserve the return code from the fsck. If you know of a coding trick to do this I would be interested.

(pseudocode removed) ...

Thanks! I have this working now.

One extra question on this. I assume that if in Fix mode and errors are encountered that fsck.resiserfs will prompt to fix each error and that there is no way to have it answer 'Yes' automatically like the ext2 -y option.

Quoted 12 lines

If not then I will probably have to take Jonathan Briggs suggestion of a third process to answer 'Yes' repeatedly.

Steve

Why in the world do you want to run fsck without running it manually, and passing all information to the user?

Hans

#3 lore raw
Quoted 5 lines
Quoted 5 lines

One extra question on this. I assume that if in Fix mode and errors are encountered that fsck.resiserfs will prompt to fix each error and that there is no way to have it answer 'Yes' automatically like the ext2 -y option.

Quoted 7 lines
Quoted 4 lines

If not then I will probably have to take Jonathan Briggs suggestion of a third process to answer 'Yes' repeatedly.

Steve

Why in the world do you want to run fsck without running it manually, and passing all information to the user?

What I'm thinking of is this:
1. If a filesystem is really too borked for fsck to recover useful stuff, it should be left alone. Either fsck is able to help or not. No need to ask user, fsck has more data to determine whether the fs makes a scant of sense, or if it has been messed up too much.
2. If we run fsck, we want to recover as much data as possible. That's what lost+found directory is for -- stuff that is not exactly clean for use, but may nevertheless be useful, gets hooked there.

Why on earth does a filesystem check & recovery program need to ask questions to the user, which most users w/o intimate filesystem knowledge won't be able to answer at all? Looking at this list, what people want is to get their data back, as much as possible. They never want to get less than that. Why bother asking?

That's one thing. Another thing is making fsck work on broken media, since that is what many unsuspecting users actually do. It should simply disregard read errors and try using whatever data there is in ok-read blocks.

I don't think that asking too many questions is worth it. He who runs fsck in "fix" mode wants his data back (whatever is left of it). Certain things, like recovering the deleted files, may be worth specifying as options, but typical recovery stuff should be w/o questions in my opinion. At least that's what I'd expect all fsck's to do.

Cheers, Kuba

#4 lore raw
Quoted 3 lines · Kuba Ober

What I'm thinking of is this:
to the user, which most users w/o intimate filesystem knowledge won't be able to answer at all?

Unix traditionally wasn't aimed at the point-and-click users without knowledge.

Quoted 3 lines

Looking at this list, what people want is to get their data back, as much as possible. They never want to get less than that. Why bother asking?

Users who know nothing can still be told to just press "y". Even better, somebody with some knowledge about the filesystem (and the contents!) layout can often do better with an interactive fsck (see ext2fs).

I don't think it makes sense to enhance the dumb-user-mode while at the same time keeping informed users from working properly.

Quoted 2 lines

that is what many unsuspecting users actually do. It should simply disregard read errors and try using whatever data there is in ok-read blocks.

It should actually ask the user wether she wants the block to be repaired (if possible), or permanently marked defect.

Quoted 2 lines

I don't think that asking too many questions is worth it. He who runs fsck in "fix" mode wants his data back (whatever is left of it).

Thats a big mistake. He who runs fsck wants to recover as much data as possible. Sometimes maybe more than fsck alone can do.

Quoted 2 lines

recovery stuff should be w/o questions in my opinion. At least that's what I'd expect all fsck's to do.

for some strange reason no fsck behaves like that.

Signature · 7 lines
      -----==-                                             |
      ----==-- _                                           |
      ---==---(_)__  __ ____  __       Marc Lehmann      +--
      --==---/ / _ \/ // /\ \/ /       [email protected]      |e|
      -=====/_/_//_/\_,_/ /_/\_\       XX11-RIPE         --+
    The choice of a GNU generation                       |
                                                         |
#5 lore raw
Quoted 44 lines · pcg( Marc)@goof(A.).(Lehmann )com wrote:
Quoted 4 lines · Kuba Ober

What I'm thinking of is this:
to the user, which most users w/o intimate filesystem knowledge won't be able to answer at all?

Unix traditionally wasn't aimed at the point-and-click users without knowledge.

Quoted 3 lines

Looking at this list, what people want is to get their data back, as much as possible. They never want to get less than that. Why bother asking?

Users who know nothing can still be told to just press "y". Even better, somebody with some knowledge about the filesystem (and the contents!) layout can often do better with an interactive fsck (see ext2fs).

I don't think it makes sense to enhance the dumb-user-mode while at the same time keeping informed users from working properly.

Quoted 3 lines

that is what many unsuspecting users actually do. It should simply disregard read errors and try using whatever data there is in ok-read blocks.

It should actually ask the user wether she wants the block to be repaired (if possible), or permanently marked defect.

Quoted 3 lines

I don't think that asking too many questions is worth it. He who runs fsck in "fix" mode wants his data back (whatever is left of it).

Thats a big mistake. He who runs fsck wants to recover as much data as possible. Sometimes maybe more than fsck alone can do.

Quoted 8 lines
Quoted 3 lines

recovery stuff should be w/o questions in my opinion. At least that's what I'd expect all fsck's to do.

for some strange reason no fsck behaves like that.

Actually, I think Kuba makes a good point. I will ask some questions about exactly when do we ask the user a question more than once.

I am a filesystems developer, and I don't know enough to do more than press y with most fscks. I think that for the most part, if one is going to ask the user to help, one needs to provide a real interface, a filesystem structure editor..... which no FS has ever done.... but right now we need to get what we have debugged thoroughly. It is on the list of things I would like to add someday.

Hans

#6 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Dear Hans,

Quoted 2 lines

I am a filesystems developer, and I don't know enough to do more than press y with most fscks.

There is one case, in which I know that I have to say no: If the partition that a fsck tries to correct has a different type than the fsck thinks. (Running e2fsck against a reiserfs partition for example)

And those things happens when someone changes harddisks, ...

Quoted 3 lines

I think that for the most part, if one is
going to ask the user to help, one needs to provide a real interface, a filesystem structure editor.....

Well, debugfs (ext2) was an approach into that direction, isn't it? Now I stumbled across debugreiserfs, but it lacks interactive mode.

Quoted 3 lines

which no FS has ever done.... but
right now we need to get what we have debugged thoroughly. It is on the list of things I would like to add someday.

What I would like to see is a tool to do the following:
(And I don't think that I will find a sponsor for that tool :-(

After a crash, I make a dd from the crashed partition, into a normal file in another partition, that's perhaps on a differnt harddisk.

Then I want to run a dumping utility, that tries to restore every bit that still can be found in the crashed partition, and tries to resemble all the files in it, and even creating a lost&found directory ...

That dumping utility should take an output directory as argument, in which it recreates the contents.

Something like "The Coroners Kit", but more for recovery than for investigation.

What is important for that tool:
* It must not crash under any circumstances. Even if every bit of the filesystem is currupted, it has to do its work, and try to recover as much as possible.
* It has to assume that every bit of the filesystem can be corrupt, so it has to try to semantically verify the bits, pointers, ...
* It should try different ways to restore access to lost data, if it stumbles across problems in the filesystems.
* There must not be any assertions that would not allow the tool to run over the whole partiton, and search everywhere for lost data
* It has to be designed to work on files which are dumps from partition based filesystems.
* It should be able to detect and correct common hardware or crash related problems in the filesystem:
* Files that are not statable or accessible, because there only exists an
entry in the directory, but nothing in the reiserfs tree
* Transactions that are open
* Corrupted directory entries like filenames with special charakters that
can not be used from the system, or rights with undefined bits, ...
* ...
* It must not change any data on the partition, instead it writes everything to an output directory

Many greetings,
- --
~ Philipp Gühring [email protected]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE85FKjlqQ+F+0wB3oRAlT3AJ9/2t5pDirnnLs/4daKrSKWD2msxQCeIHZx BU+PvfxKKbojRtdnLPerfMY=
=dohB
-----END PGP SIGNATURE-----

#7 lore raw
Quoted 29 lines · Philipp Gühring

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Dear Hans,

Quoted 3 lines

I am a filesystems developer, and I don't know enough to do more than press y with most fscks.

There is one case, in which I know that I have to say no: If the partition that a fsck tries to correct has a different type than the fsck thinks. (Running e2fsck against a reiserfs partition for example)

And those things happens when someone changes harddisks, ...

Quoted 4 lines

I think that for the most part, if one is
going to ask the user to help, one needs to provide a real interface, a filesystem structure editor.....

Well, debugfs (ext2) was an approach into that direction, isn't it? Now I stumbled across debugreiserfs, but it lacks interactive mode.

Quoted 4 lines

which no FS has ever done.... but
right now we need to get what we have debugged thoroughly. It is on the list of things I would like to add someday.

Quoted 8 lines

What I would like to see is a tool to do the following:
(And I don't think that I will find a sponsor for that tool :-(

After a crash, I make a dd from the crashed partition, into a normal file in another partition, that's perhaps on a differnt harddisk.

Then I want to run a dumping utility, that tries to restore every bit that still can be found in the crashed partition, and tries to resemble all the files in it, and even creating a lost&found directory ...

That dumping utility should take an output directory as argument, in which it recreates the contents.

It should take a FILE of the SAME size of the original partition as output. So the utility or user may dd it back safely.

Quoted 17 lines

Something like "The Coroners Kit", but more for rec2overy than for investigation.

What is important for that tool:
* It must not crash under any circumstances. Even if every bit of the filesystem is currupted, it has to do its work, and try to recover as much as possible.
* It has to assume that every bit of the filesystem can be corrupt, so it has to try to semantically verify the bits, pointers, ...
* It should try different ways to restore access to lost data, if it stumbles across problems in the filesystems.
* There must not be any assertions that would not allow the tool to run over the whole partiton, and search everywhere for lost data
* It has to be designed to work on files which are dumps from partition based filesystems.
* It should be able to detect and correct common hardware or crash related problems in the filesystem:
* Files that are not statable or accessible, because there only exists an
entry in the directory, but nothing in the reiserfs tree
* Transactions that are open
* Corrupted directory entries like filenames with special charakters that
can not be used from the system, or rights with undefined bits, ...
* ...
* It must not change any data on the partition, instead it writes everything to an output directory

...FILE, that is able to be checked manually via loop-mount to see the difference... Philipp is very right on his needs. We all are interestedm I assume.

Quoted 8 lines

Many greetings,
- --
~ Philipp Gühring [email protected]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

Quoted 5 lines

iD8DBQE85FKjlqQ+F+0wB3oRAlT3AJ9/2t5pDirnnLs/4daKrSKWD2msxQCeIHZx BU+PvfxKKbojRtdnLPerfMY=
=dohB
-----END PGP SIGNATURE-----

Best wishes,

Manuel

#8 lore raw
In reply to Philipp Gühring
Quoted 6 lines
Quoted 2 lines

I am a filesystems developer, and I don't know enough to do more than press y with most fscks.

There is one case, in which I know that I have to say no: If the partition that a fsck tries to correct has a different type than the fsck thinks. (Running e2fsck against a reiserfs partition for example)

These are obvious cases and I don't oppose asking in those cases. That makes sense. This is actually a case when the user/sysadmin can provide meaningful input to the fsck. But asking questions which reduce to "are you sure you want me (fsck) to do as much as I can to bring it back" are pointless.

Quoted 6 lines
Quoted 3 lines

I think that for the most part, if one is
going to ask the user to help, one needs to provide a real interface, a filesystem structure editor.....

Well, debugfs (ext2) was an approach into that direction, isn't it? Now I stumbled across debugreiserfs, but it lacks interactive mode.

We need at least as much functionality as norton disk editor had wrt fat partition fixing. Anything less is a waste of time.

Quoted 9 lines
Quoted 3 lines

which no FS has ever done.... but
right now we need to get what we have debugged thoroughly. It is on the list of things I would like to add someday.

What I would like to see is a tool to do the following:
(And I don't think that I will find a sponsor for that tool :-(

After a crash, I make a dd from the crashed partition, into a normal file in another partition, that's perhaps on a differnt harddisk.

That's only needed sometimes, like when your source partition is failing. An fsck can warn that "there are read errors while accessing this partition, advice making binary copy and working on that".

Otherwise, typically the amount of changed bits that fsck actually changes to fix things is minor. Restore files are not such a bad idea, you know, especially that they are easy to implement (just journal all changes in a file, including previous data).

Quoted 24 lines

Then I want to run a dumping utility, that tries to restore every bit that still can be found in the crashed partition, and tries to resemble all the files in it, and even creating a lost&found directory ...

That dumping utility should take an output directory as argument, in which it recreates the contents.

Something like "The Coroners Kit", but more for recovery than for investigation.

What is important for that tool:
* It must not crash under any circumstances. Even if every bit of the filesystem is currupted, it has to do its work, and try to recover as much as possible.
* It has to assume that every bit of the filesystem can be corrupt, so it has to try to semantically verify the bits, pointers, ...
* It should try different ways to restore access to lost data, if it stumbles across problems in the filesystems.
* There must not be any assertions that would not allow the tool to run over the whole partiton, and search everywhere for lost data
* It has to be designed to work on files which are dumps from partition based filesystems.
* It should be able to detect and correct common hardware or crash related problems in the filesystem:

Quoted 8 lines

* Files that are not statable or accessible, because there only exists an
entry in the directory, but nothing in the reiserfs tree
* Transactions that are open
* Corrupted directory entries like filenames with special charakters that
can not be used from the system, or rights with undefined bits, ...
* ...
* It must not change any data on the partition, instead it writes everything to an output directory

reiterating
1. It doesn't need to work on the real partition. There are many ways (implementations) it can work without writing to it, not even the metadata.
2. It should try to "tick-check" any correct data asap, so as to limit the search area for corrupted leftovers
3. It should basically leave corrupted data until it is done with all non-corrupted stuff. Typical fs corruptions are tiny, tiny, tiny.
4. Hardware problems are basically "underlying-block-device" problems. Sometimes things fail without hardware failing, like bugs in raid stuff, etc. This is basically a heuristic pattern detection stuff: if things are borked in a certain pattern, we can assume that the block device has problems.

A lot of stuff in such a tool would be fs-independent, like filename verificator (that would give a probability that a given string was a filename), etc. Anyway, the point of this exercise is to make a tool which can have a decent frontend, and which actually can ask meaningful questions that the user can answer. On many server systems, the admin is reasonably able to answer a question about say whether this directory was something he hasn't seen, or something that he has been working on a lot lately, etc. This requires maybe kind of an expert-system approach. Well, that's too much of a buzzword, but it boils down to very simple things: it needs to find out as many correct things about the filesystem (those that leave little doubt) as it can, and treat them as assertions, and then it can ask a few decent questions that will make the recovery possible. Again, a lot of fs corruption is pretty much limited. Say if for some reason all the superblocks have been overwritten, it should first try assuming that these were generated by the most recent mkfs with default options, and then try a few different possible options, progressing to uncommon ones, etc. That's the approach to the problem as I see it. Rants and flames welcome.

Cheers, Kuba Ober

#9 lore raw
In reply to Marc A. Lehmann

Hi '""pcg\"@goof.com ( Marc) (A.) (Lehmann )' and all others!

Quoted 8 lines · On 05/16/2002 11:44 PM, [email protected] ( Marc) (A.) (Lehmann ) wrote:
Quoted 3 lines · Kuba Ober

What I'm thinking of is this:
to the user, which most users w/o intimate filesystem knowledge won't be able to answer at all?

Unix traditionally wasn't aimed at the point-and-click users without knowledge.

Don't loose contact with reality. Nowadays things change very often. And
at least Linux has to be usable for a "traditional Win user" soon if
it should exist in future.

Quoted 11 lines
Quoted 3 lines

Looking at this list, what people want is to get their data back, as much as possible. They never want to get less than that. Why bother asking?

Users who know nothing can still be told to just press "y". Even better, somebody with some knowledge about the filesystem (and the contents!) layout can often do better with an interactive fsck (see ext2fs).

I don't think it makes sense to enhance the dumb-user-mode while at the same time keeping informed users from working properly.

It makes sense to improve all user modes (in docs and usability) AND all automatic modes possible depending on the distro. Pardon, what is an "informed" user? Someone who reads the Docs or someone who can decidedly type "Yes"... and make a repeat loop??

Quoted 6 lines
Quoted 3 lines

that is what many unsuspecting users actually do. It should simply disregard read errors and try using whatever data there is in ok-read blocks.

It should actually ask the user wether she wants the block to be repaired (if possible), or permanently marked defect.

Doesn't that really depend on the HW state <-> or can software reliably decide whether the info it gets is o.k. so far on Linux?? See the previous posts on the list.

Quoted 7 lines
Quoted 3 lines

I don't think that asking too many questions is worth it. He who runs fsck in "fix" mode wants his data back (whatever is left of it).

Thats a big mistake. He who runs fsck wants to recover as much data as possible. Sometimes maybe more than fsck alone can do.

We all running "reiserfsck" want as much data back as possible and are in fear the FS has lost some things or is loosing things while running fsck (what is real with ext2 and vfat). What is a big mistake on reiserfs at least as it retrieves "mostly all" things possible. O.k. that point is inaccurate.

Quoted 6 lines
Quoted 3 lines

recovery stuff should be w/o questions in my opinion. At least that's what I'd expect all fsck's to do.

for some strange reason no fsck behaves like that.

Yess. I agree on that opinion. The fixable things should pass without any question. Who knows the special missing inode, when it should be fixed?

Best wishes,

Manuel

#10 lore raw
In reply to Marc A. Lehmann
Quoted 6 lines
Quoted 3 lines

What I'm thinking of is this:
to the user, which most users w/o intimate filesystem knowledge won't be able to answer at all?

Unix traditionally wasn't aimed at the point-and-click users without knowledge.

Yep. But the thing is that either fsck can restore the data or not. There's no way in between.

What more can unix-poweruser do about recovering a filesystem, other than running a disk editor (say a reiserfs-customized version of norton disk editor, which used to be a good thing for hand recovery of fat fs before it became crap) ?

What kinds of questions can fsck really ask without having to present user with a lot of intricate data, which is better visualized graphically or, at least in a more interactive ui?

Example: If e2fsck starts asking questions like "inode counts don't match for groups (a long list of groups). fix them <y>", what should I answer? no? that would be nonsense.

One of the reasons for these questions are that they are eyebrow-raisers. Say, if your raid1 array got out of sync somehow, a lot of fsck errors will maybe prompt you to look at whether something like that might have happened in the first place. But fsck should be able, as far as it can from the fs metadata, tell the user whether the fs was seriously corrupted by a block device failure (say raid corruption, hd having transfer problems, etc), overwriting of data with garbage, or unclean shutdown / fs-specific kernel bugs. It's the fsck utility that has this data. No power admin will have that kind of knowledge without at least dumping metadata and having a look at it with some specialized tool, or an on-the-spot hacked script to test things out.

I had a hardware crash. Or a raid failure. Obviously I don't have recent enough backup, or I really need those last-minute changes back, quickly. Or may system crashed in such a way that some metadata got corrupted. Many ifs. Now please tell me specifically how that knowledge applies to answering particular questions that say ext2fsck or reiserfsck may ask.

Quoted 1 line

for some strange reason no fsck behaves like that.

Because most fscks are hacks. They are useful, they mostly do their job, but they are far from full-features tools, and that's the reality. I don't complain. I just say that their functionality isn't optimal, and shouldn't be cited as something that's the way to go, or as something that should be a design goal. They are effects of how much time did the fs-knowing people have to put in them.

Cheers, Kuba

#11 lore raw
Quoted 10 lines · Kuba Ober
Quoted 9 lines
Quoted 5 lines

What I'm thinking of is this:
to the user, which most users w/o intimate filesystem knowledge won't be able to answer at all?

Unix traditionally wasn't aimed at the point-and-click users without knowledge.

Quoted 8 lines

Yep. But the thing is that either fsck can restore the data or not. There's no way in between.

What more can unix-poweruser do about recovering a filesystem, other than running a disk editor (say a reiserfs-customized version of norton disk editor, which used to be a good thing for hand recovery of fat fs before it became crap) ?

What kinds of questions can fsck really ask without having to present user with a lot of intricate data, which is better visualized graphically or, at least in a more interactive ui?

Example: If e2fsck starts asking questions like "inode counts don't match for groups (a long list of groups). fix them <y>", what should I answer? no? that would be nonsense.

Yeah, I agree with this one. Especially when there is usually absolutely no place where it is documented what in the world these sorts of messages mean. Which is one of my pet peeves with our reiserfsck and journaling code, I am simply unable to convey that a message that is not explained such that the average user can understand it is programming malpractice.

Quoted 8 lines
Quoted 5 lines

for some strange reason no fsck behaves like that.

Because most fscks are hacks. They are useful, they mostly do their job, but they are far from full-features tools, and that's the reality. I don't complain. I just say that their functionality isn't optimal, and shouldn't be cited as something that's the way to go, or as something that should be a design goal. They are effects of how much time did the fs-knowing people have to put in them.

Yes, very true. Sigh. Norton was the exception to this, and it was not produced by the author of the FS.

Quoted 6 lines

Cheers, Kuba

#12 lore raw
In reply to Marc A. Lehmann
Quoted 6 lines
Quoted 3 lines

What I'm thinking of is this:
to the user, which most users w/o intimate filesystem knowledge won't be able to answer at all?

Unix traditionally wasn't aimed at the point-and-click users without knowledge.

Yep. But the thing is that either fsck can restore the data or not. There's no way in between.

What more can unix-poweruser do about recovering a filesystem, other than running a disk editor (say a reiserfs-customized version of norton disk editor, which used to be a good thing for hand recovery of fat fs before it became crap) ?

What kinds of questions can fsck really ask without having to present user with a lot of intricate data, which is better visualized graphically or, at least in a more interactive ui?

Example: If e2fsck starts asking questions like "inode counts don't match for groups (a long list of groups). fix them <y>", what should I answer? no? that would be nonsense.

One of the reasons for these questions are that they are eyebrow-raisers. Say, if your raid1 array got out of sync somehow, a lot of fsck errors will maybe prompt you to look at whether something like that might have happened in the first place. But fsck should be able, as far as it can from the fs metadata, tell the user whether the fs was seriously corrupted by a block device failure (say raid corruption, hd having transfer problems, etc), overwriting of data with garbage, or unclean shutdown / fs-specific kernel bugs. It's the fsck utility that has this data. No power admin will have that kind of knowledge without at least dumping metadata and having a look at it with some specialized tool, or an on-the-spot hacked script to test things out.

I had a hardware crash. Or a raid failure. Obviously I don't have recent enough backup, or I really need those last-minute changes back, quickly. Or may system crashed in such a way that some metadata got corrupted. Many ifs. Now please tell me specifically how that knowledge applies to answering particular questions that say ext2fsck or reiserfsck may ask.

Quoted 1 line

for some strange reason no fsck behaves like that.

Because most fscks are hacks. They are useful, they mostly do their job, but they are far from full-features tools, and that's the reality. I don't complain. I just say that their functionality isn't optimal, and shouldn't be cited as something that's the way to go, or as something that should be a design goal. They are effects of how much time did the fs-knowing people have to put in them.

Cheers, Kuba

#13 lore raw
In reply to Kuba Ober
Quoted 3 lines · Kuba Ober

What I'm thinking of is this:
to the user, which most users w/o intimate filesystem knowledge won't be able to answer at all?

Unix traditionally wasn't aimed at the point-and-click users without knowledge.

Quoted 3 lines

Looking at this list, what people want is to get their data back, as much as possible. They never want to get less than that. Why bother asking?

Users who know nothing can still be told to just press "y". Even better, somebody with some knowledge about the filesystem (and the contents!) layout can often do better with an interactive fsck (see ext2fs).

I don't think it makes sense to enhance the dumb-user-mode while at the same time keeping informed users from working properly.

Quoted 2 lines

that is what many unsuspecting users actually do. It should simply disregard read errors and try using whatever data there is in ok-read blocks.

It should actually ask the user wether she wants the block to be repaired (if possible), or permanently marked defect.

Quoted 2 lines

I don't think that asking too many questions is worth it. He who runs fsck in "fix" mode wants his data back (whatever is left of it).

Thats a big mistake. He who runs fsck wants to recover as much data as possible. Sometimes maybe more than fsck alone can do.

Quoted 2 lines

recovery stuff should be w/o questions in my opinion. At least that's what I'd expect all fsck's to do.

for some strange reason no fsck behaves like that.

Signature · 7 lines
      -----==-                                             |
      ----==-- _                                           |
      ---==---(_)__  __ ____  __       Marc Lehmann      +--
      --==---/ / _ \/ // /\ \/ /       [email protected]      |e|
      -=====/_/_//_/\_,_/ /_/\_\       XX11-RIPE         --+
    The choice of a GNU generation                       |
                                                         |
#14 lore raw
In reply to Kuba Ober
Quoted 5 lines · Kuba Ober

Why on earth does a filesystem check & recovery program need to ask questions to the user, which most users w/o intimate filesystem knowledge won't be able to answer at all? Looking at this list, what people want is to get their data back, as much as possible. They never want to get less than that. Why bother asking?

Well.. at least "traditionally", it was possible for a filesystem to get scrozzled in ways that just saying 'y' would result in more data loss than one judicious 'n' at the wrong time. There's been more than once in the last two decades that I've had fsck dropping zillions of files into lost+found/ because it decided that they were in invalid directories.

Why were those directories invalid? Because their .. pointers were broken.

What was wrong with their .. pointers? They pointed at a directory that had a bum .. as well...

End result? If you answered 'n' to all the "relink?" questions *except* for the one actual broken one, you ended up with an almost-intact directory tree in lost+found, and a simple 'mv #004 ../real_name' would finish it, rather than 3 zillion #nnnn entries with no directory structure at all.

The ugliest one of these was on a system where fsck refused to grow lost+found (because doing so would require more blocks - which are hard to get if you can't trust the free list at the moment - that's why old mkfs commands would have a loop that touched a bunch of files in lost+found and then rm them - just to grow the directory size).

So quite often, you'd end up doing an 'fsck -n' once to figure out what was scrogged, then re-run it several times, answering 'y' to things in the right order...

/Valdis (who has had Very Bad Weekends from this issue ;)

#15 lore raw
Quoted 14 lines
Quoted 5 lines

Why on earth does a filesystem check & recovery program need to ask questions to the user, which most users w/o intimate filesystem knowledge won't be able to answer at all? Looking at this list, what people want is to get their data back, as much as possible. They never want to get less than that. Why bother asking?

Well.. at least "traditionally", it was possible for a filesystem to get scrozzled in ways that just saying 'y' would result in more data loss than one judicious 'n' at the wrong time. There's been more than once in the last two decades that I've had fsck dropping zillions of files into lost+found/ because it decided that they were in invalid directories.

Why were those directories invalid? Because their .. pointers were broken.

Quoted 7 lines

What was wrong with their .. pointers? They pointed at a directory that had a bum .. as well...

End result? If you answered 'n' to all the "relink?" questions *except* for the one actual broken one, you ended up with an almost-intact directory tree in lost+found, and a simple 'mv #004 ../real_name' would finish it, rather than 3 zillion #nnnn entries with no directory structure at all.

That's an fsck problem. Fsck has enough data to make sure that directories are really correct. That particular fsck you're mentioning didn't do its job, that's all.

As far as the pointers are concerned, what kinds of directory pointers you're referring to? Pointers from lower-level directories that didn't point to the directory in question, pointers from broken lower-level dirs that point to directory in question, pointers from that directory entry to some other broken directory?

Please explain the pointer thing and say explicitly what points to what and why they were broken. I'd really like to know, as I'm putting down an idea-list if I'd ever feel like making a useable disk-editor thingo that would support different linux fsms.

Quoted 9 lines

The ugliest one of these was on a system where fsck refused to grow lost+found (because doing so would require more blocks - which are hard to get if you can't trust the free list at the moment - that's why old mkfs commands would have a loop that touched a bunch of files in lost+found and then rm them - just to grow the directory size).

So quite often, you'd end up doing an 'fsck -n' once to figure out what was scrogged, then re-run it several times, answering 'y' to things in the right order...

Again, that looks like fsck was broken and not doing its job. Please say what kind of info the fsck was providing to you with fsck -n, and how did you use that info to answer 'y' in the right order. I assume that:
1. the fsck will be able to answer most of these questions if it had code to do it,
2. the only leftover questions would be those that would have to be asked anyway -- if we'll make users not answer questions when they don't need to, they will learn to answer the important ones.

Please tell me which one of these would you rather see?
- "invalid block counts in groups (blah, lists inodes in groups), fix them?"
- "inode x had zero dtime, fixed"
- or "your fs seems to have suffered corruption that's typical to shutting down an fs without properly unmounting it first, corrected." (that's somewhat generalizing, and based on e2fs)

Cheers, Kuba