LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 01-10-2006, 07:50 PM   #1
Melkor
Member
 
Registered: Aug 2003
Location: MN
Distribution: Linux Mint
Posts: 179

Rep: Reputation: 34
man file for "mount" not matching reality


I've searched but alas, have found nobody else with my problem.

I'm hoping someone's got some suggestions because I'm out of ideas. I'm not really a newbie, so this is all the more frustrating because this should really be pretty simple, and it's just not working.

I'm running Slackware 10.1 with the 2.4.29 default kernel. Nothing else out of the ordinary.

I'd like to start out by quoting what the man page says on "mount":
Quote:
Normally, only the superuser can mount file systems. However, when fstab contains the user option on a line, anybody can mount the corresponding system.

Thus, given a line
/dev/cdrom /cd iso9660 ro,user,noauto,unhide
any user can mount the iso9660 file system found on his CDROM using the command
mount /dev/cdrom


Seems straightforward enough. In fact, that's how I have always understood it to work. In fact, the man page goes on to say that if you use "users" instead of just "user", ANY user can umount a cdrom as well.

However, on neither of my Slackware 10.1 boxes does this work.

Here's my fstab, just for giggles:

Code:
/dev/hda5        swap             swap        defaults         0   0
/dev/hda6        /                reiserfs    defaults         1   1
/dev/hda1        /home/tli/ntfs   ntfs        uid=1000,ro      1   0
/dev/hda7        /home/tli/fat-d  vfat        uid=1000         0   0
/dev/hda8        /home/tli/fat-e  vfat        uid=1000         0   0
/dev/cdrom       /home/tli/cdrom  iso9660     users,noauto,owner,ro    0   0
/dev/fd0         /mnt/floppy      auto        noauto,owner     0   0
devpts           /dev/pts         devpts      gid=5,mode=620   0   0
proc             /proc            proc        defaults         0   0
I know, it's kind of unruly, but that's because it's a laptop and it's dual-boot and I need multiple FAT32 partitions for stuff.

Now, given my "users" on the /dev/cdrom entry in my fstab, one would think that any user logged onto this machine would be able to mount the cdrom drive.

But you would be wrong. I am denied with the ominous phrase "mount: only root can do that".

Somebody PLEASE tell me I'm just missing something stupid here.
 
Old 01-10-2006, 08:01 PM   #2
wrj
Member
 
Registered: Aug 2003
Location: Canada/US
Distribution: Ubuntu, Arch
Posts: 84

Rep: Reputation: 15
Have you tried removing "owner" from the line? My understanding is that the "owner" adds a restriction where user must also be the owner of the device.
 
Old 01-10-2006, 08:10 PM   #3
Melkor
Member
 
Registered: Aug 2003
Location: MN
Distribution: Linux Mint
Posts: 179

Original Poster
Rep: Reputation: 34
I just tried that to no avail. Now that line reads:
Code:
/dev/cdrom       /home/tli/cdrom  iso9660     users,noauto,ro  0   0
But I still get the same result.

Something broken in the "mount" command in the 2.4.29 kernel or in Slack 10.1?
 
Old 01-10-2006, 08:29 PM   #4
shilo
Senior Member
 
Registered: Nov 2002
Location: Stockton, CA
Distribution: Slackware 11 - kernel 2.6.19.1 - Dropline Gnome 2.16.2
Posts: 1,132

Rep: Reputation: 49
The "owner" was the issue (it was over-riding "users").

If I was smart, I'd give you the command to re-parse /etc/fstab. I'm not that smart, though, so I use the magic "reboot" command.

Reboot and see if that doesn't solve the problem.
 
Old 01-10-2006, 08:43 PM   #5
Melkor
Member
 
Registered: Aug 2003
Location: MN
Distribution: Linux Mint
Posts: 179

Original Poster
Rep: Reputation: 34
I did before I posted my last reply. No go. Same result. "mount: only root can do that."

I just tried it on my other slack 10.1 box too (which has a far simpler fstab and is totally different hardware) and it doesn't work there either.
 
Old 01-10-2006, 08:45 PM   #6
Melkor
Member
 
Registered: Aug 2003
Location: MN
Distribution: Linux Mint
Posts: 179

Original Poster
Rep: Reputation: 34
BTW, before anyone points it out, I'm logged in as "tli", so the "/home/tli/cdrom" mount point is valid, and is within permissions.

It seems like the mount command itself is thinking it's limited to root, not just the device or fstab entry.
 
Old 01-10-2006, 08:48 PM   #7
shilo
Senior Member
 
Registered: Nov 2002
Location: Stockton, CA
Distribution: Slackware 11 - kernel 2.6.19.1 - Dropline Gnome 2.16.2
Posts: 1,132

Rep: Reputation: 49
Does /dev/cdrom exist?
DOes it work if you change all references to "/dev/cdrom" to the actual name of the device (e.g. /dev/hdc)?
 
