4 Installation

Contents of this section

Installation of CD-ROM under Linux consists of these steps:

  1. Installing the hardware.
  2. Configuring and building the Linux kernel.
  3. Creating the necessary device files.
  4. Mounting the media.

4.1 Installing Hardware

Follow the manufacturer's instructions for installing the hardware or have your dealer perform the installation. The details will vary depending on whether the drive is internal or external and on the type of interface used. There are no special installation requirements for Linux. You may need to set jumpers on the drive and/or interface card for correct operation.

4.2 Configuring and Building the Kernel

In order to use a CD-ROM you need the appropriate device drivers. To mount most CD-ROM discs you also need the ISO-9660 file system support in the kernel. Follow your usual procedure for building the kernel: do a "make config" and select the appropriate drivers when prompted.

For SCSI CD-ROMs you need to answer "yes" to "SCSI support?", and then enable "Scsi CDROM support" and the driver for the appropriate SCSI interface (e.g. "Adaptec AHA1542 support").

For the proprietary interface drives, select "Sony CDU31A/CDU33A CDROM driver support", "Mitsumi CDROM driver support", or "Matsushita/Panasonic CDROM driver support", according to your drive type. The Matsushita driver also supports up to 4 controllers.

For other drive types you must obtain the driver separately and apply it as a kernel patch.

If you are using the Matsushita/Panasonic drive, you have the choice of letting the kernel auto-probe for the drive, passing it on the kernel command line, or explicitly setting it in the file /usr/src/linux/include/linux/sbpcd.h. It is recommended that you initially set it to auto-probe. Later you can set the type and save some time during bootup.

As of the 1.1.64 kernel, autoprobing for the CDU-31A drives has been removed. You now need to either add your drive to the configuration table in the driver or use a LILO boot-line configuration. The format of the LILO command line is:


cdu31a=<I/O address>,<interrupt>[,PAS]

Setting the interrupt to 0 will disable the interrupts and use polled I/O. The PAS option is for ProAudioSpectum16 sound card users that are not using the sound driver. A typical card would have a configuration like one of the following:


cdu31a=0x340,0
cdu31a=0x340,5

The easiest way to set this up is to add a line such as the following to your LILO configuration file:


append="cdu31a=0x1f88,0,PAS"

Again, remember to compile in the ISO-9660 file system support. The Rock Ridge extensions are fully supported by the kernel driver.

If you have a sound card that is supported under Linux, you should enable and configure the kernel sound driver at this time as well.

After selecting the device drivers, compile the kernel and install it following your usual procedure.

4.3 Creating the Device Files

If you are running a standard Linux distribution you may have created the necessary device files during installation. Under Slackware Linux, for example, there is a menu-based setup tool that includes CD-ROM setup, and most systems have a /dev/MAKEDEV script. It is recommended that you at least verify the device files against the information in this section.

Create the device file by running the shell commands indicated for your drive type. This should be done as user root. Note that some Linux distributions may use slightly different CD-ROM device names from those listed here.

It is recommended that you also create a symbolic link to the CD-ROM device to make it easier to remember. For example, for a Panasonic CD-ROM drive, the link would be created using


% ln -s /dev/sbpcd /dev/cdrom

If you want to play audio CDs, you will need to set the protection on the device files to allow users to read and write, e.g.


% chmod 666 /dev/sbpcd

Matsushita/Kotobuki/Panasonic/Creative Labs/IBM

Up to four drives per controller are supported. Only the first device is needed if you have only one drive. If you have more than one controller, create devices with major numbers 26, 27, and 28, up to a maximum of 4 controllers (this is 16 CD-ROM drives in total; hopefully enough for most users :-).


% mknod /dev/sbpcd  b 25 0
% mknod /dev/sbpcd0 b 25 0
% mknod /dev/sbpcd1 b 25 1
% mknod /dev/sbpcd2 b 25 2
% mknod /dev/sbpcd3 b 25 3

Sony CDU31A/CDU33A

Only one drive is supported by this kernel driver. See the comments in the file /usr/src/linux/drivers/block/cdu31a.c for information on configuring the interface card. As of the 1.1.60 kernel, the driver supports playing audio CDs and PhotoCD (but not multisession yet).


% mknod /dev/cdu31a b 15 0

See the kernel source file cdu31a.c for information on configuring the drive interface card. Also see the notes given previously about specifying the configuration on the LILO command line.

Sony CDU535/CDU531

Note again that the driver is currently only available as a kernel patch.


% mknod /dev/cdu535 b 24 0

Some Linux distributions use /dev/sonycd for this device. Older versions of the driver used major device number 21; make sure your device file is correct.

Mitsumi

The kernel supports one Mitsumi drive. Recent kernels (1.1.25) incorporate changes to improve performance.


% mknod /dev/mcd b 23 0

LMS/Philips

Note again that this driver is currently only available as a kernel patch. See the README file included with the patches for more information.


