How to Mount Dvd-Rw Drive/Create Mount Point

I just get ubuntu 12.10. So I am a newbie.

I have sata hard disc with partitions - sda 1 (swap) sda 2 (mount point /) and sda 3 (mount point /home).
Today I add another internal hard disc (not sata) which I plan to use only for data, and its mount point is /media/sdb1.

But after adding another HD ubuntu doesnt mount my dvd rw drive any more.
I get this error:

mount point media cdrom0 does not exist

I tried in terminal:

mount/cdrom

and get this:

mount: can't find /cdrom in etc/fstab or etc/mtab

What should I do?

3 Answers

I looked in /dev. A file there was called dvd. I entered ' ls -al /dev/dvd ' and it told me that this was a link to /dev/sr0. I inferred that from this response:

lrwxrwxrwx 1 root root 3 Apr 24 15:56 /dev/dvd -> sr0

The first 'l' means that it is a link, not a real file.

Then, I looked at /. There was a directory there called 'mnt', the usual node for subdirectories of mounted peripheral devices. It was empty.

I made a subdirectory of /mnt using:

sudo mkdir /mnt/cdrom

Then, I mounted sr0 there with:

sudo mount /dev/sr0 /mnt/cdrom

To see, I looked at it:

ls /mnt/cdrom

It came up with a lot of right-looking stuff, so I concluded success.

2

CD/DVD Drive Rule: Mount Drive Upon Insert to "/media/DVD"

Do this if you want to restore auto-mounting with some control over how it is done.

  • Auto-creates mount point upon insertion of medium
  • Auto-mounts medium to mount point with specific permissions
  • Auto-removes mount point upon removal of medium

Action: CD/DVD Tray has media and is pulled in

You have to tell your system to react this this action. You can have it run a mount script (any custom script). To do this, you need to create a new rule in the lib/udev/rules.d folder. These commands need to be run as root (use the prefix sudo for the following commands to run them as root or become the root user with sudo -s

  • Make a new file and call it autodvd.rules touch /lib/udev/rules.d
  • Look for info about your CD/DVD drive by running udevadm info --query=all --attribute-walk --name=/dev/sr0 (root not necessary here, but works both ways) Look for something that uniquely identifies your drive (for better or for worse I picked ATTRS{vendor}=="HL-DT-ST", which is my drive (yours will be different unless you happen to own the same drive as me). Copy it down somewhere for later. You can take some time to look over this file and compare it with the rule example below. The SUBSYSTEM and ATTRS can be found in it.
  • Edit your new rule (you can use whatever editor you choose, I use vim /lib/udev/rules.d, but nano /lib/udev/rules.d works too and is easy. Add these things, editing your ATTRS to match yours (this is the sensitive part, you might have to pick a different attribute if it doesn't work) and correct the YOURUSER and YOURGROUP fields:

KERNEL=="sr[0-9]*", SUBSYSTEM=="block", ATTRS{vendor}=="HL-DT-ST", SYMLINK+="dvdburner", OWNER="YOURUSER", GROUP="YOURGROUP" ACTION=="change",RUN+="/home/YOURUSER/Scripts/Bash/automountdvd.sh"

  • The KERNEL=="sr[0-9]*" just means it will test all scsi devices (sr0-sr9)
  • The SYMLINK is just a symbolic link to the drive (like /dev/cdrom is to the real /dev/sr0)

You may need to reload all of the udev rules:

udevadm control --reload rules
reload udev
udevadm trigger
Alexander Ross

Alexander Ross

Gaming, Esports & Interactive Media Writer

Alexander Ross has covered the video game industry for a decade, writing deep dives on game design, esports tournaments, VR developments, and gaming culture.