Old 01-10-2006, 08:52 PM   #8
Melkor
Member
 
Registered: Aug 2003
Location: MN
Distribution: Linux Mint
Posts: 179

Original Poster
Rep: Reputation: 34
Yep, "/dev/cdrom" exists. If I "su" to root and "mount /dev/cdrom /home/tli/cdrom" it works fine.

And actually, if I take "noauto" out of its fstab line, it automounts on boot (I tried that earlier today).

And hang on a minute... I'll try changing everything to "/dev/hdc" instead of "/dev/cdrom" and rebooting to see if that works.
 
Old 01-10-2006, 08:53 PM   #9
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,123

Rep: Reputation: 151Reputation: 151
What's the command you're typing? It should be just:

Code:
mount /home/tli/cdrom
or

Code:
mount /dev/cdrom
If you used the following, for example, it will fail:

Code:
mount -ro /home/tli/cdrom
 
Old 01-10-2006, 08:55 PM   #10
Melkor
Member
 
Registered: Aug 2003
Location: MN
Distribution: Linux Mint
Posts: 179

Original Poster
Rep: Reputation: 34
I'm typing (as "tli") simply
Code:
mount /dev/cdrom /home/tli/cdrom
 
Old 01-10-2006, 09:00 PM   #11
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,123

Rep: Reputation: 151Reputation: 151
I get the same error when I do it that way - can you try just the one? Either `mount /dev/cdrom` or `mount /home/tli/cdrom`
 
Old 01-10-2006, 09:04 PM   #12
Melkor
Member
 
Registered: Aug 2003
Location: MN
Distribution: Linux Mint
Posts: 179

Original Poster
Rep: Reputation: 34
Quote:
Originally Posted by gilead
I get the same error when I do it that way - can you try just the one? Either `mount /dev/cdrom` or `mount /home/tli/cdrom`
Bloody hell... that worked! gilead gets the cigar!

Okay, the ONLY way I've ever mounted stuff is with the syntax of "mount [devicename] [mount point]".

Why the hell does that work as root when I specify a mount point, but NOT while logged in as anyone else?

Don't get me wrong... I'm happy that it's working and I thank you for your assistance! This was very frustrating!

But it bugs me that it doesn't work the way I have always understood it to work. Why should I HAVE to leave off the mount point switch in the mount command when I'm logged in as something other than root?
 
Old 01-10-2006, 09:11 PM   #13
Melkor
Member
 
Registered: Aug 2003
Location: MN
Distribution: Linux Mint
Posts: 179

Original Poster
Rep: Reputation: 34
Not to mention, the man page even says:
Quote:
The standard form of the mount command, is
mount -t type device dir


Which implies to me that leaving off the mount point isn't technically correct. That's why I've always specified a mount point when I've mounted a drive/cd/usb thumb drive/whathaveyou.

I know, I know, I know... it's getting the mount point from the corresponding entry in /etc/fstab.

But it should still work when a mount point is specified, particularly the mount point that agrees with fstab!

That kind of inconsistency really irritates me, especially when I don't understand why.

Thanks for all your suggestions, guys. This has been buggin me for quite a while, if you can't tell.
 
Old 01-10-2006, 09:15 PM   #14
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,123

Rep: Reputation: 151Reputation: 151
It seems that mount only checks /etc/fstab when given a single command line parameter. When it gets a single parameter like that it looks it up in the device and mount point columns. If it's there, it checks whether the mount options allow the user to mount the device.

More than one parameter and it treats it as a stand-alone command - which only root can do.

That's a guess based on having had the same problem previously myself.
 
Old 01-10-2006, 09:16 PM   #15
Melkor
Member
 
Registered: Aug 2003
Location: MN
Distribution: Linux Mint
Posts: 179

Original Poster
Rep: Reputation: 34
That comes perilously close to making good sense, gilead. Thanks.

All the same, you'd think something as pointed as that MIGHT BE MENTIONED IN THE FRICKING MAN PAGE for "mount"!

A single line saying "a mount point should not be specified if a non-root user is mounting a device that is defined in the fstab" would probably suffice.

:-/

Last edited by Melkor; 01-10-2006 at 09:22 PM.
 
  


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
Error in man command "sh: line 1: /usr/bin/gtbl: No such file or directory" MinA Slackware 1 09-06-2004 06:36 PM
"No matching Call Error" ashwinipahuja Programming 1 06-23-2004 01:37 PM
Error: "A required .DLL file, CYGPCRE -0.DLL, was not found" when using man dipperdan Linux - Newbie 2 04-28-2004 03:55 PM
Unable to Mount," Bogus File System Found" nav_Lin Linux - Newbie 1 04-16-2004 09:27 PM
dump + restore to backup linux ; "Couldn't find matching filesystem: LABEL=/" on boot markus1982 Linux - General 4 09-21-2002 01:16 PM


All times are GMT -5. The time now is 10:43 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration