[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How to override fuse args to ntfs-3g to set permissions?



On 28/11/14 05:21 PM, Scott Ferguson wrote:
My apologies for the delay in replying.

On 28 November 2014 at 16:08, Rick Macdonald <rickmacd@shaw.ca> wrote:
On 26/11/14 04:20 PM, Scott Ferguson wrote:
On 27/11/14 06:32, Rick Macdonald wrote:
On 26/11/14 08:24 AM, Rick Macdonald wrote:
On 26/11/14 12:23 AM, Scott Ferguson wrote:
On 26/11/14 16:14, Rick Macdonald wrote:
On 25/11/14 08:46 PM, Scott Ferguson wrote:
<snipped>

I do have an udev rule (see attached and cp it to /etc/udev/rules.d)
that will automagically mount a NTFS formatted slice on an external
drive that has the LABEL "WinBackup" to /media/WinBackup,  that uses
mount options that allow a user to write to it, and 'should' work for
Plex.
https://support.plex.tv/hc/en-us/articles/200288606-Mounting-NTFS-Drives-on-Linux

I have tested this using an USB Flash Drive with a single slice
formatted as NTFS, with the LABEL WinBackup. Thunar Vol Man is set to
automatically mount external drives (though it may be redundant).

$ groups
scott cdrom floppy audio dip video plugdev users fuse netdev

$ mount -l | grep Win
/dev/sdb1 on /media/WinBackup type fuseblk
(rw,nosuid,nodev,noatime,user_id=0,group_id=0,allow_other,blksize=4096)
[WinBackup]

  $ grep ^user /etc/fuse.conf
user_allow_other

It's a far from perfect udev rule, but:-
;regrettably I'm out of time for the moment (apologies to the poster
waiting for assistance with Apple, resuming that is next on my to-do)
;I can't work out how to get around the limitations of NTFS support
(you could try Tuxera, but I suspect they work within the limitations
set by MS)
;I don't understand how Thunar populates the sidebar, and XFCE the
desktop, with the link to the disk LABEL despite digging through 860
results from a "find" for "WinBackup". Hopefully someone will post a
solution for me.

With respect to your Post's Subject - I don't know. They are limited
by /usr/share/hal/fdi/policy/10osvendor/25-ntfs-3g-policy.fdi, which
'seems' to be limited by the option in the ntfs-3g binary. I don't
like the idea of recompiling it and running it setuid (the dangers of
that with a Windows file system seem great). I suspect it's an xy
problem. Do let me know if the default's in the rule (attached) are
insufficient for Plex[*1].

  $ mkdir /media/WinBackup/Test;echo "This is a test" >
/media/WinBackup/Test/test;ls -lR /media/WinBackup
/media/WinBackup:
total 0
drwxrwxrwx 1 root root 144 Nov 29 11:17 Test

/media/WinBackup/Test:
total 1
-rwxrwxrwx 1 root root 15 Nov 29 11:17 test


[*1] I can make some modifications to permissions in the rule (default
mount options, user command is run as, commands that are run).

Let me know how it goes. Hope this makes sense, sorry if I've missed
posts - I can't get at my usual work machine remotely at present and
are reduced to using the Gmail web interface (sob).


Hey, thanks for all this!

I created a thumb drive for testing. Using the actual drive takes too long, as the cable is awkward, the drive spins up and down, etc.

I added my uid/gid to the rule for jollies, so it mounts as me instead of root. Plex should work in either case with wide-open 777 mode.

ACTION=="add", PROGRAM=="/sbin/blkid -o value -s TYPE /dev/%k", RESULT=="ntfs", ENV{mount_options}="%E{mount_options},utf8,uid=1000,gid=1000,umask=000"

There was a problem in the dir_name, so I changed these two lines:

#ACTION=="add", PROGRAM=="/sbin/blkid -o value -s TYPE %E{device}", RESULT=="ntfs", ENV{mount_options}="%E{mount_options},utf8,gid=100,umask=002" ACTION=="add", PROGRAM=="/sbin/blkid -o value -s TYPE /dev/%k", RESULT=="ntfs", ENV{mount_options}="%E{mount_options},utf8,gid=100,umask=002"
# Get label if present, otherwise assign one
#PROGRAM=="/sbin/blkid -o value -s LABEL %E{device}", ENV{dir_name}="%c"
PROGRAM=="/sbin/blkid -o value -s LABEL /dev/%k", ENV{dir_name}="%c"

When I unmount the drive, the directory is not deleted. The owner/permissions change from me/777 to root/755. I see you have commands for umount and rmdir ("Clean up after removal"), but I'm not sure what is meant to kick those off. I pulled out the drive without umounting first, not that I think you had that in mind, but that didn't change the behaviour (much).

It seems that only root can umount the drive, but I've seen mention of that for NTFS, or maybe it was udisks in general?

Almost there!

Regards,
Rick


Reply to: