How to solve some permission problems on your NTFS, FAT partitions, etc.

The best way to explain this problem is through its symptoms. Has it ever happened to you that it doesn't let you trash files specifically deleted on one of your partitions (generally an NTFS or FAT)? You may have trouble unzipping TAR files, getting the unintuitive message: "cannot utime: Operation not permitted". Well, in essence the problem is the same: the assignment of permissions when mounting your partitions is wrong.


Our reader Gustavo Kirch wrote to us asking for help with a problem that I imagine several of you must suffer: not being able to send deleted files from an NTFS or FAT partition to the trash. The strange thing about this behavior is that it does allow the user to permanently delete the file (via Shift + Del) but not send it to the trash (Del). Strange, right?

Gustavo also complained about not being able to unzip TAR files on those partitions (only TAR or TAR.something, for example TAR.GZ, TAR.BZ2, etc.). The strange thing about all this is that if he copied the TAR file to the desktop or to any other path stored in his EXT partition, everything was fine. It was possible to unzip it and do whatever it takes with it. Rarer still was the fact that on its NTFS or FAT partition it could unzip other formats (ZIP, RAR, etc.) without any problems. The error obtained in the case of TARs was quite cryptic: "cannot utime: Operation not permitted".

Actually, the cause of both problems is only one: a bad assignment of permissions of the partition in question.

To fix them, I opened a terminal and typed:

sudo gedit / etc / fstab
Note: The / etc / fstab file indicates which disks and partitions to auto-mount at system startup and the settings for that process.

The first thing you have to do is detect the line in which the mounting of the problematic partition is set. It could be, for example:

# / windows was on / dev / sda1 during installation

UUID = 572C8DDF568B4261 / windows ntfs defaults, uid = 1000, gid = 1000, noatime 0 0

The UUID is the unique identification number of each partition. It could also say something like / dev / sda1 or similar (indicating the path of the device). What follows is the path where to mount that partition. In this case / windows. The rest are the parameters that indicate the type of partition (ntfs, fat, ext3, etxt4, etc.) and the permissions (that determine who has access to that partition and under what conditions - read only, read and write, etc. ), among other things.

The solution consists simply in adding to the line of your problematic partition the part that says uid = 1000 and gui = 1000. What this means is that User (User ID = uid) 1000 and group (Group ID = gid) 1000 will be the "owners" of that partition. The uid and gid 1000 generally correspond to the main user of the machine. To see your uid and gid go to System> Administration> Users and groups. Then click the button Manage groups, find your username and click the button Properties. To do it directly from the terminal I wrote:

id

It is also important that you delete any mask parameter (umask, dmask, fmask) that has that line and replace it with defaults, unless you know exactly why you want to quit. These parameters fine-tune the permission policy (who can execute, read, modify, or create files) for that partition.

In conclusion, If you want you can copy-paste everything that follows the word ntfs in the previous example and copy it in your / etc / fstab in the corresponding place.

I am leaving some things out, but roughly that is what should be done. To really learn how to handle / etc / fstab settings, you would need a post entirely dedicated to it (which I will surely write in the future).

