CD-ROM Troubleshooting


CD-ROM Troubleshooting

You need a CD-ROM drive that works under Linux to install Red Hat Linux from this book's companion CD-ROM. The initial Linux kernel comes with CD-ROM driver modules for all supported CD-ROM drives; therefore, you should not have any problem as long as Linux supports your CD-ROM. Remember that the CD-ROM drive's interface is what counts, not the brand name. For example, any CD-ROM drive with the IDE interface works under Linux, because Linux supports the IDE interface.

If Linux does not seem to recognize the CD-ROM drive after you reboot the system, try the following steps to fix the problem:

  1. If Linux has not loaded the CD-ROM driver module, you can manually load the driver by logging in as root and typing the command modprobe cdrom. Then check if the CD-ROM drive works by typing eject /dev/cdrom-the CD-ROM drive door should open if it's working. You can then try to mount a CD-ROM.

  2. If you have rebuilt the kernel with support for your CD-ROM drive, verify that you are indeed running the new kernel. To see the version number, type the uname -srv (or uname -a) command. This output from the uname command shows the kernel's version number, as well as the date on which the kernel was built. If that date does not match the date on which you rebuilt the kernel, you may not be running the new kernel. Go through the steps outlined in Chapter 21, and make sure you have really installed the new kernel. One common problem is forgetting to reboot, so try that as well.

  3. Look at the contents of the /proc/devices file to verify that the CD-ROM device is present. Use the following procedure to view the contents of a /proc/devices file:

    cat /proc/devices | more
    Character devices:
      1 mem
      2 pty
      3 ttyp
      4 ttyS
      5 cua
      6 lp
      7 vcs
     10 misc
     13 input
    29 fb
     36 netlink
    ... lines deleted ...
    Block devices:
      1 ramdisk
      2 fd
      3 ide0
      9 md
     12 unnamed
     14 unnamed
     22 ide1
     38 unnamed
     39 unnamed

    This listing corresponds to the devices on one of my Red Hat Linux PCs. It shows two lists of devices-character devices, such as serial ports that transfer data one or more characters at a time, and block devices, such as hard disks that transfer data in fixed-size blocks. You should look for the CD-ROM device in the list of block devices. I know my CD-ROM drive is connected to the secondary IDE interface. The two IDE interfaces correspond to the devices ide0 and ide1 in /proc/devices. Because ide1 appears in the listing, I know that the CD-ROM driver is in the kernel.

    If you have a CD-ROM connected to a Sound Blaster Pro or compatible interface, look for a device number of 25 and the device name sbpcd.

    If you don't see a device that corresponds to your CD-ROM drive, you have not configured the kernel properly to include the CD-ROM driver. Reconfigure and rebuild the kernel, making sure that you include support for your CD-ROM drive.

    For some SCSI CD-ROM drives, you have to specify the SCSI adapter as a boot option before the Linux kernel can access the CD-ROM drive.

  4. Verify that the CD-ROM driver detected the CD-ROM drive when the system started. Type the dmesg | more command to look at the boot messages and to see whether a line reports that the CD-ROM drive has been found. On my system, which has an ATAPI CD-ROM drive, the message looks like this:

    hdc: SAMSUNG CD-ROM SN-124, ATAPI CD/DVD-ROM drive

    If you find no boot message about the CD-ROM drive, make sure that the CD-ROM is physically installed. For an external CD-ROM drive, make sure that the drive is powered on and the cables are connected. Check any drive ID or jumpers, and make sure that they are set correctly. You may want to first make sure that the CD-ROM drive works under DOS; if you see the CD-ROM work under DOS, you can be sure that the drive is physically sound. Next, verify that you have rebuilt the kernel with support for the correct CD-ROM-drive interface.

  5. Verify that you can read from the CD-ROM drive. Try the following command, and see whether the drive's activity light comes on (it should) and whether any error messages are present (they shouldn't be):

    dd bs=1024 count=5000 < /dev/cdrom > /dev/null
    5000+0 records in
    5000+0 records out
    

    The /dev/null device is what you might call the bit bucket. Output directed to /dev/null simply vanishes.

    If the dd command does not work, the device file for the CD-ROM device may not be set properly. Type the ls -l /dev/cdrom command to view detailed information about your CD-ROM device. The Red Hat Linux installation program sets up /dev/cdrom as a symbolic link to the actual CD-ROM device. For an ATAPI CD-ROM drive on the secondary IDE interface, for example, I look at the /dev/cdrom symbolic link to make sure that it points to the real CD-ROM device (/dev/hdc in this case), as follows:

    ls -l /dev/cdrom
    lrwxrwxrwx   1 root   root    3 Feb 17 13:49 /dev/cdrom -> hdc
  6. Verify that you can mount the CD-ROM. Place a good CD-ROM (such as the CD-ROM from this book) in the CD-ROM drive, and try to mount it by using the following command:

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

    The -t iso9660 option specifies that the CD-ROM has an ISO-9660 file system, and the -r option says you want to mount the file system as read-only.

    If you can read from the CD-ROM drive with the dd command but cannot mount the CD-ROM, you may have configured the kernel without support for the ISO-9660 file system. To verify the currently supported file systems, use the following command:

    cat /proc/filesystems

    If you do not see iso9660 listed in the output, you have to rebuild the kernel and add support for the ISO-9660 file system.

  7. If nothing works, you may want to read the latest CDROM-HOWTO document. To read the HOWTO documents, point your Web browser to http://www.ibiblio.org/pub/Linux/docs/HOWTO/CDROM-HOWTO (your Red Hat Linux system must be connected to the Internet for this to work).

    Cross Ref 

    If you still cannot get the CD-ROM drive to work under Linux, you may want to post a news item to one of the comp.os.linux newsgroups. Chapter 16 describes how to post to newsgroups.

