You are not logged in.

#1 2013-01-25 15:02:12

starfry
Member
From: Surrey, UK
Registered: 2010-08-18
Posts: 238

cp cannot preserve times when copying to a cifs mount

Hi everyone,

I've just hit this odd little problem and, so far, google is not being my friend sad

I have this remote filesystem mounted via cifs mounted via fstab like the below:

//10.11.12.13/remoteshare /mnt/localshare cifs noauto,guest 0 0

When I try to use cp I get error messages

cp: preserving times for ‘file’: Operation not permitted

The files do copy file, they just have different time stamps. If I copy as root it works fine.

I haven't been able to find any information via google, or the arch forums/wiki. If anyone can offer any pointers that would be great.

Last edited by starfry (2013-01-25 15:05:44)

Offline

#2 2013-05-15 08:15:46

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,847

Re: cp cannot preserve times when copying to a cifs mount

Not sure if this is a necrobump (sorry if it is), as it's 4 months old, but the information is current and it popped up on the first page of results while I was searching the web for some related information.
So I thought it worth answering.

The fix is to mount the share with the uid option set to your user.


"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

#3 2013-05-15 09:37:09

starfry
Member
From: Surrey, UK
Registered: 2010-08-18
Posts: 238

Re: cp cannot preserve times when copying to a cifs mount

As I am interested in the answer, I don't consider it a necrobump but can't speak for others wink

When you say "your user" do you mean your local user or the user on the remote share ? What if there is no user exposed on the remote share (e.g. like it's just a public share) ?

Offline

#4 2013-05-15 13:38:47

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,847

Re: cp cannot preserve times when copying to a cifs mount

starfry wrote:

As I am interested in the answer, I don't consider it a necrobump but can't speak for others wink

When you say "your user" do you mean your local user or the user on the remote share ? What if there is no user exposed on the remote share (e.g. like it's just a public share) ?

Sorry, I mean the local user you're doing the copying from.

The reason is the files are mounted under the root user by default, but you can give a local user ownership in the mount command.
The remote computer may well be able to override this (I've never tried), but assuming a standard set-up.

I mount my samba share with the "uid=skanky,gid=users" option and can mv and cp to it without permission issues.


"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

Board footer

Powered by FluxBB