% mknod /dev/lmscd b 24 0

SCSI

Multiple drives are supported (up to the limit of the number of devices on the SCSI bus). Create device files with major number 11 and minor numbers starting at zero:


% mknod /dev/scd0 b 11 0
% mknod /dev/scd1 b 11 1

IDE Drives

Information on creating the devices files are included with the kernel patch for these drives.

4.4 Mounting/Unmounting/Ejecting Devices

You can now reboot with the new kernel. Watch for a message such as the following indicating that the CD-ROM has been found by the device driver (the message will vary depending on the drive type):


SBPCD version 2.5 Eberhard Moenkeberg <emoenke@gwdg.de>
SBPCD: Looking for a SoundBlaster/Matsushita CD-ROM drive
SBPCD: 
SBPCD: = = = = = = = = = = W A R N I N G = = = = = = = = = =
SBPCD: Auto-Probing can cause a hang (f.e. touching an ethernet card).
SBPCD: If that happens, you have to reboot and use the
SBPCD: LILO (kernel) command line feature like:
SBPCD: 
SBPCD:    LILO boot: linux sbpcd=0x230,SoundBlaster
SBPCD: or like:
SBPCD:    LILO boot: linux sbpcd=0x300,LaserMate
SBPCD: or like:
SBPCD:    LILO boot: linux sbpcd=0x330,SPEA
SBPCD: 
SBPCD: with your REAL address.
SBPCD: = = = = = = = = = = END of WARNING = = = = = = = = = =
SBPCD: 
SBPCD: Trying to detect a SoundBlaster CD-ROM drive at 0x230.
SBPCD: - Drive 0: CR-562-x (0.76)
SBPCD: 1 SoundBlaster CD-ROM drive(s) at 0x0230.
SBPCD: init done.

(If the bootup messages scroll by too quickly to read, you should be able to retrieve them with the dmesg command)

To mount a CD-ROM, insert a disc in the drive, and run the mount command as root (this assumes you created a symbolic link to your device file as recommended above):


% mount -t iso9660 -r /dev/cdrom /mnt

The CD can now be accessed under the directory /mnt. Note that /mnt is commonly used as a temporary mount point; a more suitable name for a permanent installation might be something like /cdrom. There are other options to the mount command that you may wish to use; see the mount(8) man page for details.

You can add an entry to /etc/fstab to automatically mount a CD-ROM when Linux boots or to specify parameters to use when it is mounted; see the fstab(5) man page.

Note that to play audio CDs you should not try to mount them.

To unmount a CD-ROM, use the umount command as root:


% umount /mnt

The disc can only be unmounted if no processes are currently accessing the drive (including having their default directory set to the mounted drive). You can then eject the disc. Most drives have an eject button; there is also a standalone eject program that allows ejecting CD-ROMs under software control.

Note that you should not eject a disc while it is mounted (this may or may not be possible depending on the type of drive). The sbpcd driver will automatically eject a CD-ROM when it is unmounted and insert the CD tray when a disc is mounted (you can turn this feature off when compiling the kernel or by using a software command).

4.5 Troubleshooting

If you still encounter problems, here are some things to check.

If you recompiled the kernel yourself, verify that you are running the new kernel by looking at the timestamp:


% uname -a
Linux fizzbin 1.1.31 #1 Wed Jul 20 16:53:35 EDT 1994 i386

With recent 1.1.x kernels, you can see what drivers are compiled in by looking at /proc/devices:


% cat /proc/devices
Character devices:
 1 mem
 4 tty
 5 cua
 6 lp
14 sound
15 Joystick

Block devices:
 2 fd
 3 hd
25 sbpcd

If your drive has hardware jumpers for addressing, check that they are set correctly (e.g. drive 0 if you have only one drive).

Try reading from the CD-ROM drive. Typing the following command should cause the drive activity light come on and no errors should be reported. Use whatever device file is appropriate for your drive and make sure a CD-ROM is inserted; use Control-C to exit.


dd if=/dev/cdrom of=/dev/null bs=2048
^C
124+0 records in
124+0 records out

If you can read from the drive but cannot mount it, verify that you compiled in ISO9660 file system support. With the 1.1.x kernels this can be done as follows:


% cat /proc/filesystems
        ext2
        msdos
nodev   proc
        iso9660

Make sure you are mounting the drive with the "-t iso9660" and "-r" options and that a known good CD-ROM (not Audio CD) is inserted in the drive.

Make sure that the CD-ROM device files are correct, according to the information in the previous section.

If you are running the syslog daemon, there may be error messages from the kernel that you are not seeing. Try using the "dmesg" command:


% dmesg
SBPCD: sbpcd_open: no disk in drive

There may also be errors logged to files in /var/adm, depending on how you system is configured.

Next Chapter, Previous Chapter

Table of contents of this chapter, General table of contents

Top of the document, Beginning of this Chapter