# Can't open /dev/cdroms/cdrom0 for reading

## nouse66

i'm getting the error :

```

Can't open /dev/cdroms/cdrom0 for reading

```

whenever i try to access an unmounted dvd (for a rip using dvdbackup or for playing via gmplayer).  i was able to rip a dvd using lxdvdrip a couple days ago and then for some reason as of yesterday i have no access to the device and have no idea what changed.  i can, however, still mount the drive and access a cd or dvd that way.  

anyone know what could cause this?

----------

## jmbsvicetto

Hi.

You need to find out to what device the /dev/cdroms/cdrom0 link points to. Then do

```
# ls -l /dev/cdroms/cdrom0

# ls -lL /dev/cdroms/cdrom0
```

Check the permissions of the devices. You should have something as

```
atlantida ooo # ls -lL /dev/cdroms/cdrom0

brw-rw----  1 root cdrom 22, 0 Jul  1 01:24 /dev/cdroms/cdrom0

atlantida ooo # 
```

Make sure that your user is part of the group that owns the device.

Does this help?

----------

## nouse66

yep, that was the problem.  my groups got changed somehow.  i had an empty cdrom group sitting there in /etc/group so i just added root and my username to it and all is well.

thanks!

----------

## lotw

 *nouse66 wrote:*   

> yep, that was the problem.  my groups got changed somehow.  i had an empty cdrom group sitting there in /etc/group so i just added root and my username to it and all is well.
> 
> thanks!

 

Editing the fstab would have been the better way to do that.  The line should read like this:

```
/dev/cdroms/cdrom0   /mnt/cdrom   auto      noauto,users,exec,ro   0 0
```

That way it automatically picks the correct filesystem and allows users to access.

----------

## nouse66

how is it better to use the 'users' group instead of the 'cdrom' group?

----------

## lotw

 *nouse66 wrote:*   

> how is it better to use the 'users' group instead of the 'cdrom' group?

 

Well both work fine, but if you create another user you may forget to add them to the cdrom group, user group is automatic.

----------

## nouse66

yeah that makes sense.  

looking at your fstab line though:

 *Quote:*   

> 
> 
> /dev/cdroms/cdrom0   /mnt/cdrom   auto      noauto,users,exec,ro   0 0
> 
> 

 

i've never seen a group name put in the options like that.  doesnt the "user" option enable everyone to mount the device and gid=xxx set the group ownership?

----------

## lotw

 *nouse66 wrote:*   

> yeah that makes sense.  
> 
> looking at your fstab line though:
> 
>  *Quote:*   
> ...

 

The group name in there allows all people in the user group to mount that device.  I also use that same option for one of my USB pen drives, except with the ,ro not there (that makes it a read only mount).

----------

## jmbsvicetto

 *lotw wrote:*   

>  *nouse66 wrote:*   yep, that was the problem.  my groups got changed somehow.  i had an empty cdrom group sitting there in /etc/group so i just added root and my username to it and all is well.
> 
> thanks! 
> 
> Editing the fstab would have been the better way to do that.  The line should read like this:
> ...

 

Actually, you're wrong.

You're confusing the /etc/fstab option users, with the group users. The option users means that you want your users to be able to mount and unmount the disks. With the option user, you're limiting the user that mounted the disk to being able to unmount it. With the option users, any user regardless if he/she mounted the disk can unmount it. All this has nothing to do with the group the user belongs to. If you create an user that is not a member of users, he/she will still be able to mount/unmount the disk if you set users in /etc/fstab.

The options user and users in /etc/fstab where created, because if you don't use them, only root will be able to mount and unmount the disks. That would mean that in order to use a floppy, a cd or an usb stick, you would have to be or become root.

Does this make sense?

----------

## Kenji Miyamoto

If you want something to be accessible by anyone, use the `umask=0000` option in fstab.

----------

