How can I mount a NTFS partition so that all user accounts on my machine have write access? My mount options are
nosuid,nodev,nofail,x-gvfs-show,nobootwait,uid=1000,gid=1002,fmask=113,dmask=002
This gives me write access but when other users try to delete a file the error message pops up
Cannot move file to trash, do you want to delete immediately?
As I understand this is because they don't have write access which is what I want to change.
I created a new group (with gid=1002
) and assigned it as primary group to both user accounts but that didn't help. I also tried mounting without the fmask
, dmask
and uid
options.
Best Answer
No, this error message does not mean that they don't have write access. If they didn't have write access, you would not be able to right click and "Move to Trash" or "Delete" a file, or use the Del keyboard button. But since you're getting this error, it means that the users do have access.
After two hours of search, and reproducing this error on my computer, here's what I found out.
Explanation
Permissions (owner, group owner, file and directory permissions) are set at the time of mounting. Only the owner can move files to trash. Why? Because when you move files to trash in an NTFS partition, a folder called
.Trash-<uid>
is created in the root directory of the partition, where<uid>
is theuid
of the user, and the folder's owner will be the user that's trying to delete. For example, if the username isdaniels
and theuid
is 1000, a folder called.Trash-1000
is created, anddaniels
would be the owner.So, if
daniels
is the owner of the partition, he'll be able to do this normally. However, if another user (let's say calledalaa
, anduid=1001
) tries to delete something, the system tries to create a.Trash-1001
folder, with the owneralaa
. But, on NTFS, the permissions are set at the time of mounting (example: it was set todaniels
), and the "owner" of any file cannot be changed, and so the system fails to create the.Trash-1001
folder, giving you the promptCannot move file to trash, do you want to delete immediately?
.To test this, try manually creating a folder in the root directory of the partition named
.Trash-1001
(the owner will be set to the owner of the partition). You'll find that hitting Del on the keyboard on any file/folder will not do anything, and the option when you right click an item will change fromMove to Trash
toDelete
. I can't explain why it changes toDelete
, but this is just to identify that the problem is indeed in the.Trash-1001
folder.In my opinion, I classify this as a bug.
Solution (soft of...)
Remove all of your
uid=
,gid=
,dmask=
,fmask=
, andumask=
options from your mount command, and addpermissions
, so I guess your line should be like this:I've tried this on my computer, and it works; both users can move to trash when using the NTFS hard disk.
Here's a demonstration:
Then I went and deleted something using my username
alaa
, then logged in as another useraaa
and deleted something too. Both of them could delete, and this is how the NTFS partition looks like:I don't know how it manages to do that, but it just does.
I found this page: Ownership and Permissions | Tuxera that explains this, as well as a forum post (http://www.tuxera.com/forum/viewtopic.php?f=2&t=27540) that has some useful information. However, unfortunately I haven't read them yet, so I can't explain exactly what this
permissions
option does.I said "Solution (sort of...)" in the title of this section because now you're not controlling who is the owner of the partition, not group owner, nor the read-write permissions. But, when mounting with the
permissions
option, you can see a "Using default user mapping", so as far as I understood, there's a "user mapping" thing that can be created to be used withpermissions
, and that mapping will have the owner/permissions that we want to set. I also have not tried mounting usingpermissions
along withuid=
and all those other options (the Tuxera link I posted should explain that though), but that might also work, by controlling owner/permissions and at the same time give access to Trash.When I read those links, I'll update my answer.