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.
Hi
Have just installed a second hard drive and added it to fstab. I can read files from it fine but I can not write to it as a normal user (only root can write to it). How can I make it so normal users can write to it or can I make it so only certain groups can write to it.
This How To will teach you (almost) all there is to know about fstab - I advise you begin by reading there, and if you have any problems just let me know.
Ok
I've make progress. I can get it so uses can mount the drives but the problem then is that only that user and root can write to the drives and if i have auto on then the drive is mounted at boot but i think it mounts as root so i back to square one. can you make it so it mounts the drive at boot as a certain group with read write for that group?
Do the settings for it include 'auto, user, rw'? That would allow read-write access to it for all the users on the system, and it would be mounted at boot.
As for group permissions - I think you'd have to do that manually.
eg. Log into the computer using a username belonging to the group which you want to be able to access the drive. Then, issue these commands:
Ok
I've make progress. I can get it so uses can mount the drives but the problem then is that only that user and root can write to the drives and if i have auto on then the drive is mounted at boot but i think it mounts as root so i back to square one. can you make it so it mounts the drive at boot as a certain group with read write for that group?
I think you are looking in the wrong direction. Why do you want an internal HDD to be user mountable? You just want users/groups to have specific permissions.
Here's an example from my /etc/fstab that may help you:
So you can see that I have two harddrives. The second is mounted under /usr/share/multimedia. If we look at the permissions:
Code:
shilo@shilo2:~$ ls -l /usr/share |grep multi
drwxr-xr-x 7 shilo users 152 2005-10-20 13:51 multimedia/
So I have given the directory the permission I wanted (In my case, I wanted the directory to belong to user shilo, evryone can read it, everyone can cd to it, only user shilo can write to it.
Doesn't matter that root mounted the filesystem. Just matters what the permissions are.
You will need to learn "chmod" and possible "chown" to get the permissions that you want.
Do the settings for it include 'auto, user, rw'? That would allow read-write access to it for all the users on the system, and it would be mounted at boot.
Maybe I'm misunderstanding what you are saying here, but it appears that this statement is just wrong:
"auto" = mount automatically (you got that right)
"user" = user can mount/unmount. Does not affect permissions, though.
"rw" = The media is both readable and writable. This does not mean that you are gauranteed those permissions. The files still have to have read and write permissions.
Look at your own fstab. Assuming the most basic partitioning scheme, you have a / partition. Note the absence of options. Yet /home is under /, and a usr still can read and write to his own home directory.
You may not want users mounting and unmounting any HDD that you give them permission to read and write from.
Just use "defaults" for the mount option. It will work.
shilo - Sorry, I did not word it properly. What I was trying to say was that it is mounted in read-write mode, and because of that you can give users read/write access to it as you wish.
Oh, and I don't have a separate /home partition - I put it all in one root partition.
madman8 - shilo's right. Just give it defaults and then chmod it as much as you wish.
Sorry guys is should have mentioned it earlier but the drive is fat32 but I didn't know that you can chmod I device like that, actually I don't know much about chmod. I’ll give this ago:
Sorry guys is should have mentioned it earlier but the drive is fat32 but I didn't know that you can chmod I device like that, actually I don't know much about chmod. I’ll give this ago:
# chmod a-rw /dev/hdb1
# chmod g+rw /dev/hdb1
That won't work. FAT32 doesn't use permissions. See this post for the solution you need.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.