Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
It all started with me wanting to give owner/rwx to a specific user on a mount. After a quick search through the manpages I found it.
So, I used.
mount -t ntfs -o uid=xxxx,gid=xxxx,umask=077 /dev/hda1 /mnt/winblows
Worked like a charm.
Now, the only problem is I'm getting sick of SU ing to root to mount the drive all the time. I saw something that caught my eyes in the fstab man. An option called owner. Which is supposed to allow the owner to mount the drive?
I'm curious how I should do this. I've edited my fstab to include:
I added uid / gid because I figured it wouldn't know who the owner / group was. I think I got this completely screwed up and this isn't how you do it at all :P Any ideas? It would be a lot easier if I just mounted it at boot --- but I don't want to :P
1. The owner keyword (in man fstab) says "allow device owner to mount". That's a bit vague under the circumstances. It could mean the owner you specified with your "uid=xxxx" option. However, I would think the documentation would explicitly mention that were the case (i.e. the uid=<blah> option must be used if the owner option is used). The other option, which is far more likely I think, is that "owner" refers to the owner of the device file itself. Do a chown some_user /dev/hda1 and then see if that particular user can mount the drive.
2. You could consider using the "user" option in fstab. Given that you specify the owner and group ids, then it would only be a matter of restricting "other" user access to the mounted drive. I honestly don't know how simple/complex that might be, but it might be an option.
note: I haven't tried either of these. So take this advice for what its worth
What's your distro? On Mandrake, you can go into Permissions in the Control Centre and just add an entry for "/mnt/winblows" giving your user proper access.
Slackware, I can give the user permission to access the drive. But I want to give the specific user permission to mount the drive. I could add 'user' to fstab but that would let anyone mount it whereas I just want myself to be able to do it.
Ok, so what's wrong with the first option I mentioned? Change the device file owner to the user you want to give mount permission to and leave "owner" as an option in fstab.
Another possibility is to set up sudo. It would let you do this without futzing with fstab.
Nothing is wrong with your advice I was just responding to the guy above me . It's annoying how simple the solution can be at times. I thought adding uid=xxxx in the fstab would make me the owner when mount went through it. Thanks for your help, btw. This would've kept me up many a night. Perhaps I should stop looking for difficult solutions to simple problems, hehe.
ppuru: Yeah, I know I could've done that. I would've used user however since I don't need someone else umounting something I mounted. However, I only want ONE SPECIFIC user to be able to mount it (well, excluding root, naturally).
unless of course you can do that with what you posted and i'm just misunderstanding :P
Ok... I guess I got confused. I was assuming that you had read the second option I laid out, and had a kind of tunnel-vision: the "user" wasn't quite what you wanted and were distracted from the #1.
I've been involved in a few threads where the answer was presented in the first one or two responses, but copletely overlooked. Actually, it's happened twice in as many days. I wanted to make sure that didn't happen (frustration setting in on my part). I apologize if the response was taken as being a bit too blunt perhaps.
Nah, I know how it goes. You try to help someone and they completely ignore what you mentioned and continue to ask the same question no matter how much you explain yourself.
No need to apologize, miscommunication on our parts at best.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.