Auto-mount CD/DVD drive to single, specific mount point every time?
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
Related videos on Youtube
Christopher Parker
Updated on September 17, 2022Comments
-
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 about 13 yearsAnother instance of this issue: lists.fedoraproject.org/pipermail/users/2011-January/… (replies begin at lists.fedoraproject.org/pipermail/users/2011-January/…)
-
user2381205 over 12 yearsSame issue here. To no avail.
-
-
Christopher Parker about 13 yearsI 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
(usingsudo
), 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 about 13 yearsDoes it work if you change the line to:
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8,umask=0222 0 0
? -
Christopher Parker about 13 yearsIt 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 about 12 yearsYou can try to change the ownership of
/media/cdrom0
run something likesudo chown [your user name]:[your user name] /media/cdrom0