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