Page 1 of 3 123 LastLast
Results 1 to 10 of 24

Thread: Moving files to NTFS partitions

  1. #1

    Default 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.
    [Adrián E. Córdoba]

  2. #2
    Join Date
    Jun 2008
    Location
    The English Lake District. UK - GMT/BST
    Posts
    36,733
    Blog Entries
    20

    Default Re: Moving files to NTFS partitions

    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
    Code:
    UUID=904EBA4B4EBA2A3C /DATA ntfs-3g defaults 0 0
    You may still need to chown /DATA
    Leap 15.1_KDE
    My Articles Was I any help? If yes: Click the star below

  3. #3
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,124

    Default Re: Moving files to NTFS partitions

    You only showed
    Code:
    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
    Code:
    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.
    Henk van Velden

  4. #4

    Default Re: Moving files to NTFS partitions

    Quote Originally Posted by hcvv View Post
    You only showed
    Code:
    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
    Code:
    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:
    Code:
    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.
    [Adrián E. Córdoba]

  5. #5
    Join Date
    Aug 2010
    Location
    Chicago suburbs
    Posts
    12,608
    Blog Entries
    3

    Default Re: Moving files to NTFS partitions

    Quote Originally Posted by aecordoba View Post
    If I try to copy the file to the NTFS partition, it is normally copied
    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).
    openSUSE Leap 15.1; KDE Plasma 5;
    testing Leap 15.2Alpha

  6. #6
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,124

    Default Re: Moving files to NTFS partitions

    Quote Originally Posted by aecordoba View Post
    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.
    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.
    Henk van Velden

  7. #7
    Join Date
    Jan 2016
    Location
    Manchester, UK
    Posts
    279

    Default Re: Moving files to NTFS partitions

    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:

    Code:
    UUID=904EBA4B4EBA2A3C /DATA ntfs-3g defaults 0 0
    Forgive me if I'm wrong, just trying to figure out the situation.
    openSUSE Tumbleweed (usually the latest snapshot) w/ KDE Plasma 5

  8. #8
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,124

    Default Re: Moving files to NTFS partitions

    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.
    Henk van Velden

  9. #9
    Join Date
    Jan 2016
    Location
    Manchester, UK
    Posts
    279

    Default Re: Moving files to NTFS partitions

    Hi hcvv,

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

    Quote Originally Posted by aecordoba View Post
    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
    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,

    Quote Originally Posted by aecordoba View Post
    As you can see, the file ("test_file.txt") is moved anyway.
    As for the btw part,
    Quote Originally Posted by hcvv View Post
    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.
    I cannot agree with you more.
    openSUSE Tumbleweed (usually the latest snapshot) w/ KDE Plasma 5

  10. #10
    Join Date
    Jan 2016
    Location
    Manchester, UK
    Posts
    279

    Default Re: Moving files to NTFS partitions

    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.

    Code:
    ~> 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,
    Code:
    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.
    Last edited by cnzhx; 25-Nov-2016 at 04:20. Reason: Change user and group to numbers
    openSUSE Tumbleweed (usually the latest snapshot) w/ KDE Plasma 5

Page 1 of 3 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •