Installation

# 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.

## 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.

For the Sony CDU535 and CDU531 drives 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.

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 confgure 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 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

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.

> `

>     % mknod /dev/cdu31a b 15 0

> `

### 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

Up to two drives are supported, corresponding to the first two CD-ROM devices found by the kernel.

> `

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

> `

## 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. 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 (starting with the 1.1.38 kernel).

## 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

> `

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 is inserted in the drive.

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