File timestamp problems - Need fstab help. [SOLVED]

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read this

File timestamp problems - Need fstab help. [SOLVED]

Postby bobsmith on Fri Jun 26, 2009 3:52 am

Here's the problem: When I edit a file in Mint and copy it to an ntfs partition, the time-stamp on the file changes.

Example: I edit a file at 5:00 PM and save it to my desktop - then I copy that same file to my ntfs partition at 6:00 PM. The time-stamp on the file copied to the ntfs partition changes from to 5:00 PM (the actual time it was last edited) to 6:00 PM (the time I copied it). This is a huge pain for many reasons.

I think I have narrowed it down to a matter of file ownership, and I think this problem can be fixed by editing the fstab file. In other words, I need to address the fact that my user id isn't specified in fstab, therefore a copy command can not change the file date back to the file date of the source file (I think). However, I'm reluctant to mess with the fstab file without confirming that what I'm doing won't create other, unintended problems. So if someone would examine the changes I'm intending to make, I'd appreciate it.

Here's the original line in my fstab file:
Code: Select all
/dev/sdb1 /media/Disk2Bkp ntfs defaults,umask=007,gid=46 0 0

And here's how I'm planning to change that line:
Code: Select all
/dev/sdb1 /media/Disk2Bkp ntfs defaults,users,uid=bob,umask=007,gid=46 0 0

All I did was add this: users,uid=bob (and "bob" is my Mint login name). Here are my questions:

1) I'm confused about the "defaults" option in that fstab line. I know that "defaults" is shorthand for all of these options: rw, suid, dev, exec, auto, nouser, and async. So... can I leave the "defaults" option in there? Will my addition of the option "users" override the "nouser" option included in "defaults", or will it conflict?

2) Am I putting "users,uid=bob" in the right place/order in the line (after "defaults"), or does it even matter?

3) Will this accomplish what I intend (to make file timestamps stick)?

Any help would be appreciated.
Last edited by bobsmith on Mon Jun 29, 2009 3:50 pm, edited 1 time in total.
Linux Mint 17 Mate, 16GB RAM, 64 bit Intel CPU
bobsmith
Level 3
Level 3
 
Posts: 104
Joined: Mon Jan 05, 2009 4:37 pm

Linux Mint is funded by ads and donations.
 

Re: I'm having file timestamp problems - Need fstab help.

Postby DrHu on Fri Jun 26, 2009 4:57 am

Possibly using noatime option for the mounted fs
http://tldp.org/LDP/solrhe/Securing-Opt ... sec73.html
http://openrent.blogspot.com/2006/11/no ... ained.html

timestamp bug Linux --> ntfs..
https://bugs.launchpad.net/ubuntu/+sour ... bug/314860
Richard E T wrote on 2009-04-07: (permalink)

I can add something to this.
This is happening in Jaunty as of today. If you rely on the fstab entry as set up by the Jaunty installer for an internal partition (device mountpoint ntfs defaults,nls=utf8,umask=007,gid=46 0 1), you get:

Nautilus file copy ext3 partition -> NTFS partition - date/time changed to current.
Nautilus file copy NTFS partition -> ext3 partition - date/time preserved.

But if you change the fstab entry to a simple:
device mountpoint ntfs defaults 0 0
...date and time stamps are preserved both ways. In fact that's what I've been using (or with filesystem field = ntfs-3g) for quite some and I have yet to have a problem with it.

Also to add: date/time is preserved copying both ways with an automounted external NTFS drive. No problem there.
User avatar
DrHu
Level 16
Level 16
 
Posts: 6798
Joined: Wed Jun 17, 2009 8:20 pm

Re: I'm having file timestamp problems - Need fstab help.

Postby bobsmith on Mon Jun 29, 2009 3:49 pm

Well, I accomplished what I set out to do. My ntfs partitions now preserve the original time-stamp on files. I finally ended up going with this:

Code: Select all
/dev/sdb1 /media/Disk2Bkp ntfs defaults,users,uid=bob,umask=007,gid=users 0 0

Note that "bob" is my login name. So far I don't see any unintended consequences. The only other thing I noticed is that now there are new ".Trash-1000" directories in my ntfs partitions, and files deleted on my ntfs partitions can now go to the trash-bin in Mint.

So all is well. Thanks for the reply DrHu.
Linux Mint 17 Mate, 16GB RAM, 64 bit Intel CPU
bobsmith
Level 3
Level 3
 
Posts: 104
Joined: Mon Jan 05, 2009 4:37 pm


Return to Newbie Questions

Who is online

Users browsing this forum: No registered users and 25 guests