So, for example, you might mount a CD at the mount point /cdrom. This means that if you look in the directory /cdrom, you’ll see the contents of the CD. The /cdrom directory itself is actually on your hard disk. For all practical purposes, the contents of the CD become a part of the root filesystem, and when you type commands and use programs, it doesn’t make any difference what the actual physical location of the files is. You could have created a directory on your hard disk called /cdrom and put some files in it, and everything would behave in exactly the same way. Once you mount a filesystem, there’s no need to pay any attention to physical devices.

However, before you can mount a filesystem or actually create a filesystem on a disk that doesn’t have one yet, it’s necessary to refer to the devices themselves. All devices have names, which are located in the /dev directory. If you type ls /dev now, you’ll see a pretty lengthy list of every possible device you could have on your Debian system. For a summary of some devices, see Table 2.1 on page [*]. A more thorough list can be found on your system in the file /usr/src/linux/Documentation/devices.txt.

To mount a filesystem, we want to tell Linux to associate whatever filesystem it finds on a particular device with a particular mount point. In the process, we might have to tell Linux what kind of filesystem to look for.

10.2.2 Example: Mounting a CD-ROM

As a simple demonstration, we’ll go through mounting a CD-ROM, such as the one you may have used to install Debian. You’ll need to be root to do this, so be careful; whenever you’re root, you have the power to manipulate the whole system, not just your own files. Also, these commands assume there’s a CD in your drive; you should put one in the drive now. Then start with the following command:

su

If you haven’t already, you need to either log in as root or gain root privileges with the su (super user) command. If you use su, enter the root password when prompted.

ls /cdrom

Use this command to see what’s in the /cdrom directory before you start. If you don’t have a /cdrom directory, you may have to make one using mkdir /cdrom.

mount