[lug] question about ext 2/3 fs

Paul E Condon pecondon at mesanetworks.net
Thu Oct 19 11:23:00 MDT 2006


On Thu, Oct 19, 2006 at 03:33:13AM +0000, D. Stimits wrote:
> Paul E Condon wrote:
> 
> >I'm having a problem with mtime handling in coreutils. I won't
> >give details of that problem, but ...
> >
> >I look into how Linux keeps track of mtime for files. I find
> >that it is stored in the inode of the file, and that 64 bits are
> >allocated for the number of seconds since the Unix epoch.
> >Fine but somehow 'ls --full-time' displays a fractional part of
> >a second right down to a nanosecond (9digits!). Where is this
> >stored? It haven't seen any mention of it. Where is the way
> >its done documented?
> > 
> >
> I won't guarantee it, but I highly doubt it is *stored* to that 
> resolution. Several of the UNIX type time functions and structures 
> reserve that high of a resolution so it is possible to use that much, 
> but the input those functions use will not necessarily be that high of a 
> resolution. Garbage in, garbage out, i.e., I believe that the functions 
> used do not actually measure the resolution of the raw data, and by 
> default, just report all that might have been used. I notice on mine, 
> for example, that almost all of the time given is padded to zero, 
> despite showing more decimals. If it does not pad right-most decimals, 
> it's probably a bug/oversight.
> 

I rebooted my machine and all the frational seconds digits got set to
zero on my test files, so your surmise that these are not stored on
disk certainly has a lot of explanatory power.

But these digits mess up my attempts to test a backup system. Does
anyone know of a way to clear them out of the OS that is faster than
rebooting?  Is there a system call, or better yet, a command line
utility? (sync doesn't clear internal OS mtime data)

I'm using Debian Sarge Linux 2.6
-- 
Paul E Condon           
pecondon at mesanetworks.net



More information about the LUG mailing list