This is a discussion on eject doesn't like user within the Slackware Linux Support forums, part of the Unix Operating Systems category; --> I'm using slack-9.0. eject will eject my /dev/cdrom as root, but won't as user. I get the error message ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| I'm using slack-9.0. eject will eject my /dev/cdrom as root, but won't as user. I get the error message eject: unable to open `/dev/cdrom'. My /etc/fstab is: /dev/cdrom /mnt/cdrom iso9660 noauto,users,ro 0 0 .... and ... root :~# ls -l /dev/cd* lrwxrwxrwx 1 root root 8 Jun 17 15:09 /dev/cdrom -> /dev/hdc root :~# ls -l /dev/hdc brw-rw---- 1 root disk 22, 0 Jun 9 2002 /dev/hdc Any tips on how to get this working under user? |
| |||
| gh wrote: > root :~# ls -l /dev/hdc > brw-rw---- 1 root disk 22, 0 Jun 9 2002 /dev/hdc > > Any tips on how to get this working under user? Add the user to the "disk" group. That is, open up /etc/group in an editor, add the username to the end of list for the disk group, save it and log the user out and in again. Rene. |
| |||
| gh wrote: > I'm using slack-9.0. eject will eject my /dev/cdrom as root, but won't as > user. I get the error message eject: unable to open `/dev/cdrom'. My > /etc/fstab is: > > /dev/cdrom /mnt/cdrom iso9660 noauto,users,ro 0 0 .... and ... > I don't know if this is the actual solution, but it works for me. Change the 'users' in your fstab file to 'user' instead. man mount gives you the information about the 'user' option in fstab. Jason |
| |||
| Jason Dumler wrote: > gh wrote: >> I'm using slack-9.0. eject will eject my /dev/cdrom as root, but won't >> as >> user. I get the error message eject: unable to open `/dev/cdrom'. My >> /etc/fstab is: >> >> /dev/cdrom /mnt/cdrom iso9660 noauto,users,ro 0 0 .... and ... >> > > I don't know if this is the actual solution, but it works for me. > Change the 'users' in your fstab file to 'user' instead. > > man mount gives you the information about the 'user' option in fstab. > > Jason No, this doesn't work in this case. hmmmm. |
| |||
| On Thu, 03 Jul 2003 20:15:19 GMT, gh <ghwbush@earthlink.net> wrote: >Jason Dumler wrote: > >> gh wrote: >>> I'm using slack-9.0. eject will eject my /dev/cdrom as root, but won't >>> as user. I get the error message eject: unable to open `/dev/cdrom'. My >>> /etc/fstab is: >>> >>> /dev/cdrom /mnt/cdrom iso9660 noauto,users,ro 0 0 .... and ... >>> >> I don't know if this is the actual solution, but it works for me. >> Change the 'users' in your fstab file to 'user' instead. >> >> man mount gives you the information about the 'user' option in fstab. >> >> Jason > >No, this doesn't work in this case. hmmmm. This one still bites me. No one should be 'in' /mnt/cdrom (even if they're not doing anything there) in order to unmount it. The eject script first unmounts the CD then ejects the tray. Ensure you've cd'd to some other dir before invoking eject. -- jimbo@sonic.net Eclectic Garbanzo BBS, (707) 539-1279 "My parents just came back from a planet where the dominant lifeform had no bilateral symmetry, and all I got was this stupid F-Shirt." |
| |||
| On Thu, 03 Jul 2003 00:01:50 +0000, gh wrote: > I'm using slack-9.0. eject will eject my /dev/cdrom as root, but won't as > user. I get the error message eject: unable to open `/dev/cdrom'. My > /etc/fstab is: > > /dev/cdrom /mnt/cdrom iso9660 noauto,users,ro 0 0 .... and ... > > root :~# ls -l /dev/cd* > lrwxrwxrwx 1 root root 8 Jun 17 15:09 /dev/cdrom -> > /dev/hdc > root :~# ls -l /dev/hdc > brw-rw---- 1 root disk 22, 0 Jun 9 2002 /dev/hdc > > Any tips on how to get this working under user? Thanx for asking this question, I totaly didn't rember to change the owner to user! |
| |||
| Jim Bianchi wrote: > This one still bites me. No one should be 'in' /mnt/cdrom (even if > they're not doing anything there) in order to unmount it. The eject > script first unmounts the CD then ejects the tray. Ensure you've cd'd to > some other dir before invoking eject. No, that's not the problem. When I am still in the directory, the error message is that it won't umount. I'm able to exit the directory and umount as user, but eject still gives the error message. |
| |||
| On Fri, 04 Jul 2003 02:57:12 GMT, gh <ghwbush@earthlink.net> wrote: >Jim Bianchi wrote: >> This one still bites me. No one should be 'in' /mnt/cdrom (even if >> they're not doing anything there) in order to unmount it. The eject >> script first unmounts the CD then ejects the tray. Ensure you've cd'd to >> some other dir before invoking eject. > >No, that's not the problem. When I am still in the directory, the error >message is that it won't umount. I'm able to exit the directory and >umount as user, but eject still gives the error message. Hmmm, bummer. At this point, I'd recommend you have a look at the permissions for both /dev/cdrom and /dev/hdc <or whatever the mount point is>. /dev/cdrom is prob a symbolic link to /dev/hdc or whatever. They both want to have the same permissions. Just because the first has them won't get you much if the other doesn't. If you're root, of course, you can eject the CD tray. Oops, if the perms are wrong, you shouldn't be able to umount the device (I *think*). So maybe I'm all wet, it bears looking into anyway. There is likely a better way to do this, such as editing a file somewhere to add your username to some group that has eject perms, but I don't know it, sorry. Whoops, I just found out that eject isn't a script, it's a binary file. Here's the output: [garbanzo:/home/jimbo]$ /usr/bin/eject -h Eject version 2.0.2 by Jeff Tranter (tranter@pobox.com) Usage: eject -h -- display command usage and exit eject [-vnrsfq] [<name>] -- eject device eject [-vn] -d -- display default device eject [-vn] -a on|off|1|0 [<name>] -- turn auto-eject feature on or off eject [-vn] -c <slot> [<name>] -- switch discs on a CD-ROM changer eject [-vn] -t [<name>] -- close tray Options: -v -- enable verbose output -n -- don't eject, just show device found -r -- eject CD-ROM -s -- eject SCSI device -f -- eject floppy -q -- eject tape Long options: -h --help -v --verbose -d --default -a --auto -c --changerslot -t --trayclose -r --cdrom -s --scsi -f --floppy -q --tape -n --noop Parameter <name> can be a device file or a mount point. If omitted, name defaults to drom'. By default tries -r, -s, -f, and -q in order until success. I hope this is helpful. -- jimbo@sonic.net Eclectic Garbanzo BBS, (707) 539-1279 "My parents just came back from a planet where the dominant lifeform had no bilateral symmetry, and all I got was this stupid F-Shirt." |
| |||
| On 2003-07-04, Jim Bianchi <jimbo@sonic.net> wrote: > > At this point, I'd recommend you have a look at the > permissions for both /dev/cdrom and /dev/hdc <or whatever the mount point > is>. /dev/cdrom is prob a symbolic link to /dev/hdc or whatever. They both > want to have the same permissions. That's not possible when symbolic links have permissions like this. lrwxrwxrwx 1 root root 8 Aug 13 2002 /dev/cdrom -> /dev/hdc ^^^^^^^^^^ > There is likely a better way to do this, such as editing a file > somewhere to add your username to some group that has eject perms, but I > don't know it, sorry. Yes, you can add your name to the disk group in /etc/group (as was mentioned elsewhere in this thread). You can see that this is the group to be added to by doing a 'ls -l' on the device the /dev/cdrom link is pointing to. mark ~$ ls -l /dev/hdc brw-rw-rw- 1 root disk 22, 0 Jun 9 2002 /dev/hdc ^^^^ In 8.1, the permissions mean you don't have to be in the disk group, but as I understand it, the default permissions in 9.0 are brw-rw---- . > Whoops, I just found out that eject isn't a script, > it's a binary file. Here's the output: FWIW, I like to create an alias called 'insert', as typing that is a bit more intuitive that 'eject -t' alias insert='/usr/bin/eject -t' -- Mark Hill <mark_usenet@yahoo.co.uk> Not to worry, you're running Linux. -- Glenn Stone, Linux Journal |
| ||||
| Mark Hill wrote: > Yes, you can add your name to the disk group in /etc/group (as was > mentioned elsewhere in this thread). If you just want to eject the disk as a user this works, it also has the advantage that root can add specified users to the disk group, as opposed to 'users'. -- Two Ravens "...hit the squirrel..." |