LinuxNetMag
Beginners Guide: mounten
List | Home
TOC
   
LinuxNetMag #3

  Software
 MP3
Xaudio, xmms, mp3blaster
freeztag, kmp3te
 Games
TTY-Quake, Quake3Test
Descent, LDescent, DX1
Flightsimulators
 Applications
Wine: Installation and Setup
VCron, Kcrontab
Passwords with Gpasman
 Misc.
Bootlogos: Welcome2L...
[email protected] and tools
Lightspeed
  
 

Network

Alternative Web-Browser
Linpopup
VNC - Windows X-Server
Fetchmail Part II
Apache the webserver
Windows networks: Samba
Webpublishing: Sitecopy
downloadhelp Wget
Webalizer
recommended links
  
 

Hardware

HD-/Floppy- Access
Jslaunch
  
 

Misc.

Editorial
Guestbook
Mailingliste
Complete list of articles



printer-version


 

Mounting
What do you have to do if you are a Linux beginner and want to access a CD?


The Frequently Asked Question:

I installed SuSE 6.0 and everything worked well. So far so good. Then I installed and configured the window-manager KDE and it started with startx. There is a file browser called kfm similar to Microsoft Explorer and it displays the directory "CD-ROM", but I cannot access it. It does not show anything. I have a Linux CD with Netscape and StarOffice on it. I would like to install these and I do not know how I get the data. I do not know the terminal commands very well and I have not read any book about Linux.
 
 

The answer

Linux does not have different letters for the drives. Linux integrates floppy, hard disk, CD-ROM ... (the common name for all of them is "devices") into the directory tree. You simply "plug" the device in a subdirectory. The default directory for mounting removable media devices is /mnt/. There you create the subdirectories for all devices (e.g. /mnt/zip for the zip-drive), /mnt/windows/ for the WINDOWS partition. For the CD-ROM the directory /cdrom is as common as /mnt/cdrom/. Any needed directories can be created with "mkdir".
To access the CD-ROM drive you have to register it in the system. This happens with the command mount. You have to use the console terminal to execute it - that is called with Xterm. KDE opens a new terminal with a click on the picture KDE-Term in the button-panel. First you have to create the directory where you want to mount the CD-ROM later. So you generate the directory /mnt/cdrom (maybe it has been already there).
You create it with:

>>  mkdir /mnt/cdrom

(has to be executed as root)
Now you mount the CD-ROM drive (do not forget to insert a CD) with:

>> mount /dev/hdc /mnt/cdrom

/dev/hdc is the device that has to be mounted. /dev/hdc is the ATAPI-device, if you have connected it to the second master slot (default). SCSI-CD-ROMs correspond to the device /dev/sr* .

The last letter determines where the device is connected to. Either a master or a slave-slot.

  • /dev/hda  -- Master at IDE 1
  • /dev/hdb  -- Slave at IDE 1
  • /dev/hdc  -- Master at IDE 2
  • /dev/hdd  -- Slave at IDE 2

If you did not know where the CD-ROM is connected you should try all possibilities and additionally, /dev/cdrom could work if this file existed (/dev/cdrom is a symbolic link to the corresponding device if this link was created during the installation.).
If everything functions well, the CD-ROM runs shortly and you do not get any messages. After being mounted, you will now find the file-tree of the CD in the directory /mnt/cdrom.

Graphical programs exist that can mount a CD with a mouse click (e.g. Tk-mount, xmount, wmmount...) but these have to be pre-configured and you have to know what happens in the background.

If everything is OK, you should add the CD-ROM device into the file /etc/fstab so every user can mount and un-mount the device and not just the root. You have to add the following entry into the /etc/fstab

/dev/hdc        /mnt/cdrom               iso9660         ro,noauto,user 0   0

This entry makes it possible to mount the CD with the shorter command:

>> mount /mnt/cdrom

If you want to change the CD you have to un-mount the device from the system or the CD-ROM slot will not open. To unmount the CD you have to type

>> umount /mnt/cdrom

 

 
print
Other issues of Linux NetMag
[ #1 | #2 | #3 | Main ]