Auto-mount CD/DVD drive to single, specific mount point every time?

9,615

Solution 1

If you have one cdrom drive, add this line to your /etc/fstab:

/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0

Make sure you edit it as root. Ie: gksudo gedit /etc/fstab or sudo nano /etc/fstab.

The Ubuntu documentation has a really good article on this.

Solution 2

This problem occured to me when I upgraded Ubuntu from 10.04 to 12.04. Using Disk Utility I discovered that now the CD Drive is a device /dev/sr0, so I changed the line in /etc/fstab file which was earlier /dev/scd0 to /dev/sr0 and it worked for me.

PV

Share:
9,615

Related videos on Youtube

Christopher Parker
Author by

Christopher Parker

Updated on September 17, 2022

Comments

  • Christopher Parker
    Christopher Parker over 1 year

    Currently, whenever I insert a CD or DVD into my DVD drive, it mounts to a location such as /media/<LABEL>, where <LABEL> is the arbitrary label assigned to the optical disc.

    I remember, once upon a time, CD and DVD media being reliably located at /media/cdrom0 or something similar. Why was this changed? And how do I get this old behavior back for this drive?

    I can understand this behavior for USB sticks. It makes sense for those. But not for CD/DVD media, in my opinion. For example, because of this, I have no way to configure Wine to point to my DVD drive, as the mount point changes with every single CD I insert.

    TL;DR: How do I make CD/DVD media always mount to /media/cdrom0?

  • Christopher Parker
    Christopher Parker about 13 years
    I tried this, but I got this error: Error mounting: mount exited with exit code 1: helper failed with: mount: mount point /media/cdrom0 does not exist. After creating /media/cdrom0 (using sudo), then it works, sort of. However, there's a problem. When GNOME auto-mounts the drive, my UID is set as the owner. This way, some random UID is the owner and I'm unable to read any of the files on the CD/DVD now. GNOME isn't currently relying on fstab, so I was hoping for a solution that uses GNOME's current way of handling auto-mounting so I can access the files without needing (gk)sudo.
  • djeikyb
    djeikyb about 13 years
    Does it work if you change the line to: /dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8,umask=0222 0 0?
  • Christopher Parker
    Christopher Parker about 13 years
    It doesn't change much... Before the umask addition: -rwx------ 1 503 dialout 2217232 2009-10-12 19:55 Installer.exe After the umask addition: -r-x------ 1 503 dialout 2217232 2009-10-12 19:55 Installer.exe
  • desgua
    desgua about 12 years
    You can try to change the ownership of /media/cdrom0 run something like sudo chown [your user name]:[your user name] /media/cdrom0