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.
I have some ipod devices that I'd like to have a programmed mount point. The rules I've set are in /etc/udev/rules.d/10_custom_rules.rules and are as follows:
So you can see I'm hooking on the serial number. The issue I'm having is that the chown command doesn't seem to work so when I run gtkpod I get a permissions error. It seems by default the /medial/ipod_rich directory will be root/root (user/group) vs. rich/root. When I disable the rule and let udev work in it's default format I notice that the permissions are setup as the same with rich/root vs. root/root.
1) Can mkdir set the owner upon execution? I didn't see this as an option.
2) Why does chown not work?
Just as a note I manually created the mount points with rich/root and only had the mount and umount actions above and the mount point was still root/root <<< that surprised me.
What about setting the owner on the initial device creation ?. See if udev propagates it as you want.
As for the later commands, how about setting up a script for each action - that way you can ensure the commands execute in the order you need.
The device permissions control access to using the mount command on the device. Likewise, before mounting, the mount point (directory) permissions control access to using the mount command on the mount point (directory). After mounting, the mount point (filesystem root) and file access permissions are determined either by options to "mount", or from the filesystem being mounted.
The file permissions assigned to the mounted filesystem partly depend on the type of filesystem being mounted. You should not use "-t auto" and you should determine the type of filesystem on the device. Using "-t auto" is risky because the filesystem may be guessed incorrectly.
For ext2 or ext3 filesystems (being mounted) the permissions are taken from the super block of the filesystem. To set the permissions you must first mount the filesystem on the mount point and then set the permissions for the mount point directory (which actually sets the filesystem root permissions). You can also use "tune2fs" to set permissions.
For FAT, VFAT or NTFS filesystems you have to specify options on the mount command to provide the permissions. For example, I had to use these mount options to allow a group called "sharedfiles" to read and write my NTFS partition.
uid=root,gid=sharedfiles,dmask=0007,fmask=0117
If I didn't specify the "gid" option to mount, then the group remained "root" regardless of the group ID set on the mount point directory. The same was true for the permission bits. Changing the mount point directory permissions had no effect on the permissions of the mounted filesystem.
It makes more sense to create a group that has access to the mounted filesystem and then make users members of that group. The group does not have to be the primary group that a user belongs to. However, you can change the user ID with the "uid" option if you want.
What happens when you create files or directories on the mounted filesystem depends on the type of filesystem. If it isn't ext2/ext3 then the filesystem may ignore your user permissions completely and apply a default set of permissions.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.