The following sections suggest solutions for a few more common problems.

Kernel Configuration for Specific CD-ROM Drives

If you are rebuilding the kernel and you have an ATAPI CD-ROM drive, you should answer yes to the following questions as you configure the kernel (see Chapter 21 for more on configuring the kernel):

Enhanced IDE/MFM/RLL disk/cdrom/tape/floppy support (CONFIG_BLK_DEV_IDE) [Y/m/n/?] y
   Include IDE/ATAPI CDROM support (CONFIG_BLK_DEV_IDECD) [Y/m/n/?] y

The possible responses are shown in brackets: y means yes (that means include support in the kernel); m means use a driver module, and n means no.

For SCSI CD-ROM drives, answer yes to the following questions:

*
* SCSI support
*
SCSI support (CONFIG_SCSI) [Y/m/n/?] y
*
* SCSI support type (disk, tape, CD-ROM)
*
SCSI CD-ROM support (CONFIG_BLK_DEV_SR) [Y/m/n/?] y

Of course, you must specify your SCSI controller type; otherwise, the SCSI CD-ROM won't work. If you have an Adaptec AHA1542 SCSI controller, for example, answer yes to the following question:

Adaptec AHA1542 support (CONFIG_SCSI_AHA1542) [M/n/y/?] y

If your CD-ROM drive has a proprietary interface, you must enable support for that specific CD-ROM drive interface. Start by answering yes to the following question during kernel configuration:

*
* Old CD-ROM drivers (not SCSI, not IDE)
*
Support non-SCSI/IDE/ATAPI CDROM drives (CONFIG_CD_NO_IDESCSI) [Y/n/?] y

After that, answer yes to the question about the specific CD-ROM drive in your PC. If you have a Mitsumi CD-ROM drive (with a proprietary interface, not ATAPI), for example, answer yes to the line that starts with Mitsumi (standard).

Newer versions of the Linux kernel may support other types of proprietary CD-ROM-drive interfaces. Check the prompts carefully before answering the questions the kernel-configuration program has posted.

Because most CD-ROMs use the ISO-9660 file system, you must enable support for this file system in the kernel. To do this, answer yes to the following question during kernel configuration:

ISO 9660 CDROM filesystem support (CONFIG_ISO9660_FS) [Y/m/n/?] y

IDE (ATAPI) CD-ROM Troubles

When a PC has an ATAPI CD-ROM drive, its ATA (IDE) adapter has two interfaces, primary and secondary, each of which is capable of supporting two drives. In Linux, the two primary devices are /dev/hda and /dev/hdb, typically used for hard-disk drives. The secondary IDE devices are /dev/hdc and /dev/hdd. Thus, if you have an IDE hard drive connected to the primary interface and an IDE CD-ROM drive connected to the secondary interface, the hard drive will be /dev/hda and the CD-ROM drive will be /dev/hdc.

Insider Insight 

Often, of the two devices on an IDE interface, one is designated the master and the other the slave. When only one IDE device is attached to an interface, it must be designated the master (or single). Typically, the IDE device has a jumper (a connector that connects a pair of pins) to indicate whether the device is a master or a slave.

If Linux refuses to recognize your IDE CD-ROM drive, however, you should check the CD-ROM drive's parameters, making sure the drive uses the secondary IDE interface (IRQ 15 and I/O address 170H) and is set to be the master.

Some interface cards support more than two IDE interfaces. In such a case, you should know that the Linux IDE CD-ROM driver might not recognize anything but the primary and secondary IDE interfaces. The Creative Labs Sound Blaster 16 CD-ROM interface is, by default, set to be the fourth IDE interface. If you are connecting a CD-ROM drive to a Sound Blaster 16 for use in Linux, you have to set the jumpers on the Sound Blaster 16 so that the IDE interface is the secondary interface instead of the fourth interface.

Boot-Time Parameters for CD-ROM Drives

Usually, Linux drivers find CD-ROM drives (and other peripherals) by probing-reading from and writing to various I/O addresses. Linux drivers also use any available information from the PC's CMOS memory. CMOS stands for complementary metal-oxide semiconductor-a type of semiconductor. Each PC has a small amount of battery-backed, nonvolatile CMOS storage, where vital pieces of information about the PC, such as the number of types of disk drives, are stored. The real-time clock is also stored in the CMOS.

One problem with probing is that it involves reading from or writing to specific I/O addresses. Depending on what device uses that I/O address, probing can cause the system to hang (become unresponsive). When the Sound Blaster Pro CD driver, sbpcd, probes for a CD-ROM drive, it may access an I/O address used in an NE2000 Ethernet card; if this happens, the system hangs.

To avoid probing at boot time, you can pass specific device parameters for the device corresponding to your CD-ROM drive.

If you have a CD-ROM drive with the Sound Blaster Pro CD interface, the device name is sbpcd, and you can provide settings at boot loader's prompt as follows:

sbpcd=0x230,SoundBlaster

This command tells the sbpcd driver that the I/O address of the CD-ROM drive is 230H. The exact boot-time parameters for a device depend on that device driver.

If you use LILO, you can put the boot-time parameters in the /etc/lilo.conf file with the following command:

append = "sbpcd=0x230,SoundBlaster"

If you use GRUB, you can add options such as sbpcd=0x230,SoundBlaster to the kernel line in the /etc/grub.conf file.