LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Mounting Storage Partition on Boot and Making it RW for User? (https://www.linuxquestions.org/questions/slackware-14/mounting-storage-partition-on-boot-and-making-it-rw-for-user-4175649892/)

linus72 03-10-2019 04:59 AM

Mounting Storage Partition on Boot and Making it RW for User?
 
OK basically I redid my partitioning scheme and got rid of vista
So I have my Music folder on sda7, and I created a symlink on my desktop
Code:

cd Desktop
ln -s /run/media/bz/a101efd4-c90e-4431-8cdb-b5348e9626cd/Music Music

But when I add folders in audacious I get a permission denied
So I used root thunar to change permissions on that folder recursively for user bz, But some files still dont play saying permission denied while most do play?!
Code:

mount
/dev/sda7 on /run/media/bz/a101efd4-c90e-4431-8cdb-b5348e9626cd type ext4 (rw,nodev,nosuid,uhelper=udisks2)

So, my question is-
I want this partition mounted rw for my user at bootup?
I know I have to edit /etc/fstab with proper code for user permissions too right?
Thanks for all help!

business_kid 03-10-2019 05:17 AM

If you want it all RW as user, you have to mount it as a user and it needs the mount options 'user, noauto'

If you'll settle for the Directories on it being user writable, you can do the following
  • Make it and mount it as root.
  • Let root make the directories.
  • As root, Run 'chown -R youruser:usergroup' On all the directories you want user writable.
So, if you mount that on /boot, /boot/filename will be only writable by root. But /boot/subdir/filename will be user writable, provided the chown has been run. That's in fact exactly what's done on /home.

linus72 03-10-2019 05:27 AM

ok awesome thanks business_kid!

GazL 03-10-2019 06:55 AM

I wouldn't have gone that way. What fs type is your music folder? ext? fat?

enorbet 03-10-2019 04:42 PM

One way is to use fmask,dmask, and/or umask in /etc/fstab

linus72 03-10-2019 05:11 PM

Gazl it's just a folder on a ext4 partition
enorbet ok whats your suggestion or yours Gazl?

GazL 03-10-2019 06:21 PM

Quote:

Originally Posted by linus72 (Post 5972455)
Gazl it's just a folder on a ext4 partition
enorbet ok whats your suggestion or yours Gazl?

Ahh ok, in that case I'd have been inclined to just add a normal entry to fstab.
Code:

/dev/sda7 /srv/music auto defaults 0 0
Mount it and you can then:
chown -R root:users /srv/music
find /srv/music -type d -exec chmod 2775 +

That way your users can manage the files in /srv/music and new files will be automatically assigned to the group 'users' when created. if you wanted to get clever you could create a 'music' group and use that instead of 'users' (adding that group to any users that need access).

You don't have to use /srv/music of course, that's just where I've been putting things like this here so I used it as an example.

Anyway, that's how I do this sort of thing. It's just one option.

enorbet 03-10-2019 09:42 PM

Hello linus72, I'm currently using "fmask=111, dfmask=000" at least on ntfs-3g file systems but I suggest you look it up since it has very specific case usage. There was a thread right here on LQN that had decent info...by no means complete but a good starter. The details are easy to find in "man" or on the webz. I'll see if I can dig up a link.

Edit: added - Yup. Found it. https://www.linuxquestions.org/quest...-umask-944740/

BW-userx 03-11-2019 08:13 AM

if it is ntfs slack mounts it like this during install for all user access
Code:

/dev/sda3        /media/data1    ntfs-3g    fmask=111,dmask=000 1  0
with just me using a separate partition for ext4 I created a mount point, and change permissions and ownership to user:group the group is users. 775 permissions on mount point.

basically all you need is a group with read,write,execute for user,group, and read only for other. or don't even let the other in at all. then have the users you want to have access to it be in that same user group. I put mine in '/media' directory and it shows up in the file manager due to the name of the directory being media, so no bind mount required.

Just open a file manager or terminal and go to /media/... whatever other sub-dir needed. if you want to only give them a directory within that partition, then you are going to have to mount the partition then bind mount the sub-directory within it. Thereby limiting the access to just a dir within the partition.

not forgetting permissions too can be set within the fstab file.


All times are GMT -5. The time now is 07:29 AM.