[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: problem with util-linux-ng fsck and board with no clock



On Wed, Aug 26, 2009 at 01:57:20PM +0100, David Goodenough wrote:
> I have an embedded board (a PCEngines Wrap board) which has no
> persistent clock.  With earlier configurations I set the clock with ntpdate
> once the network was up.

interesting. I have no experience with this sort of installation, but
have some observations/ideas that might help.

> 
> But with current sid I have a problem in that fsck in util-linux-ng  2.16  
> complains that the "Superblock last mount time (Sat Jan 1 00:01:08
> 2000, now = Sat Jan 1 00:00:49) is in the future".

it appears that the system is mounting prior to having set the clock
as well, which makes sense. 

> 
> Even if I do an fsck on the machine manually and then reboot, it always
> fails.

sure, because the mount time will always be later than the time at
which it is trying to run fsck. 

> 
> I have found some mentions on forums that swapping the order in which
> init starts up helps, by ensuring that the system clock is set properly, but
> I can not do that until much later when I have a network.
> 
> Any ideas as to how to proceed.  Is there some way to supress this
> time check?

I know of no way to suppress this time check but have some ideas about
how to get around it. 

You could create either a custom wrapper for the fsck script, or run
your own script both before and after it. The one before to set the
clock well into the future so that fsck is guaranteed to run well
before "now". Then after fsck runs, set the clock back to 1/1/2000 so
that the superblock last mount time will be nicely early again. 

or, you could set the clock back to "zero" right before mount every
time. Since it takes about 49 seconds to get to fsck, you may be able
to fool fsck on future boots by having the mount time some time prior
to 0:00:49.

or, as you mentioned, rework the order of things. I'm not sure how
much of the system you need to run ntpdate, but if you move networking
earlier and fsck later you should be able to make it work. You might
have to fiddle with mount options for /, changing it to rw to get
networking up and then back to ro for fsck.

just some thoughts.

hth

A

Attachment: signature.asc
Description: Digital signature


Reply to: