The command you have
Also, could someone explain what mounting is and how to do it? I tried using a command I got from slackware.org:
mount -t iso9660 -o ro /dev/cdrom /cdrom
That's how you'd mount a cd. text book answer by the way, and everyone has said it, you are just missing the mount point, here we go on a break down:
mount = this is the command, you are saying "mount this stuff"
-t = this is an option, if you type 'mount -help or mount --help you can find out more options, -t means (the first paragraph from the man mount page):
The argument following the -t is used to indicate
the file system type. The file system types which
are currently supported are: adfs, affs, autofs,
coda, coherent, cramfs, devpts, efs, ext, ext2,
ext3, hfs, hpfs, iso9660, jfs, minix, msdos, ncpfs,
nfs, ntfs, proc, qnx4, reiserfs, romfs, smbfs,
sysv, tmpfs, udf, ufs, umsdos, vfat, xenix, xfs,
xiafs. Note that coherent, sysv and xenix are
equivalent and that xenix and coherent will be
removed at some point in the future -- use sysv
instead. Since kernel version 2.1.21 the types ext
and xiafs do not exist anymore.
iso9660 = this is the filesystem you are telling mount to use, this is needed for linux to be able to read the disc. Most cd's are written using this filesystem. If you want to know more: man mount or man fstab
-o = this means you are going to specify more options for the mount command.
ro = this is the option you specified (which is really not necessary) and means 'read-only' for the filesystem being mounted. Now you cannot accidently write to that cd (even though you can't anway on this type of device AFAIK)
/dev/cdrom = this is the device you are mounting. It is most likely a link (symlink) to the actual device, but most distro's make these links for you to help make things a little easier. Your actual device is probably one of these:
And this is determined by:
/dev/hda = Primary master
/dev/hdb = Primary Slave
/dev/hdc = Secondary Master
/dev/hdd = Secondary Slave
Then the symlink to whatever the actual device is created to /dev/cdrom so when you type:
eject /dev/cdrom or whatever it will link you to the actual device and run the function.
/cdrom = this is your mount point. It's basically an (usually) empty directory. You can mount your device(s) anywhere you'd like (with the exception of your root partition which (pretty much) has to be mounted at /
From there though, you can mount wherever you want. You just have to make the directory. So just for fun, let's say you wanted to mount your cdrom at:
Then you'd first need to make those directories with:
mkdir -p /home/cd/devices/first/cdrom/device
Then you can specify that in your mount command:
mount -t iso9660 /dev/cdrom /home/cd/devices/first/cdrom/device
But of course this is not normally the place to mount it. Normally it's either:
So you'd first check if you have either of those directories with:
ls -l /
ls -l /mnt
If either one (or both) already exist, you can mount em there (which is normal) with:
mount -t iso9660 /dev/cdrom /mnt/cdrom
mount -t iso9660 /dev/cdrom /cdrom
The other really nice thing is, if you have an entry in your /etc/fstab file for this device (which you probably do) then you can mount things alot easier by just specifying the mount and mount point matching fstab. SO let's say your entry looked like this:
/dev/cdrom /mnt/cdrom iso9660 default 0 0
Then you could mount your cdrom with:
And it would mount that device at that mount point. Now, you will probably want to allow your users to mount cdrom's and to do that you'll need to change that default line to something else. Here's what I have, you can put whatever you'd like, for options see man mount:
/dev/cdrom /mnt/cdrom iso9660 noauto,users,owner,ro 0 0
What this does is allow my users to mount, but doesn't try to automount this drive during boot time.
I hope this helps, and explains a bit more than you probably wanted, but helps for other similar situations (like mounting hard drives and such).