This can be confusing, especially because it depends on whether or not you are using UDEV.
If you are using a 2.4.x kernel, you will do what MMYoung suggested, though there is one important clarification needed. Let's just deal with one drive first. For the other, you will just repeat (changing the relevant parts).
SO, I have a CD-ROM and it is recognized as /dev/hdc. First, I decide where I want to mount that CD-ROM. I'll choose /mnt/cdrom. Create that if it doesn't already exist:
Now, create the symlink:
Code:
ln -s /dev/hdc /dev/cdrom
Now, edit /etc/fstab to look like this:
Code:
/dev/cdrom /mnt/cdrom iso9660 noauto,user,ro 0 0
Let's look at that line for a moment. We see that I used "iso9660" where MMYoung used "auto". The optical device will be using iso9660, so that is a valid choice. MMYoung's use of auto works equally well, though. It is a matter of preference. It's early, and I'm having trouble remembering if some DVDs use a different filesystem, so maybe auto is actually the better choice.
Next thing to note is that I have used "user". You can replace that with "users" if you like. I actually prefer "users". The difference is this: If you are using "user" and user A mounts the device, only user A (or root) can umount the device. If user A left for the day, you may have issues. If you are using "users", then a device mounted by user A can be umounted by anyone.
The most important thing to note, though, is that you haven't dealt with permissions yet. People get confused. /etc/fstab gives the user permission to mount the device. Your user still needds permission to work with the device. Also important is that permissions on symlinks don't really count:
Code:
shilo@shilo2:~$ ls -l /dev/cdrom
lrwxrwxrwx 1 root root 3 2006-01-11 08:25 /dev/cdrom -> hdc
See, the permissions look to be wide open. But the "l" indicates that this is a symbolic link, therefore the permissions of the actual device are what is used.
I don't have a stock setup, but I believe that you will find, /dev/hdc comes with permissions/ownership such that all that is needed is to add the user to the "cdrom" group. This should be sufficient. Alternatively, you can use a combination of chmod and chown to give the premissions and ownership to /dev/hdc. I think it's much easier to add the user to the "cdrom" group, though.
If you don't know how to add the user to the "cdrom" group, all you have to do is edit /etc/group, adding the user name after cdrom, like this:
Code:
cdrom::19:shilo,lori,joe,casey
Now, if you are running a 2.4.x kernel, you should be all set (reboot for good luck, later, learn to do it without rebooting).
If you are running a 2.6.x kernel, things may be different. It will depend on if you are running UDEV. If you are running UDEV, creating symlinks manually (as described above) will drive you CRAZY if you don't know that /dev gets re-created every time you boot. That means your symli9nks get lost.
PV has a little bit of code that is supposed to take care of symlinks in /etc/udev/rules/make_extra_nodes.sh that looks like:
Code:
# If we can, add a default /dev/cdrom and /dev/dvd link:
#cd_num=0
#dvd_num=0
#if /bin/ls -l /dev | grep -wq cdrom ; then
# ( cd $udev_root
# /bin/ls -l * | grep -w cdrom | cut -f 2 -d : | cut -f 2 -d ' ' | while read optical_device ; do
# # It has to be a cdrom. Assign consecutive numbers to drives.
# if [ "$cd_num" = "0" ]; then
# ln -sf $optical_device cdrom
# ln -sf $optical_device cdrom0
# else
# ln -sf $optical_device cdrom${cd_num}
# fi
# cd_num=$(($cd_num + 1))
# # If it's a DVD, set that link as well:
# if grep -iq dvd /proc/ide/$optical_device/model ; then
# if [ "$dvd_num" = "0" ]; then
# ln -sf $optical_device dvd
# ln -sf $optical_device dvd0
# else
# ln -sf $optical_device dvd${dvd_num}
# fi
# dvd_num=$(($dvd_num + 1))
# fi
# done
# unset optical_device
# )
#fi
#unset cd_num
#unset dvd_num
Noite that mine is all commented out. That's because I don't like it. It may work well for you, in which case, leave it alone. If it doesn't work well for you, comment it out (like I did). You will then need to create a file called /etc/udev/rules.d/local.rules with something like:
Code:
KERNEL="hdc", SYMLINK="dvd dvdrw cdroms/dvdrw cdroms/cdrom0"
KERNEL="hdd", SYMLINK="cdrom dvdrom cdroms/dvdrom cdroms/cdrom1"
Either way should work.