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.
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
You need to add an entry to the /etc/exports
file; see the
exports(5)
man page for details.
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.
In the future it may be possible to boot from IDE CD-ROM drives which have the appropriate ROM BIOS functions.
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
. Alternatively you can set the drive
parameters on the LILO command line.
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
Even though the standard cdda2wav program claims to support the Panasonic drives, it does not yet work properly, because of the need to handle "overlap" of the data.
The CDU-33 driver now supports reading audio data. It is said to work with the cdda2wav program.
For more information on this subject, see the alt.cd-rom FAQ listed in the references section.
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.
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.
(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:
static unsigned short cdu31a_addresses[] =
{
0x340, /* Standard configuration Sony Interface */
0x1f88, /* Fusion CD-16 */
0x230, /* SoundBlaster 16 card */
0x360, /* Secondary standard Sony Interface */
0x320, /* Secondary standard Sony Interface */
0x330, /* Secondary standard Sony Interface */
0x634,
0x654,
0
};
% mknod /dev/cd b 15 0
% mount -t iso9660 -r /dev/cd /cdrom
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.
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).
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.
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).
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).
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 discs. 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). As of the 1.1.60 kernel you can control this feature under software control. A sample program is included in the README.sbpcd file (or use the "eject" program).
The "special" CD is likely an XA disc (like all Photo CDs or "one-offs" created using CD-R drives). Most of the Linux kernel CD-ROM drivers do not support XA discs, although you may be able to find a patch to add support on one of the archive sites.
The sbpcd driver does support XA. If you are using this driver you can determine if the disc is XA using the following procedure: go into the file sbpcd.c and enable the display of the "Table of Contents" (DBG_TOC). Build and install the new kernel and boot from it. During each mount the TOC info will be written (either to the console or to a log file). If the first displayed value in the TOC header line is "20", then it is an XA disc. That byte is "00" with normal disks. If the TOC display shows different tracks, that is also a sign that it is an XA disc.
(thanks to Eberhard Moenkeberg for the above information)
The SBPCD driver supports multisession.
The SCSI CD-ROM driver supports multisession with NEC and TOSHIBA drives.
The CDU-31A driver has some multi-session support written but it does not yet work.
Some drivers available as kernel patches may support multisession for other drives.
This is normal and was added in a recent revision of the driver. It flashes the drive light when a CD is mounted (it's not a bug, it's a feature...).
Next Chapter, Previous Chapter
Table of contents of this chapter, General table of contents
Top of the document, Beginning of this Chapter