Slackware 14.2 changes permission when mounting NTFS partition
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Slackware 14.2 changes permission when mounting NTFS partition
Dear all,
I am not an expert but a normal, regular user of Slackware for the last 16 years.
This time I could not find a way to solve the problem by myself
Sorry if the question is simple.
I have seen problems like this in the past but nothing mentioned in the case of 14.2 specifically.
I have an external HD (NTFS) and 2 PCs (one with 14.1 and the new one with a fresh 14.2, with patches and multilib installed).
I got the following when mounting the HD (both auto/xfce and manually):
Permissions when mounting in Slackware 14.1:
drwx------
Permissions when mounting in Slackware 14.2:
drwxrwxrwx
In version 14.2, too many permissions are given to all of the directories and files in the disk.
I would like to keep permissions as they were in previous version 14.1.
It may be a change with the command mount itself?
Slackware 14.1
mount from util-linux 2.21.2 (with libblkid support)
Slackware 14.2
mount from util-linux 2.27.1 (libmount 2.27.0: assert, debug)
If so, is it possible to recompile mount to suport ``right'' permissions for NTFS?
Permissions works as expected with ext4 partitions.
According to this man page for ntfs-3g the default for permissions is "everybody has full read, write, execution and directory browsing permissions." So, based on that, it seems the mounting in 14.1 is not following the standard. But I haven't used NTFS drives in Linux for a few years, so my information is a bit rusty.
However, you should be able to override the permissions by passing a umask to the mount options. umask=0077 would make all files and folders unaccessible to anyone but the owner.
According to this man page for ntfs-3g the default for permissions is "everybody has full read, write, execution and directory browsing permissions." So, based on that, it seems the mounting in 14.1 is not following the standard. But I haven't used NTFS drives in Linux for a few years, so my information is a bit rusty.
However, you should be able to override the permissions by passing a umask to the mount options. umask=0077 would make all files and folders unaccessible to anyone but the owner.
Bassmadrigal,
thank your for answering.
Based on your suggestion, the problem was solved (I have used this command line):
mount -t ntfs-3g -o fmask=133,dmask=022,gid=users,uid=1000 /dev/sdb1 /mnt/disk1/
I am trying now to understand what can be done in the case of automount.
I could not find a configuration file with mounting options.
I'm pretty sure this is going to require you to create a udev rule, but I am not nearly competent enough to do it without a ton of research (which, unfortunately, I just don't have that kind of time available right now).
I know you can specify filesystem types in a rule using ENV{ID_FS_TYPE}=="ntfs", but I am not sure how to ensure it is mounted using automount when it detects a usb device plugged in with that matches that rule.
In some quick searching, I did come across these two pages, but I don't have time to really dig into them to see what is needed and what should be ignored. Hopefully you can do some sleuthing and come up with something based on these little breadcrumbs I gave you.
Default mounting parameters have changed since 14.1, indeed.
As another example I found, a same FAT32 pendrive mounts differently (also different from NTFS).
It is very difficult for me to figure out the right way to go as it seems there are many pieces of software which makes automount to work, including thunar, udisks2, gnome gvfs, etc.
Thank you for your indication that an udev rule may be a possibility.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.