[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: /dev/cdrom is not a valid block device



Hi, Stephen.


On Mon, Jan 05, 2004 at 04:51:06AM +0800, Stephen Liu wrote:
> $ eject /mnt/cdrom  or
> $ eject /mnt/cdwriter
> did not work.

Ejecting the device is done by ioctl(2)-ing the device, i.e. writing to
it:

| (#:/usr/src/linux-2.4.23)- sudo -u toor eject
| eject: unable to find or open device for: `cdrom'

--where `toor' is an unprivileged user.

You must have a write access to the device to accomplish this.  The
Debian way is, as was already pointed out by David Goodenough:

> > > Add yourself to the cdrecording group, (or whichever group /dev/hdc is
> > > owned by).

-- You didn't do your homework, did you :-(

If you are worried by the problems of the group-driven security, create a
new group for the /dev/cdrom device, or use sudo.  If the limitations of
the Unix security model are unbearable,  you might consider using kernel
patches allowing more fine-grained security control, e.g. RSBAC.  Maybe
the new security framework of the 2.6 line will do something for you,
too.

In my case, for example, all the cdrom drives are owned by root.cdrom
% ls -l /dev | grep cdrom | grep hdc
lrwxrwxrwx    1 root     root            3 Dec 10 03:45 cdrom -> hdc
brw-rw----    1 root     cdrom     22,   0 Mar 14  2002 hdc
% grep cdrom /etc/group
cdrom:x:24:jan

The `user' or `users' option in /etc/fstab will allow the user to
_mount_ the _filesystem_, not read/write the raw device.  man mount for
details.

Please make sure to understand the advises before reporting further
problems the next time :-(

HTH.

-- 
Jan Minar                   "Please don't CC me, I'm subscribed." x 7

Attachment: pgp202ZMra9uc.pgp
Description: PGP signature


Reply to: