Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Slackware This Forum is for the discussion of Slackware Linux.


  Search this Thread
Old 03-30-2005, 08:28 AM   #1
Registered: Mar 2005
Location: BC, Canada
Distribution: Slackware 14.2 x64
Posts: 281

Rep: Reputation: 57
Angry Heeelp! How to preserve file date modification attribute

Heeelp! How to preserve file date modification attribute
Ok, I've tried everything.
Google didn't help much either.
The BIG problem:
When I copy files from my FAT32 partition into my Linux partition (Raiserfs) the file modification date is fine.
But when I copy files the other way, from my Linux partition to the FAT32 partition with any graphical tools like Konqueror, Emelfm etc., then the file modified attibute changes to the time the file was copied.
Also, when using the cp -p command, it makes no difference. I get the error:

cp: preserving times for `<copied file name here': Operation not permitted
and the file is copied but with date changed.

I'm beginning to understand that the problem is permission based. Because "root" owns the fat32 partition, and when I copy the file as a regular user then the permissions are not right.
I suppose setting 'me" to the owner of the fat32 partition would resolve the problem.
BUT, then I'm reducing a multi-user system to a single-user system. Because other users (not that there are any right now) will get their file attributes trashed if they copy their files to the fat32 partition.
I need to keep file modification dates for my invoices, to be able to quickly tell when I had sent that invoice out.
When I copy the invoices (and any files for that matter) onto the fat32 partition as a backup, the dates get changed to current date (I found that out, to my horror, when copying all my data files before upgrading to Slack 10.1) and my data files are screwed when it comes to the dates.

My fstab entry for the fat32 partition:
/dev/hdb6 /mnt/h vfat auto,users,umask=000 1 0

When I use the ummask=000 then any user can write to the partion but dates get trashed.
If I don't use the umask then dates get preserved if I use the cp -p (or Midnight Commander with preserve attibutes checked) but then regular user who is not the owner of the fat32 partition can't copy files there.

Another situation that comes into play is with Samba.
I have the fat32 partition shared with Samba too, so I can access it from my other Slack box and from my Slack laptop.
So how does Samba affect the file attributes? Any special settings for the shares to preserve the file attributes.

If anyone has any solutions or insights into this, please help me.
I've read through the Samba manual but couldn't find anything that would give me any definitive clues.
And man fstab and man mount are not very helpfull at all.
This situation realy kills my productivity.

Basicaly, MY GOAL is to have REGULAR USERS COPY FILES to and from the FAT32 PARTITION(S) with file MODIFICATION ATTRIBUTE (in particular file modified DATE) PRESERVED.

Thank You.
Old 03-30-2005, 09:36 AM   #2
Senior Member
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 332Reputation: 332Reputation: 332Reputation: 332
The problem is (as far as I know) the FAT32 filesystem does not have a "modification date", only a creation date. As a result, copying the file to a FAT32 creates it, and sets the date to the current date. What you are asking for is to have the modification date mapped to the creation date on a copy, which isn't something "normal".


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Get file modification date/time in Bash script cmfarley19 Programming 16 04-15-2015 06:25 PM
Heeelp! Preserving file modification attribute Slackovado Slackware 4 04-01-2005 02:31 AM
File Modification Date Comparison MadTurki Programming 7 03-08-2004 04:02 PM
New Samba date modification problem mdkelly069 Linux - Networking 14 01-12-2004 11:42 AM
Help with Samba and date modification mdkelly069 Linux - Networking 6 11-28-2003 06:26 PM > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 02:07 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration