Moving files to NTFS partitions

Hi there!
I have a PC with DUAL BOOT for openSUSE Leap 42.2 (clean installed) and Windows 7.
My /etc/fstab file has the following entry for the NTFS partition:

UUID=904EBA4B4EBA2A3C /DATA ntfs-3g users,gid=users,fmask=113,dmask=002,locale=en_US.UTF-8 0 0

But, when I want to move a file to that partition, the following message is printed out:

adrian@asia:Temporal> ls
test_file.txt
adrian@asia:Temporal> mv test_file.txt /DATA/Users/Adrián/Documents/
mv: preserving times for ‘/DATA/Users/Adrián/Documents/test_file.txt’: Operation not permitted
mv: preserving permissions for ‘/DATA/Users/Adrián/Documents/test_file.txt’: Operation not permitted

adrian@asia:Temporal> ls
adrian@asia:Temporal>

As you can see, the file (“test_file.txt”) is moved anyway.

If I try to copy the file to the NTFS partition, it is normally copied:

adrian@asia:Temporal> cp test_file.txt /DATA/Users/Adrián/Documents/
adrian@asia:Temporal> ls
test_file.txt
adrian@asia:Temporal>

What is wrong?
Why “Operation not permitted” when I try to move the file?
Can sombody help me to avoid this message?

When I try to move the file by mean Dolphin, an error message is printed out saying:
**"Access denied to /DATA/Users/Adrián/Documents/**test_file.txt"

Thank you in advance.

It’s usually easier I find not to have a fstab entry

The volume should still be visible in Dolphin
When you click to mount you will need your admin password to give you full access

If you insist on fstab
The line will need to be edited to

UUID=904EBA4B4EBA2A3C /DATA ntfs-3g defaults 0 0

You may still need to chown /DATA

You only showed

ls test_file.txt

thus the only thing we know about it is that it exists. But we know nothing about it’s ownership and permission. Things that are crucial to understand which operations are permitted or not.

Thus please

ls -l test_file.txt

And btw, please use CODE tags, not Quote tags, around computer texts. It is the # button in the tool bar of the post editor.

You are right. I beg your pardon.

These are data you asked for:


