Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
non-root access to mounted dirs
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Duplicate Threads
View previous topic :: View next topic  
Author Message
hudsonhauck
Apprentice
Apprentice


Joined: 16 May 2002
Posts: 182
Location: Albany, CA

PostPosted: Mon May 20, 2002 8:06 pm    Post subject: non-root access to mounted dirs Reply with quote

Okay, I have one last thing to work out before I am done configuring my linux (i think...). I have all my music on my ntfs drive (my windows drive). So, to use it in Linux, I automounted it in /etc/fstab right? Well, apparently that gives it root ownage because root is the only one who can mount. Plus, I can't chown it because it is read-only. What should I do??
_________________
Matthew Hauck
http://matthauck.blogspot.com/


Last edited by hudsonhauck on Mon May 20, 2002 9:24 pm; edited 1 time in total
Back to top
View user's profile Send private message
mamsbrl
n00b
n00b


Joined: 16 May 2002
Posts: 53
Location: Boca Raton - Florida, USA

PostPosted: Mon May 20, 2002 9:15 pm    Post subject: My last problem!!! (hopefully) Reply with quote

try su

this command change to root privileges. (Super User)
Back to top
View user's profile Send private message
hudsonhauck
Apprentice
Apprentice


Joined: 16 May 2002
Posts: 182
Location: Albany, CA

PostPosted: Mon May 20, 2002 9:20 pm    Post subject: Reply with quote

from what I've heard, its a bad idea to work as the root. I'd rather be able to access these dirs from someone othere than the root
_________________
Matthew Hauck
http://matthauck.blogspot.com/
Back to top
View user's profile Send private message
rogue
Tux's lil' helper
Tux's lil' helper


Joined: 15 May 2002
Posts: 99
Location: Falls Church, VA

PostPosted: Mon May 20, 2002 10:04 pm    Post subject: fstab Reply with quote

if i recall correctly, the linux ntfs driver instead of doing something with the user permissions data that ntfs supports automatically just gives root access to data on the ntfs drive. if in your /etc/fstab file you edit the line for the ntfs device and add the option "user" so a regular user can mount and unmount it, you should be able to solve your problem by remounting it as a user. You'll have to su to root, unmount the drive, and then exit and mount it as a user for that user to have access.


anyway..hope that helps

edit: ntfs should only be mounted read only...i don't believe read-write support works properly (it's marked experimental in the kernel and so you could potentially lose data)
_________________
(rob)
Back to top
View user's profile Send private message
hudsonhauck
Apprentice
Apprentice


Joined: 16 May 2002
Posts: 182
Location: Albany, CA

PostPosted: Mon May 20, 2002 10:32 pm    Post subject: Reply with quote

I added the option "user" to each drive in fstab and when I tried to mount it (after I rebooted) tiold me that only the root can mount...
_________________
Matthew Hauck
http://matthauck.blogspot.com/
Back to top
View user's profile Send private message
Curious
Bodhisattva
Bodhisattva


Joined: 13 May 2002
Posts: 395
Location: Sydney, Australia

PostPosted: Mon May 20, 2002 10:33 pm    Post subject: Re: non-root access to mounted dirs Reply with quote

hudsonhauck wrote:
Well, apparently that gives it root ownage because root is the only one who can mount.


Hi Hudson.

NTFS support in the linux kernel is still experimental ( at least as of 2.4.18 ) - if you have "Prompt for Development / And Or Incomplete Drivers" enabled, you can enable read/write support for NTFS parititions, but if you do, make sure you read the documentation! You need to run a whole bunch of stuff everytime you unmount the drive, or you will most likely suffer fs corruption.

If you want non-root users to be able to mount a partition, put "user" into it's mount flags in the fstab. I believe this is also how you'll fix your ownership problem... if memory serves, you can specify the default file mask ( for example, all users read ) as a command line argument to the mount statement, and hence, as a flag in the fstab file.

I'm at work at the moment, but if I get some quiet time with one of the debian webservers here later on, I'll look up the specific flags you want, and post them here.

Best of luck!

Bryn.
_________________
Are you down with the Hawk?
Back to top
View user's profile Send private message
hudsonhauck
Apprentice
Apprentice


Joined: 16 May 2002
Posts: 182
Location: Albany, CA

PostPosted: Tue May 21, 2002 6:02 am    Post subject: Reply with quote

Thanks Curious, that would be great. I think I am putting the "user" in the wrong place. I put it right after "noatime". Am I supposed to actually type "user" or type the name of my user like "johndoe". Thanks.
Here is the section of my fstab that mounts the drives I want to mount/unmount from anywhere:
Code:
 /dev/hda6               /home/edrive    ntfs            noatime,user         0 1
 /dev/hda1               /home/cdrive    ntfs            noatime,user         0 1
 /dev/hda5               /home/ddrive    ntfs            noatime,user         0 1

_________________
Matthew Hauck
http://matthauck.blogspot.com/
Back to top
View user's profile Send private message
lain iwakura
Apprentice
Apprentice


Joined: 09 May 2002
Posts: 176
Location: sd, ca

PostPosted: Tue May 21, 2002 6:53 am    Post subject: Reply with quote

'user' is correct. but for if you would like anyone to mount/unmount these drives, use the 'users' option. i believe then the user would have to be a part of the 'users' group, then, for this to work.

and as other people have mentioned, mount ntfs read-only because, well, support is not all that great for that file system, yet.

so use users,ro on your ntfs lines in /etc/fstab.


Last edited by lain iwakura on Tue May 21, 2002 8:42 am; edited 1 time in total
Back to top
View user's profile Send private message
hudsonhauck
Apprentice
Apprentice


Joined: 16 May 2002
Posts: 182
Location: Albany, CA

PostPosted: Tue May 21, 2002 7:08 am    Post subject: Reply with quote

Well, anybody can unmount these drives now, however, when I try to mount it says this:
"mount: only root can do that"
we're getting closer...
_________________
Matthew Hauck
http://matthauck.blogspot.com/
Back to top
View user's profile Send private message
lain iwakura
Apprentice
Apprentice


Joined: 09 May 2002
Posts: 176
Location: sd, ca

PostPosted: Tue May 21, 2002 7:20 am    Post subject: Reply with quote

defaults,users,ro should work.
Back to top
View user's profile Send private message
hudsonhauck
Apprentice
Apprentice


Joined: 16 May 2002
Posts: 182
Location: Albany, CA

PostPosted: Tue May 21, 2002 7:38 am    Post subject: Reply with quote

No such luck. Here is my updated fstab to make sure i have it right:
Code:
 /dev/hda6               /home/edrive    ntfs            noatime,defaults,users.ro         0 1
/dev/hda1               /home/cdrive    ntfs            noatime,defaults,users,ro         0 1
/dev/hda5               /home/ddrive    ntfs            noatime,defaults,users,ro         0 1


when I type "mount /dev/hda6 /home/edrive" it still tells me "mount: only root can do that"
_________________
Matthew Hauck
http://matthauck.blogspot.com/
Back to top
View user's profile Send private message
hudsonhauck
Apprentice
Apprentice


Joined: 16 May 2002
Posts: 182
Location: Albany, CA

PostPosted: Tue May 21, 2002 7:44 am    Post subject: Reply with quote

Also, just curious, do you have to reboot for the fstab to take effect? I have been rebooting every time and it is kinda annoying...
_________________
Matthew Hauck
http://matthauck.blogspot.com/
Back to top
View user's profile Send private message
lain iwakura
Apprentice
Apprentice


Joined: 09 May 2002
Posts: 176
Location: sd, ca

PostPosted: Tue May 21, 2002 8:00 am    Post subject: Reply with quote

I'm pretty sure you have to reboot. that's what fstab is for -- for mounting devices at boottime.

you could try changing fstab, then remount the drive -- not sure that works, though
Back to top
View user's profile Send private message
hudsonhauck
Apprentice
Apprentice


Joined: 16 May 2002
Posts: 182
Location: Albany, CA

PostPosted: Tue May 21, 2002 8:12 am    Post subject: Reply with quote

lain iwakura wrote:
I'm pretty sure you have to reboot. that's what fstab is for -- for mounting devices at boottime.

you could try changing fstab, then remount the drive -- not sure that works, though


so no more thoughts on why only the root can mount?
_________________
Matthew Hauck
http://matthauck.blogspot.com/
Back to top
View user's profile Send private message
lain iwakura
Apprentice
Apprentice


Joined: 09 May 2002
Posts: 176
Location: sd, ca

PostPosted: Tue May 21, 2002 8:19 am    Post subject: Reply with quote

eww, didn't see you're updated post.

mnt /home/edrive should work. you don't need to say mnt /dev/blah /home/blah. that's why you where getting that error.
Back to top
View user's profile Send private message
hudsonhauck
Apprentice
Apprentice


Joined: 16 May 2002
Posts: 182
Location: Albany, CA

PostPosted: Tue May 21, 2002 8:31 am    Post subject: Reply with quote

Okay, now I can mount it from any user, however, once I do, it still switches the file permissions to root, and I can't get inside the folder, which puts me back to square-one. Also, even when I'm the root, it tells me this when I type "mount /home/edrive" :
Code:
mount: wrong fs type, bad option, bad superblock on /dev/hda6,
       or too many mounted file systems

edit: but when I type "mount /dev/hda6 /home/edrive" it gave me no such error.
_________________
Matthew Hauck
http://matthauck.blogspot.com/


Last edited by hudsonhauck on Tue May 21, 2002 8:39 am; edited 1 time in total
Back to top
View user's profile Send private message
citron
n00b
n00b


Joined: 17 Apr 2002
Posts: 12
Location: Prague, Czech Republic

PostPosted: Tue May 21, 2002 8:38 am    Post subject: suid bit Reply with quote

Try to
# chmod u+s /bin/mount to add suid bit on mount binary file ..
not so secure, but useful for mounting disks like non root user.

Martin
Back to top
View user's profile Send private message
lain iwakura
Apprentice
Apprentice


Joined: 09 May 2002
Posts: 176
Location: sd, ca

PostPosted: Tue May 21, 2002 8:39 am    Post subject: Reply with quote

another thing, will any of your ntfs drives mount properly as root?
Back to top
View user's profile Send private message
hudsonhauck
Apprentice
Apprentice


Joined: 16 May 2002
Posts: 182
Location: Albany, CA

PostPosted: Tue May 21, 2002 8:47 am    Post subject: Re: suid bit Reply with quote

citron wrote:
Try to
# chmod u+s /bin/mount

Didn't work.
lain iwakura wrote:
another thing, will any of your ntfs drives mount properly as root?

Yes. They all mount fine as the root (except for the weird problem above)
_________________
Matthew Hauck
http://matthauck.blogspot.com/
Back to top
View user's profile Send private message
hudsonhauck
Apprentice
Apprentice


Joined: 16 May 2002
Posts: 182
Location: Albany, CA

PostPosted: Tue May 21, 2002 8:54 am    Post subject: Re: suid bit Reply with quote

hudsonhauck wrote:
Yes. They all mount fine as the root (except for the weird problem above)


I take that back. For some reason, the same stupid hda6 (edrive) doesn't mount through the fstab.
_________________
Matthew Hauck
http://matthauck.blogspot.com/


Last edited by hudsonhauck on Tue May 21, 2002 9:13 am; edited 2 times in total
Back to top
View user's profile Send private message
lain iwakura
Apprentice
Apprentice


Joined: 09 May 2002
Posts: 176
Location: sd, ca

PostPosted: Tue May 21, 2002 8:55 am    Post subject: Reply with quote

you created dirs in home? hmm, what are the ownerships of the dirs when you type ls -l /home ? the dirs should belong to root.

never seen hd's mounted on /home. I suppose it should work but .... hmm.
Back to top
View user's profile Send private message
hudsonhauck
Apprentice
Apprentice


Joined: 16 May 2002
Posts: 182
Location: Albany, CA

PostPosted: Tue May 21, 2002 8:57 am    Post subject: Reply with quote

when they are unmounted, cdrive, edrive, and ddrive belong to "users". But when they are mounted, they belong to "root"

before mount:
Code:
ls -l
total 300
drwxr-xr-x    2 root     users        4096 May 19 10:29 cdrive
drwxr-xr-x    2 root     users        4096 May 19 20:38 ddrive
drwxr-xr-x    2 matt     users        4096 May 21 01:24 edrive
-rw-r--r--    1 root     users      284523 May 19 18:39 list
drwxr-xr-x    8 matt     users        4096 May 21 01:50 matt


after mount:
Code:
 ls -l
total 288                       
dr-x------    1 root     root         8192 May 18 22:33 cdrive
dr-x------    1 root     root        12288 May 19 13:18 ddrive
dr-x------    1 root     root         8192 May 20 22:57 edrive
-rw-r--r--    1 root     users      284523 May 19 18:39 list
drwxr-xr-x    8 matt     users        4096 May 21 01:50 matt


where are hd's usually mounted?
_________________
Matthew Hauck
http://matthauck.blogspot.com/


Last edited by hudsonhauck on Tue May 21, 2002 9:01 am; edited 1 time in total
Back to top
View user's profile Send private message
lain iwakura
Apprentice
Apprentice


Joined: 09 May 2002
Posts: 176
Location: sd, ca

PostPosted: Tue May 21, 2002 9:01 am    Post subject: Reply with quote

alright, umount the drives, su to root and then del the dirs. then recreate them. then try remounting.

the dirs are usually created in the /mnt dir.

update: of coarse you'll should reboot if you change the dirs to the /mnt dir, which I think you should try. also, don't forget to update /etc/fstab.

this is just a guess. not sure if i can be much more help. :D
Back to top
View user's profile Send private message
hudsonhauck
Apprentice
Apprentice


Joined: 16 May 2002
Posts: 182
Location: Albany, CA

PostPosted: Tue May 21, 2002 9:11 am    Post subject: Reply with quote

By the way, thanks for all the help, you've been great! :D
If I mount them in the /mnt dir, which has root perms, how will I be able to get at them from a non-root account?
Oh, and no, it still doesn't work. It is still the access-control problem
_________________
Matthew Hauck
http://matthauck.blogspot.com/
Back to top
View user's profile Send private message
hudsonhauck
Apprentice
Apprentice


Joined: 16 May 2002
Posts: 182
Location: Albany, CA

PostPosted: Tue May 21, 2002 9:22 am    Post subject: Reply with quote

Okay, they're in the /mnt dir now and the stupid /dev/hda6 errors are gone. However, since /mnt is owned by root, and /mnt/*drive is owned by root, any old user can't access it. Damn. Maybe it isn't possible?
_________________
Matthew Hauck
http://matthauck.blogspot.com/
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Duplicate Threads All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum