LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 03-10-2019, 04:59 AM   #1
linus72
LQ Guru
 
Registered: Jan 2009
Location: Gordonsville-AKA Mayberry-Virginia
Distribution: Slack14.2/AntiX/Arco/Sparky/Hexagon
Posts: 5,242

Rep: Reputation: 362Reputation: 362Reputation: 362Reputation: 362
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!
 
Old 03-10-2019, 05:17 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 9,929

Rep: Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077
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.
 
1 members found this post helpful.
Old 03-10-2019, 05:27 AM   #3
linus72
LQ Guru
 
Registered: Jan 2009
Location: Gordonsville-AKA Mayberry-Virginia
Distribution: Slack14.2/AntiX/Arco/Sparky/Hexagon
Posts: 5,242

Original Poster
Rep: Reputation: 362Reputation: 362Reputation: 362Reputation: 362
ok awesome thanks business_kid!
 
Old 03-10-2019, 06:55 AM   #4
GazL
Senior Member
 
Registered: May 2008
Posts: 4,951
Blog Entries: 15

Rep: Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555
I wouldn't have gone that way. What fs type is your music folder? ext? fat?
 
1 members found this post helpful.
Old 03-10-2019, 04:42 PM   #5
enorbet
Senior Member
 
Registered: Jun 2003
Location: Virginia
Distribution: Slackware = Main OpSys for decades while testing others to keep up
Posts: 2,125

Rep: Reputation: 2105Reputation: 2105Reputation: 2105Reputation: 2105Reputation: 2105Reputation: 2105Reputation: 2105Reputation: 2105Reputation: 2105Reputation: 2105Reputation: 2105
One way is to use fmask,dmask, and/or umask in /etc/fstab
 
1 members found this post helpful.
Old 03-10-2019, 05:11 PM   #6
linus72
LQ Guru
 
Registered: Jan 2009
Location: Gordonsville-AKA Mayberry-Virginia
Distribution: Slack14.2/AntiX/Arco/Sparky/Hexagon
Posts: 5,242

Original Poster
Rep: Reputation: 362Reputation: 362Reputation: 362Reputation: 362
Gazl it's just a folder on a ext4 partition
enorbet ok whats your suggestion or yours Gazl?
 
Old 03-10-2019, 06:21 PM   #7
GazL
Senior Member
 
Registered: May 2008
Posts: 4,951
Blog Entries: 15

Rep: Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555
Quote:
Originally Posted by linus72 View Post
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.
 
1 members found this post helpful.
Old 03-10-2019, 09:42 PM   #8
enorbet
Senior Member
 
Registered: Jun 2003
Location: Virginia
Distribution: Slackware = Main OpSys for decades while testing others to keep up
Posts: 2,125

Rep: Reputation: 2105Reputation: 2105Reputation: 2105Reputation: 2105Reputation: 2105Reputation: 2105Reputation: 2105Reputation: 2105Reputation: 2105Reputation: 2105Reputation: 2105
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/

Last edited by enorbet; 03-10-2019 at 09:44 PM.
 
1 members found this post helpful.
Old 03-11-2019, 08:13 AM   #9
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: MID-SOUTH USA
Distribution: Slackware 14.2 current / Linux Mint / Debian / Void Linux
Posts: 8,147

Rep: Reputation: 1680Reputation: 1680Reputation: 1680Reputation: 1680Reputation: 1680Reputation: 1680Reputation: 1680Reputation: 1680Reputation: 1680Reputation: 1680Reputation: 1680
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.

Last edited by BW-userx; 03-11-2019 at 08:20 AM.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to partition a disk in Linux. Learn how to use the 'parted' command to partition storage devices in Linux. onebuck Linux - General 1 06-14-2018 10:47 AM
Is there any benefit of making a separate partition for home, root and boot partition Vexe Linux - Hardware 18 02-23-2013 11:00 AM
Live USB with peristence, swap partition and extra storage partition dlefeber Linux - Newbie 5 12-17-2011 02:29 PM
Total partition size - User partition size is not equals to Free partition size navaneethanj Linux - General 5 06-14-2004 12:55 PM
Mounting mounting extended partition and its Logical drives desbyleo Linux - Newbie 10 02-18-2002 03:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 11:26 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration