File timestamp problems - Need fstab help. [SOLVED]

Quick to answer questions about finding your way around Linux Mint as a new user.
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. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
bobsmith

File timestamp problems - Need fstab help. [SOLVED]

Post by bobsmith »

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 LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
DrHu

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

Post by DrHu »

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.
bobsmith

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

Post by bobsmith »

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.
Locked

Return to “Beginner Questions”