Re: How to override fuse args to ntfs-3g to set permissions?
On 29 November 2014 at 17:06, Rick Macdonald rickm...@shaw.ca wrote: On 28/11/14 05:21 PM, Scott Ferguson wrote: On 28 November 2014 at 16:08, Rick Macdonald rickm...@shaw.ca wrote: On 25/11/14 08:46 PM, Scott Ferguson wrote: snipped Hey, thanks for all this! No worries. Thanks for the feedback. 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. I'm uncertain of the advantage if you are a member of user. You can use the USER tag in the rule to run commands as someone other than root. Plex should work in either case with wide-open 777 mode. Agreed 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 Oddly uid=N and gid=N in the ntfs-3g man (rather than uid= and gid=) I'm not sure if that's why mount | grep $SomeNTFSSlice reports single digit uid and gid [puzzled] There was a problem in the dir_name, Could you expand on that? 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 What do you get from mount -L | grep Win? # 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. That /media/$NFTSSliceLABEL dir will remain. That the notoriously fickle NTFS 'might' be damaged if the mounted NTFS device is suddenly removed (more likely you might just get into a futile tug-of-war). Belt and suspenders? 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). Did a program have access to that file system at the time? 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? NTFS-3G. After digging through policy kit it 'seems' if a non-root user who is not a member of the disk group wants to umount NTFS they need to recompile ntfs-3g with build-in FUSE and then setuid the resulting binary. Almost there! Lots of room for improvement - if I had time I'd refine the rule to *only* apply to a unique NTFS slice, and figure out a way so that the slice icon that appears on XFCE desktop and in the sidebar of Thunar *is* the mounted NTFS slice. An alternative approach to solving the above two niggles would be to hide the dysfunctional icons, and automagically (using udev) add an icon to the desktop - which when clicked would umount the (WinBackup) slice (gksudo or similar - if you use sudo that wouldn't be necessary). Regards, Rick Kind regards -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: https://lists.debian.org/CAMt2cQOdD=hpvhbjat+o29cafs+jykh93f4wxgyv7fa5+ps...@mail.gmail.com
Re: How to override fuse args to ntfs-3g to set permissions?
My apologies for the delay in replying. On 28 November 2014 at 16:08, Rick Macdonald rickm...@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). Kind regards 11-winbackup-auto-mount.rules Description: Binary data
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 rickm...@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 -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: https://lists.debian.org/54796252.60...@shaw.ca
Re: How to override fuse args to ntfs-3g to set permissions?
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 Sorry for replying to my own post... I see now that it's the XFCE's volume management that is initiating the (hotplug) mount. Some digging found that udisks is involved, so I attached strace to the udisks-daemon and found this: [pid 29472] 10:58:32 execve(/sbin/mount.ntfs, [/sbin/mount.ntfs, /dev/sdg2, /media/WinBackup_, -o, rw,nosuid,nodev,uhelper=udisks,uid=1000,gid=1000,dmask=0077,fmask=0177], [/* 3 vars */]) = 0 So the mode that I'd like to change is coming from the udisks-daemon (or its parent). Strace on udevd shows that it's involved but I don't see any file modes. That's were I'm at now. I played with udev rules a bit but I've never worked with them before. Quick comment (I will get back to this later today or early tomorrow):- grep ntfs /lib/udev/rules.d/*.rules /lib/udev/rules.d/80-udisks.rules:ENV{ID_FS_TYPE}==ntfs|vfat, \ If this does control the effect you note, (which is easy to determine), then it's simple to create a rule based on it (/etc/udev.d/$something.rule) that will treat your WinBackup disk differently I grabbed the src for udisks, but didn't get very far. It has code that checks fstab and uses its entries if found, but that code isn't used. It always makes a call to udev_glib instead. Regards, Rick -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: https://lists.debian.org/54780346.7000...@shaw.ca
Re: How to override fuse args to ntfs-3g to set permissions?
snipped Quick comment (I will get back to this later today or early tomorrow):- grep ntfs /lib/udev/rules.d/*.rules /lib/udev/rules.d/80-udisks.rules:ENV{ID_FS_TYPE}==ntfs|vfat, \ If this does control the effect you note, (which is easy to determine), then it's simple to create a rule based on it (/etc/udev.d/$something.rule) that will treat your WinBackup disk differently I grabbed the src for udisks, but didn't get very far. It has code that checks fstab and uses its entries if found, but that code isn't used. It always makes a call to udev_glib instead. The default settings for external drives is in /lib, offhand I can't remember where filetypes is taken from (somewhere in /etc ?). Take a look at udisks-doc if you're interested. Most of udisks, as you've discovered, is binary. Another very quick comment as I haven't had a chance to do much Debian User stuff lately (will get back to this and an Apple udev rule this evening). The udisk rule I pointed out above - is fine as it is, it hides disk/slices that would normally need to be hidden. I need to finish testing a custom udisks rule for you that changes the default naming of new devices that have an ntfs file system to /dev/$Label and a udev rule that runs fuser to automount the drive (to /media/$Label. It can be done with just udev, but it's a crude hack (doesn't cleanly umount, creates incrementing /media/usbN). Then you should get the Thunar support you want for Plex. Regards, Rick Thanks for your patience. Kind regards -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: https://lists.debian.org/camt2cqoss9jklek5ifvkvgbcmrrjt7zthwtk8hbj70fegyk...@mail.gmail.com
disk group (was ... Re: How to override fuse args to ntfs-3g to set permissions?)
On Wed, Nov 26, 2014 at 02:46:24PM +1100, Scott Ferguson wrote: In which case I'd recommend:- *1.* uncommenting the user_allow_other line in /etc/fuse.conf *2.* changing the fstab line to:- LABEL=WinBackup /media/WinBackup ntfs-3g uid=1000,gid=1000,permissions,auto,noatime 0 0 *3.* check that you are a member of the disk group (as a user:- groups |grep disk if you aren't, become one (as root)[*1]:- gpasswd -a $YourUsername disk [*1] groups won't show your changed group membership until after you've logged out, and logged back in. You can use the following if you need to double-check:- grep disk /etc/group I vaguely remember reading somewhere (may have been on this list) that putting anybody in the disk group is a big no no, I think it was to do with security. Whether I'm misremembering or not it would be nice to get it cleared up. -- If you're not careful, the newspapers will have you hating the people who are being oppressed, and loving the people who are doing the oppressing. --- Malcolm X -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: https://lists.debian.org/20141126102708.GD19356@tal
Re: disk group (was ... Re: How to override fuse args to ntfs-3g to set permissions?)
On 26/11/14 21:27, Chris Bannister wrote: On Wed, Nov 26, 2014 at 02:46:24PM +1100, Scott Ferguson wrote: In which case I'd recommend:- *1.* uncommenting the user_allow_other line in /etc/fuse.conf *2.* changing the fstab line to:- LABEL=WinBackup /media/WinBackup ntfs-3g uid=1000,gid=1000,permissions,auto,noatime 0 0 *3.* check that you are a member of the disk group (as a user:- groups |grep disk if you aren't, become one (as root)[*1]:- gpasswd -a $YourUsername disk [*1] groups won't show your changed group membership until after you've logged out, and logged back in. You can use the following if you need to double-check:- grep disk /etc/group I vaguely remember reading somewhere (may have been on this list) that putting anybody in the disk group is a big no no, I think it was to do with security. *It is* (shoot foot material). So is setting ntfs-3g setuid. Which is another practise used for what the OP wanted to achieve - in the way he wanted to do it. Like sudo no password it's a common practise - in hindsight I should have refused to help with that option (I did suggest udev) - and there are other ways. Whether I'm misremembering or not it would be nice to get it cleared up. You didn't misremember it - unfettered access to raw disks is not good practise. I was wrong. Following those instructions could have caused the OP to inadvertently break Windows. Kind regards -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: https://lists.debian.org/5475bb29.6000...@gmail.com
Re: disk group (was ... Re: How to override fuse args to ntfs-3g to set permissions?)
On 26/11/14 04:36 AM, Scott Ferguson wrote: I vaguely remember reading somewhere (may have been on this list) that putting anybody in the disk group is a big no no, I think it was to do with security. *It is* (shoot foot material). So is setting ntfs-3g setuid. Which is another practise used for what the OP wanted to achieve - in the way he wanted to do it. Like sudo no password it's a common practise - in hindsight I should have refused to help with that option (I did suggest udev) - and there are other ways. Whether I'm misremembering or not it would be nice to get it cleared up. You didn't misremember it - unfettered access to raw disks is not good practise. I was wrong. Following those instructions could have caused the OP to inadvertently break Windows. Thanks, I've removed myself from the disk group. Rick -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: https://lists.debian.org/5475dec0.4030...@shaw.ca
Re: How to override fuse args to ntfs-3g to set permissions?
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: Sorry, I don't know what DE means! Desktop Environment e.g. GNOME, KDE, XFCE, LXDE, etc KFCE. ?? https://packages.debian.org/search?keywords=kfcesearchon=namessuite=allsection=all Gives me nothing :( Assuming the best intentions, and that KFCE isn't a typo - it still appears you are not running Debian, it's 'possible' you are using Mint - which is a Debian derivative. This the *Debian*-User list, the wrong place to expect support for anything other than Debian or Debian PureBlends for several[*1] reasons. Are you using Debian?? Scott, I really appreciate your time in helping me, and I realize it's not easy with my typo and perhaps mis-used terminology. As I hinted at, I've been running pure Debian for some 20 years. I forget how long I've been subscribed to this list, but it could be almost 20 years as well. That doesn't make me smart, just old (and happy with Debian). I did indeed mistype, and it should have been XFCE not KFCE. I've been googling and posting with the term auto-mount, but is this more properly hotplug? I'm not trying to get the USB drive to mount at boot; that I can do. It mounts when I plug the drive in to the running system, just not with the permissions that I need. I hope I didn't lead anyone to think I'm asking about a boot-time mount issue. Over the years the hot-plug system (if that's the name for it) seems to have changed a few times, and I admit I've never understood how hal, udev, etc worked/works. It's always worked to some extent, so I've never had to fuss with it. ntfs-3g's umask/dmask/fmask options all default to 0, but somebody is calling it with dmask=0077,fmask=0177. I haven't figured out the chain of commands involved. Regards, Rick -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: https://lists.debian.org/5475f0ae.6060...@shaw.ca
Re: How to override fuse args to ntfs-3g to set permissions?
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: Are you using Debian?? Scott, I really appreciate your time in helping me, and I realize it's not easy with my typo and perhaps mis-used terminology. As I hinted at, I've been running pure Debian for some 20 years. I forget how long I've been subscribed to this list, but it could be almost 20 years as well. That doesn't make me smart, just old (and happy with Debian). I did indeed mistype, and it should have been XFCE not KFCE. I've been googling and posting with the term auto-mount, but is this more properly hotplug? I'm not trying to get the USB drive to mount at boot; that I can do. It mounts when I plug the drive in to the running system, just not with the permissions that I need. I hope I didn't lead anyone to think I'm asking about a boot-time mount issue. Over the years the hot-plug system (if that's the name for it) seems to have changed a few times, and I admit I've never understood how hal, udev, etc worked/works. It's always worked to some extent, so I've never had to fuss with it. ntfs-3g's umask/dmask/fmask options all default to 0, but somebody is calling it with dmask=0077,fmask=0177. I haven't figured out the chain of commands involved. Sorry for replying to my own post... I see now that it's the XFCE's volume management that is initiating the (hotplug) mount. Some digging found that udisks is involved, so I attached strace to the udisks-daemon and found this: [pid 29472] 10:58:32 execve(/sbin/mount.ntfs, [/sbin/mount.ntfs, /dev/sdg2, /media/WinBackup_, -o, rw,nosuid,nodev,uhelper=udisks,uid=1000,gid=1000,dmask=0077,fmask=0177], [/* 3 vars */]) = 0 So the mode that I'd like to change is coming from the udisks-daemon (or its parent). Strace on udevd shows that it's involved but I don't see any file modes. That's were I'm at now. I played with udev rules a bit but I've never worked with them before. Regards, Rick -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: https://lists.debian.org/54762adf.80...@shaw.ca
Re: How to override fuse args to ntfs-3g to set permissions?
Thanks for replying. On 27/11/14 02:24, 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: Sorry, I don't know what DE means! Desktop Environment e.g. GNOME, KDE, XFCE, LXDE, etc KFCE. ?? https://packages.debian.org/search?keywords=kfcesearchon=namessuite=allsection=all Gives me nothing :( Assuming the best intentions, and that KFCE isn't a typo - it still appears you are not running Debian, it's 'possible' you are using Mint - which is a Debian derivative. This the *Debian*-User list, the wrong place to expect support for anything other than Debian or Debian PureBlends for several[*1] reasons. Are you using Debian?? Scott, I really appreciate your time in helping me, and I realize it's not easy with my typo and perhaps mis-used terminology. As I hinted at, I've been running pure Debian for some 20 years. I forget how long I've been subscribed to this list, but it could be almost 20 years as well. That doesn't make me smart, just old (and happy with Debian). I did indeed mistype, and it should have been XFCE not KFCE. My original thought - then someone send me a link to the Mint desktop manager with the same name as the typo... I'm away from the box where I set-up a set environment, and the desk with my notes (this email client is being remotely accessed). I'll be back there later today. Note I put an NTFS file system on a USBKey with the same label as your setup, created a /media directory as you have - and was able to achieve what you wanted. I do want to provide you with a better way of reaching your desired outcome - without you (and userland processes) having raw disk access. Hopefully I'll get a chance to reply further later today. I've been googling and posting with the term auto-mount, but is this more properly hotplug? I'm not trying to get the USB drive to mount at boot; that I can do. It mounts when I plug the drive in to the running system, just not with the permissions that I need. I hope I didn't lead anyone to think I'm asking about a boot-time mount issue. Over the years the hot-plug system (if that's the name for it) seems to have changed a few times, and I admit I've never understood how hal, udev, etc worked/works. It's always worked to some extent, so I've never had to fuss with it. ntfs-3g's umask/dmask/fmask options all default to 0, but somebody is calling it with dmask=0077,fmask=0177. I haven't figured out the chain of commands involved. The ntfs-3g ref I (believe I) posted earlier on the thread is instructive (it's to upstream documentation). Regards, Rick Thanks for your patience - what you want is doable, just not, perhaps, exactly the way you want to do it. Kind regards -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: https://lists.debian.org/54765d05.3080...@gmail.com
Re: How to override fuse args to ntfs-3g to set permissions?
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 Sorry for replying to my own post... I see now that it's the XFCE's volume management that is initiating the (hotplug) mount. Some digging found that udisks is involved, so I attached strace to the udisks-daemon and found this: [pid 29472] 10:58:32 execve(/sbin/mount.ntfs, [/sbin/mount.ntfs, /dev/sdg2, /media/WinBackup_, -o, rw,nosuid,nodev,uhelper=udisks,uid=1000,gid=1000,dmask=0077,fmask=0177], [/* 3 vars */]) = 0 So the mode that I'd like to change is coming from the udisks-daemon (or its parent). Strace on udevd shows that it's involved but I don't see any file modes. That's were I'm at now. I played with udev rules a bit but I've never worked with them before. Quick comment (I will get back to this later today or early tomorrow):- grep ntfs /lib/udev/rules.d/*.rules /lib/udev/rules.d/80-udisks.rules:ENV{ID_FS_TYPE}==ntfs|vfat, \ If this does control the effect you note, (which is easy to determine), then it's simple to create a rule based on it (/etc/udev.d/$something.rule) that will treat your WinBackup disk differently Later. Regards, Rick Kind regards -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: https://lists.debian.org/54766050.8020...@gmail.com
Re: How to override fuse args to ntfs-3g to set permissions?
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 Sorry for replying to my own post... I see now that it's the XFCE's volume management that is initiating the (hotplug) mount. Some digging found that udisks is involved, so I attached strace to the udisks-daemon and found this: [pid 29472] 10:58:32 execve(/sbin/mount.ntfs, [/sbin/mount.ntfs, /dev/sdg2, /media/WinBackup_, -o, rw,nosuid,nodev,uhelper=udisks,uid=1000,gid=1000,dmask=0077,fmask=0177], [/* 3 vars */]) = 0 So the mode that I'd like to change is coming from the udisks-daemon (or its parent). Strace on udevd shows that it's involved but I don't see any file modes. That's were I'm at now. I played with udev rules a bit but I've never worked with them before. Quick comment (I will get back to this later today or early tomorrow):- grep ntfs /lib/udev/rules.d/*.rules /lib/udev/rules.d/80-udisks.rules:ENV{ID_FS_TYPE}==ntfs|vfat, \ If this does control the effect you note, (which is easy to determine), then it's simple to create a rule based on it (/etc/udev.d/$something.rule) that will treat your WinBackup disk differently Later. I saw that rule last night, but it is in the section Partitions which desktops should not display which didn't seem helpful. Regards, Rick -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: https://lists.debian.org/54766557.5050...@timshel.ca
How to override fuse args to ntfs-3g to set permissions?
Well, many hours of googling, and running grep on my entire filesystem, have failed me this time. I'm running up-to-date wheezy. How does one override or change to options fuse gives to ntfs-3g (if I have that right)? I have an NTFS filesystem on a USB-connected hard drive. With nothing in fstab, it gets auto-mounted as /media/WinBackup: syslog: Nov 25 12:56:17 timshel ntfs-3g[16915]: Version 2012.1.15AR.5 external FUSE 29 Nov 25 12:56:17 timshel ntfs-3g[16915]: Mounted /dev/sdg2 (Read-Write, label WinBackup, NTFS 3.1) Nov 25 12:56:17 timshel ntfs-3g[16915]: Cmdline options: rw,nosuid,nodev,uhelper=udisks,uid=1000,gid=1000,dmask=0077,fmask=0177 Nov 25 12:56:17 timshel ntfs-3g[16915]: Mount options: rw,nosuid,nodev,uhelper=udisks,allow_other,nonempty,relatime,default_permissions,fsname=/dev/sdg2,blkdev,blksize=4096 Nov 25 12:56:17 timshel ntfs-3g[16915]: Global ownership and permissions enforced, configuration type 7 According to the fuse man page, /etc/fuse.conf only supports mount_max and user_allow_other. I can mount it manually by adding the following entry to fstab (which somehow inhibits the automount), but I'd much rather have it auto mount whenever I plug it in. LABEL=WinBackup /media/WinBackup ntfs rw,nosuid,nodev,uhelper=udisks,allow_other,nonempty,relatime,default_permissions,blkdev,umask= 0 0 Rick -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: https://lists.debian.org/5474eea1.60...@timshel.ca
Re: How to override fuse args to ntfs-3g to set permissions?
On 26/11/14 08:03, Rick Macdonald wrote: Well, many hours of googling, and running grep on my entire filesystem, have failed me this time. I'm running up-to-date wheezy. DE? How does one override or change to options fuse gives to ntfs-3g (if I have that right)? I have an NTFS filesystem on a USB-connected hard drive. With nothing in fstab, it gets auto-mounted as /media/WinBackup: syslog: Nov 25 12:56:17 timshel ntfs-3g[16915]: Version 2012.1.15AR.5 external FUSE 29 Nov 25 12:56:17 timshel ntfs-3g[16915]: Mounted /dev/sdg2 (Read-Write, label WinBackup, NTFS 3.1) Nov 25 12:56:17 timshel ntfs-3g[16915]: Cmdline options: rw,nosuid,nodev,uhelper=udisks,uid=1000,gid=1000,dmask=0077,fmask=0177 Nov 25 12:56:17 timshel ntfs-3g[16915]: Mount options: rw,nosuid,nodev,uhelper=udisks,allow_other,nonempty,relatime,default_permissions,fsname=/dev/sdg2,blkdev,blksize=4096 Nov 25 12:56:17 timshel ntfs-3g[16915]: Global ownership and permissions enforced, configuration type 7 According to the fuse man page, /etc/fuse.conf only supports mount_max and user_allow_other. I can mount it manually by adding the following entry to fstab (which somehow inhibits the automount), but I'd much rather have it auto mount whenever I plug it in. Without knowing more about your Wheezy the easiest option is probably to create a custom udev rule. LABEL=WinBackup /media/WinBackup ntfs rw,nosuid,nodev,uhelper=udisks,allow_other,nonempty,relatime,default_permissions,blkdev,umask= 0 0 What does allow_other do? Why umask= (instead of 0022)? Why not uid=$username,gid=users Do you want to retain and use standard Windows permissions? How many people will need access to the disk? Rick Kind regards -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: https://lists.debian.org/54750b1b.8060...@gmail.com
Re: How to override fuse args to ntfs-3g to set permissions?
On 25/11/14 04:04 PM, Scott Ferguson wrote: On 26/11/14 08:03, Rick Macdonald wrote: Well, many hours of googling, and running grep on my entire filesystem, have failed me this time. I'm running up-to-date wheezy. DE? Sorry, I don't know what DE means! It's an i386 desktop that's been running Debian since the 0.93 days in the mid-90's before Buzz was released (OK, it's gone through some hardware upgrades ;-). How does one override or change to options fuse gives to ntfs-3g (if I have that right)? I have an NTFS filesystem on a USB-connected hard drive. With nothing in fstab, it gets auto-mounted as /media/WinBackup: syslog: Nov 25 12:56:17 timshel ntfs-3g[16915]: Version 2012.1.15AR.5 external FUSE 29 Nov 25 12:56:17 timshel ntfs-3g[16915]: Mounted /dev/sdg2 (Read-Write, label WinBackup, NTFS 3.1) Nov 25 12:56:17 timshel ntfs-3g[16915]: Cmdline options: rw,nosuid,nodev,uhelper=udisks,uid=1000,gid=1000,dmask=0077,fmask=0177 Nov 25 12:56:17 timshel ntfs-3g[16915]: Mount options: rw,nosuid,nodev,uhelper=udisks,allow_other,nonempty,relatime,default_permissions,fsname=/dev/sdg2,blkdev,blksize=4096 Nov 25 12:56:17 timshel ntfs-3g[16915]: Global ownership and permissions enforced, configuration type 7 According to the fuse man page, /etc/fuse.conf only supports mount_max and user_allow_other. I can mount it manually by adding the following entry to fstab (which somehow inhibits the automount), but I'd much rather have it auto mount whenever I plug it in. Without knowing more about your Wheezy the easiest option is probably to create a custom udev rule. I'll look into that, but I hope to understand something about fuse/ntfs-3g since I've come this far. LABEL=WinBackup /media/WinBackup ntfs rw,nosuid,nodev,uhelper=udisks,allow_other,nonempty,relatime,default_permissions,blkdev,umask= 0 0 What does allow_other do? allow_other (man mount.fuse) lets users other than the one who mounted the filesystem access files. You'd think that's all I need, but it's already on the mount command line. The problem seems to be the dmask fmask values restrict access regardless. Why umask= (instead of 0022)? Why not uid=$username,gid=users All the options were copied from the mount options in the syslog above. I removed the ones that mount didn't like (blkdev and fsname). I wanted to start with what (I think) fuse is giving ntfs-3g on it's command line (not that that's a valid thing to do). fuse doesn't seem to be a binary executable, and I can't find where these command line args are coming from when mount is called. Do you want to retain and use standard Windows permissions? How many people will need access to the disk? Nobody else uses the machine, but I need the permissions opened up. When my WinXP server died I moved my videos to my Linux desktop. I usually use Serviio but thought I'd give Plex a try (Plex doesn't support XP so I couldn't give it a try until now). Plex runs as user plex and cannot read any of the files on this USB disk when mounted under my account with mode 600 permissions. Plex has an option to let the client delete videos, so while testing I chose . I could tell Plex to run as me, but that's no good because its files are installed under /var/lib/plexmediaserver, and if I change the ownership of those it would likely break upgrading Plex when the next deb file is released. Rick -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: https://lists.debian.org/547521cd.4090...@timshel.ca
Re: How to override fuse args to ntfs-3g to set permissions?
On 26/11/14 11:41, Rick Macdonald wrote: On 25/11/14 04:04 PM, Scott Ferguson wrote: On 26/11/14 08:03, Rick Macdonald wrote: Well, many hours of googling, and running grep on my entire filesystem, have failed me this time. I'm running up-to-date wheezy. DE? Sorry, I don't know what DE means! Desktop Environment e.g. GNOME, KDE, XFCE, LXDE, etc Probably irrelevant now - given your requirements (Plex) and your stated usage (only user) the fstab I've suggested solve the mounting requirement. Please note that I can't test this for you. Understanding fuse/ntfs-3g? See the ref to the documentation at the bottom of this post. It's not the easiest read but it may answer your question. snipped I can mount it manually by adding the following entry to fstab (which somehow inhibits the automount), but I'd much rather have it auto mount whenever I plug it in. LABEL=WinBackup /media/WinBackup ntfs rw,nosuid,nodev,uhelper=udisks,allow_other,nonempty,relatime,default_permissions,blkdev,umask= 0 0 What does allow_other do? allow_other (man mount.fuse) Yes. In inadvertently rhetorical question. I 'should' have asked did you apply the changes to the fuse conf to allow that option to work? My apologies (I can be a bit thick). snipped You'd think that's all I need, Agreed but it's already on the mount command line. The problem seems to be the dmask fmask values restrict access regardless. No. You need to uncomment line 9 in /etc/fuse.conf so that allow_user will work in your fstab (from not-to-be relied on memory - it still won't allow a non-root user to umount the device). This is the line you need to uncomment:- #user_allow_other Read on for a step-by-step guide on what's required. Why umask= (instead of 0022)? Why not uid=$username,gid=users All the options were copied from the mount options in the syslog above. I removed the ones that mount didn't like (blkdev and fsname). I wanted to start with what (I think) fuse is giving ntfs-3g on it's command line (not that that's a valid thing to do). fuse doesn't seem to be a binary executable, and I can't find where these command line args are coming from when mount is called. Do you want to retain and use standard Windows permissions? How many people will need access to the disk? Nobody else uses the machine, but I need the permissions opened up. In which case I'd recommend:- *1.* uncommenting the user_allow_other line in /etc/fuse.conf *2.* changing the fstab line to:- LABEL=WinBackup /media/WinBackup ntfs-3g uid=1000,gid=1000,permissions,auto,noatime 0 0 *3.* check that you are a member of the disk group (as a user:- groups |grep disk if you aren't, become one (as root)[*1]:- gpasswd -a $YourUsername disk [*1] groups won't show your changed group membership until after you've logged out, and logged back in. You can use the following if you need to double-check:- grep disk /etc/group When my WinXP server died I moved my videos to my Linux desktop. I usually use Serviio but thought I'd give Plex a try (Plex doesn't support XP so I couldn't give it a try until now). Plex runs as user plex and cannot read any of the files on this USB disk when mounted under my account with mode 600 permissions. Plex has an option to let the client delete videos, so while testing I chose . I could tell Plex to run as me, but that's no good because its files are installed under /var/lib/plexmediaserver, and if I change the ownership of those it would likely break upgrading Plex when the next deb file is released. Thanks - I've made the above suggestions with that in mind. Rick Useful refs:- http://www.tuxera.com/community/ntfs-3g-faq/#unprivileged Kind regards -- Don't be smart, you dunno wot you're saying ~Snortle La Darse 90-250-400 -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: https://lists.debian.org/54754d10.70...@gmail.com
Re: How to override fuse args to ntfs-3g to set permissions?
I missed some questions there :( On 26/11/14 14:46, Scott Ferguson wrote: On 26/11/14 11:41, Rick Macdonald wrote: On 25/11/14 04:04 PM, Scott Ferguson wrote: On 26/11/14 08:03, Rick Macdonald wrote: snipped fuse doesn't seem to be a binary executable, Not by that name. /sbin/mount.fuse and I can't find where these command line args are coming from when mount is called. /sbin/mount.ntfs (it's symlinked to /sbin/mount.ntfs-3g) snipped Kind regards -- Don't be smart, you dunno wot you're saying ~Snortle La Darse 90-250-400 -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: https://lists.debian.org/5475503d.3050...@gmail.com
Re: How to override fuse args to ntfs-3g to set permissions?
On 25/11/14 08:46 PM, Scott Ferguson wrote: Sorry, I don't know what DE means! Desktop Environment e.g. GNOME, KDE, XFCE, LXDE, etc KFCE. I had to abandon GNOME when they removed all the customization settings... but it's already on the mount command line. The problem seems to be the dmask fmask values restrict access regardless. No. You need to uncomment line 9 in /etc/fuse.conf so that allow_user will work in your fstab (from not-to-be relied on memory - it still won't allow a non-root user to umount the device). This is the line you need to uncomment:- #user_allow_other I had already uncommented that line, but it made no difference. I couldn't see that I had to restart any service. I didn't reboot. In which case I'd recommend:- *1.* uncommenting the user_allow_other line in /etc/fuse.conf *2.* changing the fstab line to:- LABEL=WinBackup /media/WinBackup ntfs-3g uid=1000,gid=1000,permissions,auto,noatime 0 0 *3.* check that you are a member of the disk group (as a user:- groups |grep disk if you aren't, become one (as root)[*1]:- gpasswd -a $YourUsername disk [*1] groups won't show your changed group membership until after you've logged out, and logged back in. You can use the following if you need to double-check:- grep disk /etc/group OK, I tried all that and it makes no difference. With either line in fstab there are no messages in syslog from fuse/ntfs-3g about that partition, and I have to mount it manually. We're you expecting it to auto-mount? Rick -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: https://lists.debian.org/547561b0.2010...@timshel.ca
Re: How to override fuse args to ntfs-3g to set permissions?
On 25/11/14 10:14 PM, Rick Macdonald wrote: OK, I tried all that and it makes no difference. With either line in fstab there are no messages in syslog from fuse/ntfs-3g about that partition, and I have to mount it manually. We're you expecting it to auto-mount? The following run as root mounts it as me with mode 666, exactly what I want. The question is still, how on earth to pass the mask values during the auto-mount? ntfs-3g -o rw,nosuid,nodev,uhelper=udisks,uid=1000,gid=1000,dmask=,fmask= /dev/sdg2 /media/WinBackup Rick -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: https://lists.debian.org/54756730.8070...@timshel.ca
Re: How to override fuse args to ntfs-3g to set permissions?
On 26/11/14 16:14, Rick Macdonald wrote: On 25/11/14 08:46 PM, Scott Ferguson wrote: Sorry, I don't know what DE means! Desktop Environment e.g. GNOME, KDE, XFCE, LXDE, etc KFCE. ?? https://packages.debian.org/search?keywords=kfcesearchon=namessuite=allsection=all Gives me nothing :( Assuming the best intentions, and that KFCE isn't a typo - it still appears you are not running Debian, it's 'possible' you are using Mint - which is a Debian derivative. This the *Debian*-User list, the wrong place to expect support for anything other than Debian or Debian PureBlends for several[*1] reasons. Are you using Debian?? Respectfully - I have duplicated as much as possible the system you described for testing and confirmation, but sadly there's no point in me posting the results and continuing this exchange, unless you can confirm that you run Debian [*1]the chemistry of potato products != those of potatoes, the people reading and searching this list are looking for information on Debian, and I have to limit my time to the same. Kindly -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: https://lists.debian.org/54758003@gmail.com