3

I did a quick test and got the results below. What's with the horrible time resolution? Is there a way I can make it better?

creation
129971441605098285
mod
129971442166583272
a.ToFileTimeUtc()
129971442170000000
b.ToFileTimeUtc()
129971442170000000

The results of ToFileTimeUtc (which returns the number of 100ns ticks since Jan 1, 1601) show that the timestamps have been rounded to the nearest second, instead of being stored with their full precision.

I'm using Samba on Ubuntu. I grabbed the config file from somewhere. I'm transferring files to a NTFS filesystem mounted by Linux over samba

[global]
netbios name = toltec
workgroup = METRAN
security = user
wins support = yes
preferred master = yes
os level = 65


[homes]
comment = %u's Home Directory
browsable = no
read only = no
17
  • First off, we're not .Net programmers here. Having Googled it, it appears that 129971442170000000 is a count in 100ns ticks (WTF, Microsoft?), so 12997144217 seconds. But with a Jan 1 1601 epoch. So, basically, you're asking how to get better than 1-second resolution with Samba?
    – derobert
    Commented Nov 13, 2012 at 17:26
  • Second, you need to tell us some detail about your Samba server. In particular, are you using ext3 or ext4 (or something else entirely)? Ext3 doesn't support subsecond timestamps. Ext4 does.
    – derobert
    Commented Nov 13, 2012 at 17:31
  • @derobert: ah sorry. Ok so its actually worse then you think. I subtracted the date from 129971441605098285 and 129971442170000000 which got me a 56.49 seconds difference. Thats nearly a minute off
    – user4069
    Commented Nov 13, 2012 at 19:39
  • Hmmm, is the clock on the server set correctly?
    – derobert
    Commented Nov 13, 2012 at 19:47
  • @derobert: That doesn't exactly matter. Look at all those zeros. Also its a VM and the time is correct
    – user4069
    Commented Nov 13, 2012 at 19:48

1 Answer 1

1

From the long comment chain, it appears that ntfs-3g (or possibly FUSE) doesn't fully support 100ns timestamps, or at least the version in Ubuntu 12.04 does not. There are random forum threads that indicate FUSE 2.9 is required, but Ubuntu 12.04 has 2.8.

Ubuntu 12.10 does have FUSE 2.9, but its not a long-term support release. So you probably don't want to upgrade to it.

Another alternative would be to switch to a filesystem that supports high-resolution timestamps in Ubuntu 12.04, such as ext4. Unless you plan on disconnecting the disk from the Samba server and connecting it to a Windows machine, this is probably a better choice than NTFS anyway, especially if you enable extended attributes in Samba.

1
  • There isn't anything on it so i'll grab 12.10 and give it a try.
    – user4069
    Commented Nov 14, 2012 at 19:10

You must log in to answer this question.