Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
unable to mount CD unless superuser
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
HeadHolio
Guru
Guru


Joined: 10 Aug 2002
Posts: 445

PostPosted: Mon Jan 27, 2003 6:10 am    Post subject: unable to mount CD unless superuser Reply with quote

Here is my /etc/fstab

Code:
# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.
/dev/hda1               /boot           ext3            noauto,noatime          1 1
/dev/hda3               /               reiserfs        noatime                 0 0
/dev/hda2               none            swap            sw                      0 0
/dev/hda4               /home           reiserfs        noatime                 0 0
#/dev/cdroms/cdrom0     /mnt/cdrom      iso9660         noauto,users,ro         0 0
#/dev/fd0               /mnt/floppy     auto            noauto,user             0 0
proc                    /proc           proc            defaults                0 0

# glibc 2.2 and above expects tmpfs to be mounted at /dev/shm for
# POSIX shared memory (shm_open, shm_unlink). Adding the following
# line to /etc/fstab should take care of this:
# (tmpfs is a dynamically expandable/shrinkable ramdisk, and will use almost no
#  memory if not populated with files)

tmpfs                   /dev/shm        tmpfs           defaults                0 0

/dev/scsi/host0/bus0/target0/lun0/cd    /mnt/cdrom      auto    ro,noauto,users,exec    0 0


Now since the option "users" is in /mnt/cdrom it means that anyone can mount and unmount the cdrom right? Well, that doesn't happen. Nobody but root can use the mount command.
Back to top
View user's profile Send private message
SuperTomate
Guru
Guru


Joined: 02 Jun 2002
Posts: 392
Location: France

PostPosted: Mon Jan 27, 2003 7:11 am    Post subject: Reply with quote

The option to allow any user to mount a device is "user" not "users".

EDIT : You're right ! It also works with "users".
From 'man mount' :
-> user : Allow an ordinary user to mount the file system.
The name of the mounting user is written to mtab so that he can unmount the file system again. This option implies the options noexec, nosuid, and nodev (unless overridden by subsequent options, as in the option line
user,exec,dev,suid).
-> users : Allow every user to mount and unmount the file system.
This option implies the options noexec, nosuid, and nodev (unless overridden by subsequent options, as in the option line users,exec,dev,suid).

I have this line in my /etc/fstab and I can mount my CD with any user :
Code:
/dev/cdroms/cdrom0      /mnt/cdrom      iso9660         noauto,ro,user          0 0
Back to top
View user's profile Send private message
HeadHolio
Guru
Guru


Joined: 10 Aug 2002
Posts: 445

PostPosted: Mon Jan 27, 2003 11:14 am    Post subject: ok Reply with quote

Well, it doesn't matter if I use "user" or "users", it still only lets root mount a cd. As you can see a little further up in my fstab, the line you have in your fstab is similar to the one I had before I got SCSI emulation and cd burning working. K3B automatically inserted that line at the bottom when I went through the setup, so I figured I had to comment out the line that I already had. Do you have a cd burner setup with scsi emulation?
Back to top
View user's profile Send private message
drakonite
l33t
l33t


Joined: 02 Nov 2002
Posts: 768
Location: Lincoln, NE

PostPosted: Mon Jan 27, 2003 11:29 am    Post subject: Reply with quote

Do you have the lines commented using the #'s in your fstab or is that just in what you posted?

If so then you need to remove the #'s at the begining of the lines that deal with the CD-ROM for it to work.
_________________
Shoot Pixels Not People

My GPG/PGP Public key
Back to top
View user's profile Send private message
HeadHolio
Guru
Guru


Joined: 10 Aug 2002
Posts: 445

PostPosted: Mon Jan 27, 2003 12:00 pm    Post subject: yup Reply with quote

They are commented in my fstab. But I only commented it because of the line at the very bottom. I shouldn't have two lines for a cdrom device...should I? (K3B automatically inserted the line at the bottom during it's setup and only after I got scsi-emulation working).
Back to top
View user's profile Send private message
HeadHolio
Guru
Guru


Joined: 10 Aug 2002
Posts: 445

PostPosted: Mon Jan 27, 2003 12:17 pm    Post subject: test Reply with quote

Ok, for a test I did the following. I edited my fstab so that it contained the following:

Code:
# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.
/dev/hda1               /boot           ext3            noauto,noatime          1 1
/dev/hda3               /               reiserfs        noatime                 0 0
/dev/hda2               none            swap            sw                      0 0
/dev/hda4               /home           reiserfs        noatime                 0 0
/dev/cdroms/cdrom0      /mnt/cdrom      iso9660         noauto,users,ro         0 0
proc                    /proc           proc            defaults                0 0

# glibc 2.2 and above expects tmpfs to be mounted at /dev/shm for
# POSIX shared memory (shm_open, shm_unlink). Adding the following
# line to /etc/fstab should take care of this:
# (tmpfs is a dynamically expandable/shrinkable ramdisk, and will use almost no
#  memory if not populated with files)

tmpfs                   /dev/shm        tmpfs           defaults                0 0

#/dev/scsi/host0/bus0/target0/lun0/cd   /mnt/cdrom      auto    ro,noauto,users,exec    0 0


I also added the user "home" to all groups (just to be sure), and then rebooted (again, just to be sure). Then I tried to mount a cd, and I got the same error
Code:

home@mymachine home $ mount /mnt/cdrom
mount: must be superuser to use mount
home@mymachine home $


What else could I be missing???
Back to top
View user's profile Send private message
HeadHolio
Guru
Guru


Joined: 10 Aug 2002
Posts: 445

PostPosted: Mon Jan 27, 2003 12:25 pm    Post subject: problem solved Reply with quote

Ok, i got it to work by simply making mount executable by users other than root.

Code:
chmod u+s /bin/mount
chmod u+s /bin/umount


Now it works ok. Does everyone else also have their system setup like this?


Last edited by HeadHolio on Mon Jan 27, 2003 6:11 pm; edited 1 time in total
Back to top
View user's profile Send private message
drakonite
l33t
l33t


Joined: 02 Nov 2002
Posts: 768
Location: Lincoln, NE

PostPosted: Mon Jan 27, 2003 12:54 pm    Post subject: Reply with quote

I hate it when it's a permission error like that..

I missed the last line of the fstab that had the cdrom in it. No, you don't need it listed twice ;)
_________________
Shoot Pixels Not People

My GPG/PGP Public key
Back to top
View user's profile Send private message
SuperTomate
Guru
Guru


Joined: 02 Jun 2002
Posts: 392
Location: France

PostPosted: Mon Jan 27, 2003 4:26 pm    Post subject: Re: problem solved Reply with quote

HeadHolio wrote:
Now it works ok. Does everyone else also have their system setup like this?

Yes, I have /bin/mount and /bin/umount with the suid bit but I haven't set them manually. (I use sys-apps/util-linux-2.11y)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
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