LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 12-15-2003, 10:15 PM   #1
kierse
Member
 
Registered: Apr 2003
Distribution: Slackware!
Posts: 73

Rep: Reputation: 15
problems accessing mounted drives!


I've been trying to access two windows partitions from linux. I can access both drives using root but I want to be able to access them from other user accounts.

Here are the relevant lines from my fstab file:

/dev/hda9 /mnt/fat vfat auto,users,rw 1 0
/dev/hda5 /mnt/personal_xp ntfs auto,users,ro 0 0

When trying to access both folders from a user account I get a message saying I don't have the permission. I have tried adding umask 000 to each but that doesn't seem to make any difference. Here are the folder permissions:

(When drives are mounted)
drwxr-xr-x 2 root root 48 Mar 16 2002 cdrom
drwxr--r-- 7 root root 2048 Dec 15 21:01 fat
drwxr-xr-x 2 root root 48 Mar 16 2002 floppy
drwxr-xr-x 2 root root 48 Mar 16 2002 hd
dr-x------ 1 root root 12288 Dec 13 16:46 personal_xp
drwxr-xr-x 2 root root 48 Dec 15 18:14 test

(When drives are not mounted)
drwxr-xr-x 2 root root 48 Mar 16 2002 cdrom
drwxrwx--- 2 root users 48 Nov 30 16:23 fat
drwxr-xr-x 2 root root 48 Mar 16 2002 floppy
drwxr-xr-x 2 root root 48 Mar 16 2002 hd
dr-xr-x--- 2 root users 48 Dec 5 23:54 personal_xp
drwxr-xr-x 2 root root 48 Dec 15 18:14 test

I know the problem is with permissions but I don't know linux well enough yet to know what the problem is

thanks
Kierse
 
Old 12-15-2003, 10:34 PM   #2
Azmeen
Senior Member
 
Registered: May 2003
Location: Malaysia
Distribution: Slackware, LFS, CentOS
Posts: 1,307

Rep: Reputation: 47
Change it to:

Code:
/dev/hda9    /mnt/fat                vfat    noauto,users,rw   0 0
/dev/hda5    /mnt/personal_xp ntfs    noauto,users,ro   0 0
Reason being, I don't think you'll need to set the fsck passno to yoru FAT partitions. Another thing, the auto mounting will set the owner of these partitions as root, and thus other users can't view them (at least I think so... so don't take this as fact).
 
Old 12-15-2003, 10:37 PM   #3
kierse
Member
 
Registered: Apr 2003
Distribution: Slackware!
Posts: 73

Original Poster
Rep: Reputation: 15
Thanks Azmeen, I'll give that a try.

There has got to be a way to automount drives and provide access to multiple users.

Anyone else with any ideas?
kierse
 
Old 12-15-2003, 11:26 PM   #4
Azmeen
Senior Member
 
Registered: May 2003
Location: Malaysia
Distribution: Slackware, LFS, CentOS
Posts: 1,307

Rep: Reputation: 47
Quote:
Originally posted by kierse
There has got to be a way to automount drives and provide access to multiple users.
Of course... but it requires getting your hands dirty to some extend

Ok... some of the things you'll need...

The autofs package.

An rc.autofs script... I'd recommend this one, but you're free to find others or write your own

and...

Patience

OK... let's configure this thing.

1) Put the rc.autofs script into /etc/rc.d/ and chmod it +x.

2) Place these lines somewhere in /etc/rc.d/rc.M
Code:
# Start Automounter:
if [ -x /etc/rc.d/rc.autofs ]; then
  . /etc/rc.d/rc.autofs start
fi
3) Place these lines somewhere in /etc/rc.d/rc.6
Code:
# Shut down the Automounter:
if [ -x /etc/rc.d/rc.autofs ]; then
  /etc/rc.d/rc.autofs stop
fi
4) Delete the exiting /mnt/fat and /mnt/personal_xp dirs. Make sure you've unmounted these dirs before deleting!!!.

5) Create a file called /etc/auto.master containing this line:
Code:
/mnt      /etc/auto.winmounts      --timeout=60
6) Create a file called /etc/auto.winmounts these lines:
Code:
fat          -fstype=vfat,rw,loop     :/dev/hda9
personal_xp   -fstype=ntfs,ro,loop     :/dev/hda5
7) Say your prayers... and on to the test... Try running /etc/rc.d/rc.autofs start Hopefully there's no error messages.

8) Now try (as a normal user) doing this: cd /mnt/fat Hopefully you'll be in your FAT partition now. Try creating a file or something. Do you have write access?

Tell me the results...
 
Old 12-17-2003, 05:30 PM   #5
kierse
Member
 
Registered: Apr 2003
Distribution: Slackware!
Posts: 73

Original Poster
Rep: Reputation: 15
alrighty, sorry it took so long for me to get back, here are the results:

starting rc.autofs:
Code:
Starting automounter:.
getting status:
Code:
Configured Mount Points:
------------------------

Active Mount Points:
--------------------
stopping rc.autofs
Code:
Automounter not running
After running rc.autofs start I tried to access the partitions. Neither were mounted by the automounter so I must be doing something wrong.
Upon closer examination of the rc.autofs file, a list of mounted partitions is supposed to be listed when the automounter is first run (ie. after "starting automounter:") but this doesn't happen.

I created the two files auto.master & auto.winmounts and placed the given code in each. I believe the problem occurs in the rc.autofs file in the getmounts() method where it determines which partitions to mount.

I'm gonna keep fiddling with it and see what I can come up with, let me know if you have any ideas

kierse
 
Old 12-17-2003, 06:37 PM   #6
kierse
Member
 
Registered: Apr 2003
Distribution: Slackware!
Posts: 73

Original Poster
Rep: Reputation: 15
ok, never mind that problem, I somehow got it working. The 2 drives mount ok at boot but I can't access them unless I am logged in as the root user. Do I have to add another mounting option to the auto.winmounts file indicating that it may be accessed by all users?

thanks
Kierse
 
Old 12-17-2003, 06:59 PM   #7
Azmeen
Senior Member
 
Registered: May 2003
Location: Malaysia
Distribution: Slackware, LFS, CentOS
Posts: 1,307

Rep: Reputation: 47
Quote:
Originally posted by kierse
ok, never mind that problem, I somehow got it working. The 2 drives mount ok at boot but I can't access them unless I am logged in as the root user. Do I have to add another mounting option to the auto.winmounts file indicating that it may be accessed by all users?

thanks
Kierse
This shouldn't be an issue at all... I've tested this setup many many times before. Normal users should have no problems accessing an auntomount point.

Have you made any modifications to the settings... by stating "somehow got it working" I assume you did, and I hope that you document your changes and understand what you're doing.

The original setup that I gave you is guaranteed to work first time, everytime. You just won't "see" the dirs that are supposed to be your mountpoints... just go ahead and type cd /mnt/fat (as a user) eventhough it's not there.
 
Old 12-17-2003, 07:21 PM   #8
2TonCartoon
LQ Newbie
 
Registered: Nov 2003
Location: UK
Distribution: Slack
Posts: 9

Rep: Reputation: 0
Talking

All I did to enable other users to mount Windoze drives, was add with uid and gid
to FSTAB


/dev/hdb1 /WinD vfat users,uid=XXX,gid=YYY,rw 0 0

YYY was a new group I set up, and XXX was a member of that group along with root
have a potch with those settings, config to your needs. Add noauto if you dont want it mounted @ boot time. I only have 1 other user besides root on my system, so above works for me, if u have more users then read man fstab, search web etc

Happy Slackin :-)
 
Old 12-17-2003, 08:22 PM   #9
kierse
Member
 
Registered: Apr 2003
Distribution: Slackware!
Posts: 73

Original Poster
Rep: Reputation: 15
When I said "somehow got it working" I meant that after I trying a couple of things that didn't seem to work, I replaced the modified file with a copy of the original.

I tried it again and I am still having the same problem: When I am logged in a root the two mounted partitions are accessable. When I am logged in as another user I don't have the permission to access the two partitions
ie. typing

1. cd /mnt/fat or
2. cd /mnt/personal_xp

throws an error saying that I don't have the permission to acces the folder. when I view the folders owner/group it shows root for both. I don't understand why this is happening. Both floppy and cdrom in the mount dir are owned/part of root group yet I can access both

Any ideas?
Kierse
 
Old 12-17-2003, 08:43 PM   #10
Azmeen
Senior Member
 
Registered: May 2003
Location: Malaysia
Distribution: Slackware, LFS, CentOS
Posts: 1,307

Rep: Reputation: 47
Are the entries for both these dir still in fstab?

My apologies, I noticed I didn't mention this earlier. You're supposed to delete their lines in the fstab.
 
Old 12-17-2003, 09:43 PM   #11
kierse
Member
 
Registered: Apr 2003
Distribution: Slackware!
Posts: 73

Original Poster
Rep: Reputation: 15
no problem, I figured they shouldn't be there so I just commented them out
 
Old 12-19-2003, 12:30 AM   #12
kierse
Member
 
Registered: Apr 2003
Distribution: Slackware!
Posts: 73

Original Poster
Rep: Reputation: 15
< bump >

Anyone got any ideas?

Kierse
 
Old 12-19-2003, 01:12 AM   #13
ganlu
LQ Newbie
 
Registered: Dec 2003
Location: ChongQing, China
Distribution: Slackware 9.1
Posts: 6

Rep: Reputation: 0
I am not sure why they talk about autofs, just modify /etc/fstab, and change the line of windows partition as "umask 0 0 0" or "umask 022 0 0"(just read permission), like
/dev/hda7 /mnt/vfat vfat defaults, umask=022 0 0
I are just figuring out how to automount (supermount) my flashdisk and cdrom., which has been a real problem for my wife for mounting&umounting in the linux.
 
Old 12-19-2003, 02:00 AM   #14
Azmeen
Senior Member
 
Registered: May 2003
Location: Malaysia
Distribution: Slackware, LFS, CentOS
Posts: 1,307

Rep: Reputation: 47
I suggested autofs because kierse wants the partition to be available to everyone after boot. I'd use the "normal" fstab method myself... but somehow it doesn't work for him.

Since what he wants is an on-demand automounting schema, I suggested autofs because I have done a project requiring something similar (actually slightly more complex, mounting ISO images as filesystem via samba).

The strange thing is, my setup works even as normal user whereas he has problems with it using non-root accounts. This is something I have never faced at all.
 
Old 12-19-2003, 06:11 PM   #15
kierse
Member
 
Registered: Apr 2003
Distribution: Slackware!
Posts: 73

Original Poster
Rep: Reputation: 15
thanks for the suggestions Azmeen, I'll keep toying with it and see what I can come up with. Let me know if you have any more ideas

kierse
 
  


Reply



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
Mounted drives doesn't appear sdr_ar Ubuntu 7 11-10-2005 08:12 AM
accessing mounted partitions chris01 Linux - Newbie 4 09-19-2005 01:33 AM
problem accessing mounted hdd linuxmandrake Linux - Newbie 1 11-20-2004 04:37 PM
Accessing CD Drives/Floppy Drives rsearing Linux - Newbie 9 08-13-2004 08:53 PM
Accessing a mounted smb share hangs haddad Linux - Wireless Networking 0 07-24-2004 05:52 AM

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

All times are GMT -5. The time now is 09: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
Open Source Consulting | Domain Registration