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 ATAPI CD-ROM drives which have the appropriate ROM BIOS functions.
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. The package is called cdda2wav.tar.gz
and can be
found on sunsite.unc.edu
.
Because CD-ROM drives are changing very quickly, it is difficult to
list which models support reading digital data. You best bet is to get
the latest cdda2wav
package and read the documentation.
For more information on this subject, also see the alt.cd-rom FAQ listed in the references section.
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 Steve Horne Horne@cmod2.pfc.mit.edu. This only applies to certain Reveal drives; apparently newer ones are made by Panasonic and work fine with the sbpcd driver.)
About a year ago I bought a Reveal CD/soundcard kit, and managed to get my particular configuration to work under Linux. I posted the tricks I used to make the thing work; that note got into the CD-ROM HOWTO. Recently I've been receiving a couple of requests a week for help on making Reveal kits work under Linux.
I'm no expert. All I did was hammer away at Reveal Tech Support until they gave me the address of the appropriate port, then added the two SOUND-FX lines to the cdu31a driver. I don't know how to help most of the people who e-mail me. This is the note I plan to send them. It would be a good idea for you to condense it to the appropriate level for the HOWTO. In particular, I don't want anyone to get the impression that this is a good card to buy for a linux system. It's not.
REVEAL cards - under Linux
Summary:
Fine print:
If your kit has a Sony, the cdu31a driver will work for you. You need a kernel with cdu31a support compiled in. The following is from the comments in the cdu31a source code:
* WARNING - All autoprobes have been removed from the driver.
* You MUST configure the CDU31A via a LILO config
* at boot time or in lilo.conf. I have the
* following in my lilo.conf:
*
* append="cdu31a=0x1f88,0,PAS"
*
* The first number is the I/O base address of the
* card. The second is the interrupt (0 means none).
* The third should be "PAS" if on a Pro-Audio
* spectrum, or nothing if on something else.
I expect the appropriate line for a Reveal card to be
append="cdu31a=0x654,0"
Since I don't consistently use LILO, I have just put the autoprobing back in by deleting the conditional stuff, and put my address first. (The file is /usr/src/linux/drivers/block/cdu31a.c; search for the string "cdu31a_addresses" to find the spot.)
THIS WILL NOT WORK IF YOUR KIT DOESN'T HAVE A SONY DRIVE! (I don't know that for sure, but I'd be very surprised if it did.)
By analogy to the Sony case, I expect that if you have a Panasonic or Mitsumi drive, you need to obtain from Reveal Tech Support the base register for your CD-ROM type, then use the appropriate driver. (I don't know if the sbpcd driver will work; it might. No matter what, you need those addresses.) I don't know if the "append=..." will work with the other drivers.
You can't patch the driver or lilo.conf until you have some sort of system up. If you are starting from scratch (DOS only, no Linux) here are a few things to try --
rdev /dev/fd0 /dev/fd0 ; root=floppy
rdev -r /dev/fd0 1440 ; ramdisk
rdev -t /dev/fd0 -3 ; prompt for screen mode
Then use it to boot the installation root-disk. Make a mount point
for the CD that won't interfere with the installation procedure:
# mkdir /cd
# mount -r -t iso9660 /dev/fd0 /cd
Then use the "install from mounted directory" option. Of course, the
kernels in the distribution won't work for you; copy your custom
kernel instead.
Sound support:
This card (isc-400) isn't well supported by Linux, which is a shame because it seems to be a nice piece of hardware. The card will produce output in the 8-bit SB mode. I haven't made the mixer work, so recording doesn't work properly either. The MSS mode doesn't have an IRQ; I don't know how to tell the driver that, so that doesn't work. I haven't seen the AdLib compatibility work.
I have tried, and at least one other person has tried, to obtain programming information for the native mode(s) of the card. After many hours on the phone I was referred to Singapore. I passed at that point. When I get serious about sound again, I'll buy a genuine SoundBlaster card.
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).
George Moody, george@hstbme.mit.edu reports:
I use `mkisofs' (from tsx-11.mit.edu and other standard sources) and `cdwrite' (from ftp.yggdrasil.com) to write CDs using the following configuration:
The hard disk and the CD recorder are on the same SCSI bus. My system is a 100 MHz Pentium running Linux 1.2.12. I'm using the standard NCR PCI-SCSI driver, not one of the new alpha versions that are said to support disconnect/ reconnect. I've been able to make CDs at 2x speed from image files in both ext2fs and MSDOS file systems (I haven't tried copying from a raw disk device, since I don't have a partition to spare). The only problem is that occasionally the system gets wedged *after* `fixating' the CD; when this happens, I reboot the system and everything's OK, including the CD I've just written. I run `cdwrite' as root, sometimes while running X11 and a few low-load X11 clients, but I try not to do anything else with the system while writing a CD.
Also see the Linux CD-Writer mini-HOWTO document, found at ftp://sunsite.unc.edu/pub/Linux/docs/HOWTO/mini/CD-Writer or http://sunsite.unc.edu/mdw/HOWTO/CD-Writer.html.
mount: Read-only file system
when mounting a CD-ROM?CD-ROM is a read-only media. 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. If you shut down the system, a mounted CD will be unmounted, causing it to eject.
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)
Other possibilities for unreadable CDs are:
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...).
Several users have reported success with multi-disc CD-ROM changers. All of the drives I have come across use SCSI interfaces.
You probably need to enable the "Probe all LUNs on each SCSI device" kernel configuration option. At least one user also had to increase a SCSI timeout value in the kernel driver.
The Nakamichi MBR-7 7 disc changer and Pioneer 12 disc changer have been reported to work.
EIDE/ATAPI multi-disc changers are also available. They aren't yet supported by the Linux kernel. If you are interested in helping to add support, contact B. Galliart ( bgallia@luc.edu).
Some CDs have file permissions that only allow user root
to
read them. The March 1995 InfoMagic CD set is one example.
The following patch, courtesy of Christoph Lameter ( clameter@waterf.org) patches the kernel to get around this problem.
From: clameter@waterf.org (Christoph Lameter) Newsgroups: comp.os.linux.setup Subject: Infomagic Developers Set: Fix for CD-Rom permissions Date: 12 Apr 1995 20:32:03 -0700 Organization: The Water Fountain - Mining for streams of Living Water NNTP-Posting-Host: waterf.org X-Newsreader: TIN [version 1.2 PL2] The March 1995 Edition of the Infomagic Developers CD-ROM Set has problems because the information stored in the root directory permissions is causing the following problems with using the CDs 1. Disc1 will always have the owner/group of 5101/51 and has write access allowed (?) 2. Disc2 and 3 have rwx set for root and no rights at all for any other group/user. These discs cannot be accessed from any user other than root! I run a BBS and I need to make them accessible for download by others. I have seen several fixes to this problem already floating around. Trouble is that these fixes usually change the rights for ALL directories on the CD. This fix here changes ONLY the rights for the root directory of the CD-Rom. If you want to run parts of Linux directly off the CD you might run into trouble if all directories are readable for everyone and if they are all owned by root. This fix will set the rights for the root directory to r-xr-xr-x and the owner/group to the values indicated in the uid and gid options to the mount command. To apply: cd /usr/src/linux/fs/isofs patch <**THIS MESSAGE** and recompile kernel (you may have to fix up the patch by hand depending on your kernel version). This fix should probably be incorporated into the kernel. What business does data on a CD have to mess around with the permissions/owners of the mount-point anyways? --- inode.c.ORIG Wed Apr 12 17:24:36 1995 +++ inode.c Wed Apr 12 17:59:12 1995 @@ -552,7 +552,15 @@ these numbers in the inode structure. */ if (!high_sierra) - parse_rock_ridge_inode(raw_inode, inode); + { parse_rock_ridge_inode(raw_inode, inode); + /* check for access to the root directory rights/owner CL */ + if((inode->i_sb->u.isofs_sb.s_firstdatazone) == inode->i_ino) + { /* Change owner/rights to the ones demanded by the mount command */ + inode->i_uid = inode->i_sb->u.isofs_sb.s_uid; + inode->i_gid = inode->i_sb->u.isofs_sb.s_gid; + inode->i_mode = S_IRUGO | S_IXUGO | S_IFDIR; + } + } #ifdef DEBUG printk("Inode: %x extent: %x\n",inode->i_ino, inode->u.isofs_i.i_first_extent); @@ -805,4 +813,3 @@ } #endif -
I'm told that the correct pronunciation it something like MAT-SOOSH-TA.
What does it mean when I get a kernel message from the IDE CD-ROM driver like "hdxx: code: xx key: x asc: xx ascq: x"?
This is an status/error message from the IDE CD-ROM drive. By default the IDECD driver prints out the raw information instead of wasting kernel space with error messages. You can change the default to display the actual error messages by going into /usr/src/linux/drivers/block/ide-cd.c and changing the value of VERBOSE_IDE_CD_ERRORS to 1.