6 Answers to Frequently Asked Questions

Contents of this section

6.1 How can a non-root user mount and unmount discs?

Some mount commands support the user option. If you make an entry such as the following in /etc/fstab:


/dev/sbpcd  /cdrom   iso9660     user,noauto,ro

then an ordinary user will be allowed to mount and unmount the drive using these commands:


% mount /cdrom
% umount /cdrom

The disc will be mounted with some options that ensure security (e.g. programs cannot executed, device files are ignored); in some cases this may be too restrictive.

Another method is to get the usermount package which allows non-root users to mount and unmount removable devices such as floppies and CD-ROMs, but restricts access to other devices (such as hard disk partitions). It is available on major archive sites.

The archive site ftp.cdrom.com has the source file mount.c which allows mounting an unmounting of CD-ROMs (only) by normal users. It runs as a setuid executable.

6.2 Why do I get device is busy when unmounting a CD-ROM?

The disc cannot be unmounted if any processes are accessing the drive, including having their default directory set to the mounted filesystem. If you cannot identify the processes using the disc, you can use the fuser command, as shown in the following example.


% umount /cdrom
umount: /dev/sbpcd: device is busy
% fuser -v /cdrom
/cdrom:               USER       PID ACCESS COMMAND
                      tranter     50 ..c..  bash

6.3 How do I export a CD-ROM to other hosts over NFS?

You need to add an entry to the /etc/exports file; see the exports(5) man page for details.

6.4 Can I boot Linux from a CD-ROM?

The easiest way to boot from CD-ROM is to use a boot floppy. Several of the Linux CD-ROM distributions (e.g. Yggdrasil) include one, or you can use the boot disk(s) from one of the Linux distributions (e.g. Slackware) that includes the necessary CD-ROM drivers for your system.

6.5 Why doesn't the kernel recognize my CD-ROM drive?

If you have a proprietary interface at a non-standard address, you may need to set the i/o port location in the appropriate kernel header file. Similarly, auto-probing by the kernel driver may conflict with another device (e.g. network card) and cause your system to hang.

For the Matsushita/Kotubuki/Panasonic/Creative Labs drives, you need to edit the file sbpcd.h. For the Mitsumi drives it is mcd.h and for Sony drives it is cdu31a.h. All of these files are normally installed in /usr/include/linux.

6.6 How can I read digital data from audio CDs?

Only a few CD-ROM drives support this. Heiko Eissfeldt (heiko@colossus.escape.de) and Olaf Kindel have written a utility that reads audio data and saves it as .wav format sound files. It only works with the Toshiba XM3401 and XM4101 SCSI drives. The package is called cdda2wav.tar.gz and can be found on sunsite.unc.edu.

The Panasonic SBPCD driver also has support for reading sound data beginning with the 2.0 driver included in the 1.1.22 kernel. A modified version of the cdda2wav program that works with this can be found at ftp.gwdg.de in /pub/linux/misc/cdda2wav-sbpcd.2.tar.gz (a newer version may be available by the time you read this).

At time of writing there was a new driver for the Mitsumi drives in alpha test that supported reading audio tracks.

For more information on this subject, see the alt.cd-rom FAQ listed in the references section.

6.7 How do I turn off the autoprobing messages on boot?

The SBPCD driver displays a lot of information during bootup. If you want to suppress this, set the variable sbpcd_debug in the file sbpcd.c. The comments in the file explain the various values that this can be set to.

6.8 Why doesn't the find command work properly?

On ISO-9660 formatted discs without the Rock Ridge Extensions, you need to add the -noleaf option to the find command.

The reason for this is that the number of links for each directory file is not easily obtainable, so it is set to 2. The default behavior for the find program is to look for (i_links - 2) subdirectories in each directory, and it then assumes that the rest are regular files. The -noleaf switch disables this optimization.

6.9 Is the Reveal Multimedia Effects kit CD-ROM supported?

(the following was provided by Horne@leader.pfc.mit.edu)

Here's what I discovered about the Reveal Multimedia kits that are available fairly cheap ($300 or so) from department stores. After some thrashing I discovered how to make the following CD work under linux.

This is a Reveal Multimedia FX kit, which includes a Sound FX SC400 sound card, which has interfaces for Sony CDU33A, Panasonic CR-563, and Mitsumi LU005s. My kit includes a Sony.

The tricks to making the Sony CD work are as follows:

I'm still working on the actual sound support (I don't really need it yet) but that should be much easier.

Thanks to Reveal tech support for the info that the CD interface is at 0x414 off of the soundcard base address, Roman at Trans-Ameritech (roman@btr.btr.com) who suggested patching the CDU31A driver, and Dale Elrod (dale@post.dungeon.com) who provided an existence proof (Dale, your zImage didn't recognize the drive - I expect you actually have slightly different hardware. I'd have returned this thing a week ago, though, if I hadn't thought you had it working.)

The original driver is due to minyard@wf-rch.cirr.com, and Linus made it all possible.

6.10 Does Linux support any recordable CD-ROM drives?

According to Adam J. Richter, adam@yggdrasil.com:

The Yggdrasil distribution can drive a Philips CD writer with an Adaptec 154x SCSI controller. I'm not sure which other SCSI controllers, if any, will work. You can use mkisofs to make an ISO-9660 filesystem and cdwrite to write it to the CD. If you want us to help you set this up, you can call us on our 900 technical support number: 1-900-446-6075 extension 835 (US$2.95/minute, U.S. only).

6.11 The eject function (e.g. from Workman) does not work!

The SBPCD driver had a problem where the drive could be locked and the eject ioctl() would fail. This appears to be corrected starting with the 1.1.29 kernel.

6.12 You say I need to configure and build a kernel - how do I do that?

This is not the kernel HOWTO (any volunteers?). Until one is written, try reading the file /usr/src/linux/README; it is reasonably complete.

If you really don't want to compile a kernel, you may be able to find a precompiled kernel that has the drivers you need as part of a Linux distribution (e.g. the Slackware "q" series of disks).

6.13 Why do I get mount: Read-only file system when mounting a CD-ROM?

With older kernels you could mount a CD-ROM for read/write; attempts to write data to the CD would not generate any errors. As of kernel version 1.1.33 this was corrected so that CD-ROMs must be mounted read only (e.g. using the -r option to mount).

6.14 Why does the disk tray open when I shut down the system?

As of the 1.1.38 kernel, the sbpcd driver ejects the CD when it is unmounted or closed. If you shut down the system, a mounted CD will be unmounted.

This feature is for convenience when changing disks. If the tray is open when you mount or read a CD, it will also automatically be closed.

I found that this caused problems with a few programs (e.g. cdplay and workbone). You can turn of the feature by commenting out the line


#define EJECT 1

in the file /usr/src/linux/drivers/block/sbpcd.c and recompile the kernel.

Next Chapter, Previous Chapter

Table of contents of this chapter, General table of contents

Top of the document, Beginning of this Chapter