Thank you Gustavo for sending us your question!

Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   Krafty said

    The truth is very good as always.

    It has happened to me that when I have, on the NTFS partition, a file with a check mark in the name, in Linux the file seems to be missing !!!!! How do I solve it???

    regards

  2.   altobelli said

    I think I have a similar problem. Surely you believe it in one of those tinkering that I have put to my system: A x gdm user does not let him log in to Xubuntu, on the other hand under Gnome there is no problem. Gnome (core) install it last.

  3.   nenelinux said

    sorry but I don't understand well ... can you give us an example of how the file should look?

  4.   Let's use Linux said

    Mmm so weird. The truth is that I have no idea what could be happening. 🙁

  5.   nenelinux said

    I have that little problem from ubuntu intrepid and today I have solved it thanks to you 😀

    It seemed complicated to me but in fact it is super simple although I must admit that your example has helped me enormously

    once again thank you very much 😀

  6.   Let's use Linux said

    I guess adding the parameter nls = utf8 to the line where the NTFS partition is mounted in your / etc / fstab should solve it. 🙂
    Cheers! Paul.

  7.   Let's use Linux said

    In case you have this problem (see the first paragraph of the post), you should modify the / etc / fstab. Specifically, the line that mounts the problematic partition (that depends on your system). Now copy and paste everything that says after the word ntfs in the previous example. Then, copy it to that line of your fstab replacing those parameters.

    For example, if you had:

    UUID = 572C8DDF568B4261 / windows ntfs umask = 007, gid = 46 0 0

    You should stay:

    UUID = 572C8DDF568B4261 / windows ntfs defaults, uid = 1000, gid = 1000, noatime 0 0

  8.   Let's use Linux said

    That good! I'm glad I could help you!
    Do not forget that if you have any other problem whose solution may be useful to share with the rest you can write to me at let's uselinux@gmail.com.
    Cheers! Paul.

  9.   Pablo Aznar Liz said

    Interesting information. How could this solution be extended to USB drives? (I often have problems with these devices?

  10.   DCOY said

    Hi, I have a partition in ntfs that I share both in win2 and in GNU / Linux, but the scripts and files in .txt I cannot change the permissions, and the "Make this file executable" box is always checked, my fstab is So:

    UUID = 2608A05D70B9BF80 / home / decoy / Documents / ntfs-3g defaults, uid = 1000, gid = 1000, auto 0 0

    1.    Manual of the Source said

      Send your question to the forum so they can help you: http://foro.desdelinux.net

      1.    DCOY said

        Thank you! Right now I am passing by 😀

  11.   edi said

    Hello, although this post has been around for a long time, I just found myself in the same situation.
    In my case, with Ubuntu 14.04 until now, I manually mounted the two data disks that I have in addition to the operating system.

    From the Disks application, by clicking on the gears icon, I have modified the automounting options so that I do not have to manually mount them every time I turn on the computer, and I have realized that now it no longer lets me send to the recycle bin, the files delete them directly.

    When I go to the fstab file with the command indicated in this post, the following appears:

    #
    # / was on / dev / sda1 during installation
    UUID = 64f34382-6607-490c-a15f-bf1728ab7025 / ext4 errors = remount-ro 0 1
    # / home was on / dev / sda3 during installation
    UUID = 795a0319-2746-4519-a7f5-5b6909047713 / home ext4 defaults 0 2
    # swap was on / dev / sda5 during installation
    UUID = 0d6e7960-3a43-45ba-964a-497d2ec6c777 none swap sw 0 0
    / dev / disk / by-uuid / 01FCD1087CE12525 / mnt / 01FCD1087CE12525 auto nosuid, nodev, nofail, x-gvfs-show 0 0
    / dev / disk / by-uuid / 46FC4685FC466EED / mnt / 46FC4685FC466EED auto nosuid, nodev, nofail, x-gvfs-show 0 0

    Any ideas what to modify so that I can trash?

    regards

    1.    let's use linux said

      Hi edi!

      I think it would be better if you ask this question in our question and answer service called Ask DesdeLinux so that the whole community can help you with your problem.

      A hug, Pablo.

  12.   David Becerra Montellano said

    Hello everyone,

    Almost most of the time, it's best to do things in console on Linux OS.

    ==> To find the UID value (Id User) in debian look for the following file:

    sudo vim / etc / passwd -> inside, there is your username or hostname

    Example:

    youruser: x: 1000: 1000 :: / home / youruser: / bin / zsh

    and in this case the Uid is 1000

    ==> In the case of the GID (Groups Id) it is located in the file:

    sudo / etc / groups

    Example:

    youruser: x: 1000:

    The group is 1000 and they are the values ​​that you configure in the / etc / fstab file

    Greetings.