Permissions in external NTFS devices

Please post suggestions for improvement of Cinnamon on:
https://github.com/linuxmint/Cinnamon
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
Dupre

Permissions in external NTFS devices

Post by Dupre »

Hello,

I just installed Linux Mint 16 with Cinnamon.

When I plug an external hard disk, with NTFS, Nemo mount it with no exec permissions for files. Nemo mount it with rw- --- ---, and I would like to change the default permissions to rwx-rwx-rwx, so I can execute files and let other users access files and dirs.

I had found solutions using fstab and mount, but I would like not to configure or mount every device manually. I had already searched information, and I know that NTFS permissions are set at mount and cannot be changed with chmod because they are fixed while dive is mounted, so the solution would be to tell Nemo to mount external NTFS with other pemissions. I had ubuntu 10.04 and all NTFS external drives get mounted with full permissions. I would have the same behaviour in Cinnamon.

My fstab does not show the external usb drives automounted. My mtab shows the this line for the external hard drive:

"/dev/sdh1 on /media/user/SED_01 type fuseblk (rw,nosuid,nodev,allow_other,default_permissions,blksize=4096)"

I think the problem is "default_permissions", but I don't know where I can change it.


Thanks in advance for your help.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
kyphi
Level 9
Level 9
Posts: 2735
Joined: Sat Jul 09, 2011 1:14 am
Location: The Hunter Valley, Australia

Re: Permissions in external NTFS devices

Post by kyphi »

With the drive connected to change ownership use

Code: Select all

sudo chown yourname:yourname -R /media/disk
To change permissions use

Code: Select all

sudo chmod -R 777 /media/disk
Linux Mint 21.3 Cinnamon
altair4
Level 20
Level 20
Posts: 11460
Joined: Tue Feb 03, 2009 10:27 am

Re: Permissions in external NTFS devices

Post by altair4 »

I can't help but think that this is going to be confusing to use but see if this does what you want.

This is going to be a temporary mount so if it doesn't do what you want you can undo it without harm:

[1] Install bindfs:

Code: Select all

sudo apt-get install bindfs
[2] Create a directory outside of /media:

Code: Select all

sudo mkdir /ExtDisks
[3] Temporarily mount ( actually it's a remount ) /media to /ExtDisks with immutable permissions:

Code: Select all

sudo bindfs -o perms=0777 /media /ExtDisks
Note: To undo this remount run this command:

Code: Select all

sudo umount /media
Now here is where it's going to get confusing. Plug in an external usb storage device:

*** You will get a mount icon on the desktop and in Nemo but if you select those it will take you to /media/$USER/LABEL with the permissions you don't want.

*** If you go to /ExtDisks/$USER/LABEL however you will see that all folders and files will have permissions of 777.

*** You continue to unmount these devices through Nemo and the desktop not through /ExtDisks

*** You basically have 2 mount points for every USB device - one in the normal place and one in /ExtDisks.

Play with this for a while and see if it does what you want. We can make this thing happen automatically at every boot if it works for you.

Just be careful with this as it can have unwanted consequences since /media/$USER is used by the system to mount all sorts of non-internal devices and other internal partitions not in fstab.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
jasminj

Re: Permissions in external NTFS devices

Post by jasminj »

I had the same problem and found a solution here.

Create a file /etc/udev/99-usb-disks.rules (as root) and enter

Code: Select all

ENV{ID_FS_TYPE}=="ntfs", ENV{ID_FS_TYPE}="ntfs-3g"
This will remove "default_permissions" option from the mount command generated by the automount process. Output of mount:

Code: Select all

/dev/sdb1 /media/jasmin/Extern_2T fuseblk rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096 0 0
Now all files have set the execuable bit, but at least I can run my scripts from the NTFS partition now.

I am not really happy with this solution, because it might use a side effect and may not work in the future due to program changes.

A much better solution would be the possibility to define the used mount options for NTFS USB drives in a config file in "/etc" or "~/.config".
Locked

Return to “Cinnamon”