[TriLUG] e2fsck under cron gets retcode=8 operational error

Thomas Gardner tmg at pobox.com
Wed Sep 19 07:04:36 EDT 2012


On 9/18/12, Joseph Mack NA3T <jmack at wm7d.net> wrote:
> On Tue, 18 Sep 2012, Thomas Gardner wrote:
>
>> So, since you found that a bunch of other people were
>> having this problem, and that none of them were able to
>> figure it out, you're going to go grab the source for
>> fsck, find the offending error message, change it, submit
>> the patch upstream, and become the unsung hero to hundreds
>> that follow behind you, right?
>
>
> right ;-\
>
> I spent the evening once drinking with (among others) Ted.
> From what I saw, I don't think he'd regard changes to
> something that he set in stone 20yrs ago as being an
> improvement.

[...whatever...]  You don't always have to break things to make them
more usable for more use cases.  Never mind.  I'll just put it on my
long list of things I want to do ``some day''.  If you could come up
with a list of pointers to those other forums where you saw specific
cases where this was messing people up, I can use that as supporting
evidence.

> eg the output of df: if the name of the device or the output
> is too long, df puts a <cr> in the middle of the line,
> splitting the output into two lines. Now you can't grep for
> a device and expect to find the mount point because they're
> on different lines. I don't know how you're supposed to do
> it.

You use -P option, that's how.  That's exactly what it's there for.
Read The Fine Manual.  :-)  I will concede that the manual is, shall
we say, less than perfectly clear on this point, but it gives you
enough of a hint that it should lead you to try it in this situation
and see if it works (at which point you'd find that it does).

Even without the -P, it's not all that hard to get the same result by
adding an extra stage in your pipeline to get the same kind of result.
 That's how I used to do it before I noticed -P in df's man page.  Awk
would probably be the easiest way (something like
'NF==1{dev=$1;next}{print dev $0;dev=""}' would probably work --- not
real pretty, but you're not really looking for pretty when you're
parsing output), but you could do it with sed, and certainly Perl
could handle it (talk about sending a cannon for a pea shooter's job),
or probably a bazillion other tools, too.  You could probably do it
with bf, too, but then you'd just be trying to show off.  :-)

L8r,
tg.



More information about the TriLUG mailing list