adrian@asia:Temporal> ls -l
total 4
**-rw-r--r-- 1 adrian users 12 Nov 24 18:06 test_file.txt**
adrian@asia:Temporal> whoami
adrian
adrian@asia:Temporal> groups adrian
adrian : users
adrian@asia:Temporal> ls -l /DATA/Users/Adrián/
total 44
drwxrwxr-x 1 root users  4096 Nov  2 21:45 **Bass**
drwxrwxr-x 1 root users  4096 Oct 15 11:44 **Development**
**drwxrwxr-x 1 root users  4096 Nov 23 21:15 **Documents****
drwxrwxr-x 1 root users  4096 Nov 21 22:47 **Downloads**
drwxrwxr-x 1 root users  4096 Nov 19  2015 **EducaciónIT**
drwxrwxr-x 1 root users     0 Nov 19  2015 **Hardware**
drwxrwxr-x 1 root users 12288 Nov 19  2015 **J2ME**
drwxrwxr-x 1 root users     0 May 31 14:13 **Linux**
drwxrwxr-x 1 root users  4096 Oct 20 21:19 **Manuals**
drwxrwxr-x 1 root users  4096 Feb 28  2016 **Multimedia**
drwxrwxr-x 1 root users     0 Mar 18  2016 **Projects**
drwxrwxr-x 1 root users  4096 Nov 19  2015 **Software**
drwxrwxr-x 1 root users     0 Jun 13 19:54 **Temporal**
drwxrwxr-x 1 root users     0 Nov 19  2015 **VirtualBox**
adrian@asia:Temporal>  
adrian@asia:Temporal>  
adrian@asia:Temporal>  
adrian@asia:Temporal>  
adrian@asia:Temporal>  
**adrian@asia:Temporal> mv test_file.txt /DATA/Users/Adrián/Documents/
mv: preserving times for '/DATA/Users/Adrián/Documents/test_file.txt': Operation not permitted
mv: preserving permissions for ‘/DATA/Users/Adrián/Documents/test_file.txt’: Operation not permitted
adrian@asia:Temporal>  
adrian@asia:Temporal> ls -l
total 0**
adrian@asia:Temporal>  
adrian@asia:Temporal>  
adrian@asia:Temporal>  
adrian@asia:Temporal> **ls -l /DATA/Users/Adrián/Documents/**
total 1411
drwxrwxr-x 1 root users    4096 Nov 19  2015 **Celiaquía**
-rw-rw-r-- 1 root users   40022 Oct 11 18:13 Constancia_Cuil.pdf
-rw-rw-r-- 2 root users  169984 Oct 22 15:15 Contraseñas.xls
drwxrwxr-x 1 root users    4096 Jan 19  2016 **Curriculums**
-rw-rw-r-- 1 root users      52 Nov 19  2015 desktop.ini
-rw-rw-r-- 2 root users   38912 Apr 20  2010 Fondo Fijo.xls
drwxrwxr-x 1 root users    4096 Nov  9 17:57 **Impuestos y Servicios**
-rw-rw-r-- 2 root users   11181 Nov 22 21:32 Installation Data.xlsx
drwxrwxr-x 1 root users    4096 Nov 19  2015 **Obra Tuyutí 7126**
-rw-rw-r-- 1 root users   16451 Apr 26  2016 PetShop.txt
-rw-rw-r-- 1 root users 1081344 Aug 17  2010 Pointer.doc
-rw-rw-r-- 1 root users    9728 May 26 16:28 Pointer.xls
-rw-rw-r-- 1 root users   11264 Jun 18  2014 Reclamos.xls
-rw-rw-r-- 1 root users     646 Nov 23  2014 Speedy.txt
-rw-rw-r-- 2 root users   32768 Aug 30 18:15 Tapa CD.doc
-rw-rw-r-- 2 root users      74 Aug 22  2015 Telefónica.txt
**-rw-rw-r-- 1 root users      12 Nov 24 18:12 test_file.txt**
adrian@asia:Temporal> 

As you can see, I try to move a file, the answer is “Operation not permitted”, but the file was moved anyway.
Thank you, very much.

However, if you us “cp -p” to preserve permissions on copy, then you will get a similar error message (but the file is copied anyway).

Are yuu sure it was moved? It was copied. But is the original file deleted?

Moving (in Unix/Linux) with the mv command is a bit strange beast. You can use it for:

  • Changing the name of a file (nothing is moved at all). You need w-permission for the directory and rx permissions in all directories leading to it.
  • Moving the file within the same file system to a place in another directory. Here the file is not moved at all, but the entry record of the file in it’s directory is moved to another directory. That is just a minor action. (BTW you can do a name change together with the move). You need w-permission for both involved directories and rx permissions in all directories leading to them.
  • Moving the file to another file system involves a copy of the file to that other file system and a remove of the file on the original file system. It is in fact a combination of a cp and an rm. For the cp you need wx-permissions for both directories, rx permission for all directories leading to it and r-permission for file. For the rm you need additional wxr permission for the original directory.

I tried to gather information from you to check this. I think what we are still missing is the ownership/permission of the “sending” directory Temporal. And those are critical to the rm part of the move action.

Did I understand this problem wrong? Did aecordoba’s problem was only the preserving of times and permissions was not permitted? So the mv/cp operation is successful with original timestamps and permissions lost/reset.

IF this is the case, then caf4926’s suggestion should work, using following /etc/fstab option:

UUID=904EBA4B4EBA2A3C /DATA ntfs-3g defaults 0 0

Forgive me if I’m wrong, just trying to figure out the situation.

I do not read anything about “preserving time and permissions” in the first post of this thread. I think the following is what he asks:

Why “Operation not permitted” when I try to move the file?
Can sombody help me to avoid this message?

It is btw impossible to preserve permissions (and owners) when copying to an NTFS file system. They do not exist on such a file system and can thus not be stored there, let alone preserved.

Hi hcvv,

Sorry for the confusion that I pruned the original messages, which are in the quoted section.

So there are informations before the “Operation not permitted” statements. So I think the operations not permitted are the two “preserving” operation but not the “mv” operation, because aecordoba also said,

As for the btw part,

I cannot agree with you more.

Sorry guys but I think I have something new about this problem.

I just checked in my laptop, having a Windows 10 and openSUSE Tumbleweed dual systems just like the OP’s. It seems can preserve the timestamp while mv a file from Linux to NTFS partition of the Win10. Here is the output.


~> ls -nl gpu.hang.error.txt
-rw------- 1 1000 100 775146 Nov 22 14:39 gpu.hang.error.txt
~> mv gpu.hang.error.txt /WinD
~> ls -l /WinD/gpu.hang.error.txt
-rw------- 1 1000 0 775146 Nov 22 14:39 /WinD/gpu.hang.error.txt

And FYI, my fstab for this partition looks like this,

UUID=<uuid> /WinD                ntfs-3g    rw,uid=1000,fmask=177,dmask=022,locale=en_GB.UTF-8 0 0

But I cannot remember what else I have done for this. Or maybe there is not anything else.

Hm, I think you are correct. I am afraid that I was confused by the computer output not being between CODE tags and also because that output is obviously fumbled with. Some characters are bold there, which I do not believe the shell and/or ls does. And when the output is fumbled with, I mistrust all of it :(.

In my resume above where I explained that mv from one file system to another, there is missing the fact that also the equivalence of touch to set the date/time stamps of the new file to those connected to the original file is needed.

Now owner of all files on the mounted NTFS file system is root (due to mount parameters). And adrian can not change the date/time (using touch or any other means) on a file in a directory that are both owned by root: permission error.

Thus the solution to mount with adrian as owner will help adrian, but not other users.

============

I always try to avoid non-Linux file systems as the plague.

No problem.

Maybe because I am a newbie to Linux style :slight_smile:

I think you are right. It might only work for regular pc/workstation user.

It is pretty hard for a fresh Linux user like me myself, I think.

Hi Andrán, thanks for your consideration :slight_smile: I hope the later suggestion works for you.

I doubt this is Linux style. When you have a problem with your car, the repair shop also wants technical information as raw as possible, without anybody changing things in it or trying to stress a conclusion he/she may have jumped to.

Agreed. Sorry for my bad parlance. I just want to say that new user is still learning the way of expressing, or reporting problem to make it clearer and more straightforward (as original) to experienced users. For example, to learn the use of quote and / or code markup in a forum.

Oh yes, everything has it’s learning curve. Specially the CODE tags are not easy to find. Most often we send a PM to new people when we see they don’t know about it because it is not an obvious feature.

You moderators are very kind and extremely helpful on analysing and solving problems. Thanks :slight_smile:

Thanks a lot.

But sometimes, I personaly, am a bit nasty :shame:

Thank you, to all.
One more question:
Can somebody tell me where can I get full documentation about fstab in order to understand this configuration file?

Thanks, again.

man fstab

and I think that you also need

man mount

BTW, when you have KDE, I prefer reading man pages using Konqueror and typing in the address bar thigns like;

man:/fstab

or even shorter

#fstab