Ask Slashdot: Linux and IDE CD-ROM Changers 63
EvilNight
asks: "How do you get an IDE CD-ROM changer to work
with Linux? I know the kernel has support for these devices
but I have tried to use them in the past and have had no
luck (with the NEC 6x4). I am planning a fileserver which
needs to have the ability to serve up 20 CD-ROM discs and
I really want to use Linux for it. SCSI changers are easy
to set up (increment LUNs). The cost of SCSI changers is a
bit high though (about $190). The IDE changers are very
cheap ($85). I was looking at the Nakamichi 16x5 IDE
changer. Has anyone had any luck getting it to work under
Linux? Will the discs switch on demand or do you need to
switch them by running a command? How does it handle an
access conflict such as trying to read discs 2 and 5 at
the same time? I would greatly appreciate any advice that
you can give me."
Use /dev/changer, it works (Score:1)
One gotcha: If you dynamically load your IDE-CD driver as a module, you will have to load it BEFORE loading the
That said, I will add the following advice: If this is going to be used for a server, then you are far better off getting a large hard disk, and copying the CD images over with the dd command to the disk and mounting them via the loopback device, thus:
mount
dd if=/dev/cdrom of=/mnt/big_harddrive/a_cd.iso
mount -t iso9660 -o loop
Changers are REDICULOUSLY slow changing disks, they are more failure-prone than regular CD ROM drives, and you can only access one disk at a time. If two users try to access different disks, the drive thrashes between the two (at about 4 seconds per thrash). Not good.
Here's a program that'll do it... (Score:2)
It's pretty straightforward - it's just basically a command line interface to the CDROM_SELECT_DISC ioctl. It currently only works with
It has to be called explicitly at the moment, but I'm working on a wrapper for my MP3 player that will index the CDs in the drive and switch between them as it needs to... it might be possible to generalize that, though multiple simultaneous access to different discs would get really messy and slow...
Used NEC 4x4 Changer... (Score:1)
I used a NEC 4x4 IDE changer last year. It worked with no problem.
You use the eject command with the -c option. The eject man page specifically mentions that it works with IDE.
You must unmount the CD before the eject will work. It is not really very convenient.
You DON'T need SCSI emulation support... (Score:1)
The only real reason that you need SCSI emulation is for CDR.
By the way, I am very pleased with Red Hat 6 in that the stock kernel comes with SCSI emulation as a module. You pass the device name of the drive as a parameter to LILO, then modprobe the scsi emulation, and voila your CDR works. No kernel rebuild required. Peachy keen.
Consider an alternative to a CD changer (Score:2)
Re:IDE-SCSI Emulation (Score:1)
I suggest to copy the CD images to a hard disk and mount them using a loop device.
Gerd
Re:Consider an alternative to a CD changer (Score:1)
IDE-SCSI Emulation (Score:2)
Re:IDE-SCSI Emulation (Score:1)
off of it thru my LAN. With normal files I was getting close to 1MB/s. With multiple accesses the transfer rate drops quite a bit. Maybe I was doing something wrong.
Check out the kernel docs (Score:1)
--
Adaptec makes quality. (Score:1)
Seams you only need to twist arms and forcibly bundle stuff when you are producing crap
Re:Consider an alternative to a CD changer (Score:2)
SCSI: Go with Symbios or others (Score:1)
Bottom line - Adaptec is very popular and common because it's "the standard," but is often not the best choice.
Re:UpDATE on the server for those interested. (Score:1)
I think recent kernels allow 4 controllers "out of the box", and can be made to support 8 with very little work...
>If you have that many devices, frankly:
>GET YOURSELF A SCSI SETUP! STOP THE EIDE INSANITY!
Agreed. I used to have more than 2 EIDE controllers, but it was 'cause I had an ATAPI streamer that didn't cooperate very well with any other device, and that had to install with its own dumb controller as a last resort... :(
>IDE I/O is very CPU intensive, you'll find it to be faster to go SCSI.
That used to be true, but DMA modes aren't CPU intensive anymore. SCSI still has advantages over IDE (being able to hang lots of devices out of a single controller, as you mentionned, is one of them), but CPU usage advantage is a thing of the past.
Changer program for IDE multi-CDs (Score:1)
It is unlikely that the kernel's IDE-SCSI emulation driver will work as this driver is intended for ATAPI devices that do not have native drivers in the kernel. Furthermore, you will have to leave ATAPI support out of the kernel when using this option as the ATAPI support will overrule when both are copiled in. Refer to section "SCSI emulation support" in
Regards,
NEC 4x4 (Score:1)
I wouldn't recommend the NEC 4x4 for hard use, however - I have one and it's only taken a years use as a primarily audio drive to wear out the changer mechanics. It works as a single tray, now, but even then it will spit out the CD after a reboot, or jam up inside, sometimes. And they completely suck for ripping audio - not even
cdparanoia can do it reliably. The consolation is that it plays audio CDs without a hitch that expesive componet hifi's barf on. Handy if you store your CDs in a box of gravel.
Of course, the 6x4 might be better.
Re:What you need... Off topic :-) (Score:1)
Do I sense a CoC player nearby
B~ll Gat~s
Now we know!!!
Found this a while back... might be what ya need? (Score:1)
Upadte on the server for those interested. (Score:1)
Tyan Tiger 1692DL Mainboard with 2 Celeron 300a cpus. (Socket 370 w adapter cards)
128MB RAM (1 PC100 DIMM)
Onboard IDE: 4 Nakamichi 16x5 CD-ROM Changers.
Promise Ultra33 IDE Controller: 4 17.2GB Maxtor hard drives.
One Matrox Millenium II Card (AGP)
One 3Com 10/100 NIC (3c905b)
Addtronics 7890 case (awesome case)
Yes, I know, I am a sick bastard - I get that alot
I tried linux on it (RH52 w 2.2.9 I think) but was unable to get the system to see more than the first drive on each changer. I have tried every version of Windows (From 95 to Win2000 Advanced Server Beta 3) and none of them are capable of finding the other drives except for Win98 (ugh). For my own sanity I refuse to use that OS as a server. Linux is preferred because I can mount disks on directories instead of that brain dead drive letter assignment method that windows uses.
This server gets a lot of use, but the cd-roms are for infrequently accessed data (setup discs for various software, old backups). This server is only supporing a small number of users (5 including me, plus a few net connections every now and then). It was necessary beacuse of the large amount of data that we move around. It was also the 'budget model'. Having more cash I would have definitely gone SCSI with both the drives and changers.
I'm glad I don't have a whole lot to do this weekend - I'm sure that all of your suggestions will keep me busy for hours hacking away at it. Any suggetsions on a distro that handles this sort of thing better than others? Please, no flamewars... by now it's a redundant, and very crispy, topic.
While I'm at it - is it possible to get a third IDE controller into a system?
Thanks guys - EvilNight out.
cdchange.c (Score:1)
about half way down is the source for a program that will do the changing for you. i've used it on an Nec 4x4 for about 2 years. works fine.
Re:Upadte on the server for those interested. (Score:1)
Ditto (Score:1)
Re:Short answer: Don't (Score:1)
But, but, but, I've got a hole stack of them. All right, thier 10Megers. I might even have enough to load a CD. :)
Somday I'll get around to it and take the time to make clocks out of them.
Get a fast CD-ROM drive (Score:1)
With a good fast CD-ROM drive, loading CDs can be quite quick. Using only a 16x drive I get respectable load times of a few minutes. I use a script for loading a CD, then creating and enabling it's mount point. When it's done, it beeps me so I can start the next one. I originally wrote the script when I had a 4x drive.
Re:Short answer: Don't (Score:2)
Using /dev/loop is a waste of cpu cycles. When you load the CDs onto the HD, just put each into it's own directory tree, then export the base of each directory tree via NFS/samba/etc. I've used 'cp -a' on the ones I've loaded and it's worked fine. Now admittadly I'm only exporting to other Linux and UNIX boxes.
Now if there is some reason the CD needs to be exported in it's original form, then use /dev/loop. If you need to, look in the kernel docs for where to modify parameters to increase the numbers of /dev/loop devices available. Use "dd if={cdrom drive device} of={file to dump data to} bs=16k". Then mount that file via /dev/loop. Look in the docs for CD-ROM burning for how to mount a CD image on disk. They mention how to for testing images before burning to CD.
For drive choice, go with SCSI. Pick up an Aadaptec 2940 U2W controler (plug plug, got to support the company a relative works for) and an 18G Seagate or IBM drive (quality counts). For faster serving, use multiple smaller drives in raid 0 striped fashion. Sure this is less secure against hardware failure (plain raid 0 striping gives no data integrity assurance), but it's not like you don't have backup of what's on the drives. A drive dies, reconfigure without it, and reload the CDs. When the replacement drive arives, reconfigure with it and reload the CDs. Now if you're at the point where you have 5+ drives, look at going raid 5 for the ease of rebuilding when a drive fails.
SCSI emulation? (Score:1)
Just download the latest kernel source, set stuff up how you want, and choose "SCSI emulation support" (probably not as module, don't know if that works, didn't for me), disable ATAPI CD-ROM support.
Then choose SCSI support, SCSI emulation support, multiple LUNs, and maybe a few other things.
Recompile, and try it out.
Re:UpDATE on the server for those interested. (Score:1)
I used to have a SoundBlaster16 PNP with a real IDE interface on it (not the crappy proprietary CD-ROM interface). It ran as a tertiary IDE controller under Windows 95, with a standard IDE driver (nothing Creative Labs specific AFAIK).
The thing is, I never did get it to work under Linux, but I also have to take into account the fact that I was a newbie to the OS at the time.
I don't know if the kernel supports more than two IDE/EIDE controllers. If you have that many devices, frankly:
GET YOURSELF A SCSI SETUP! STOP THE EIDE INSANITY!
I did it when I needed more devices than my onboard controllers could handle. In fact, my onboard IDE has been shutdown to free up the resources.
IDE I/O is very CPU intensive, you'll find it to be faster to go SCSI.
Re:Mount all disc's at once with /dev/changer (Score:1)
CD Changer Afterstep Applet (Score:1)
I don't know if it does because I don't have a cd changer, but you can try downloading it. It was on his personal homepage, under the Afterstep section.
-Lee
NEC 6x4 works fine, but is a bit clumsy (Score:2)
A few years back I was doing systems integration for an info-on-CD-ROM company where some of the databases comprised several hundred CDs, and we had some massive jukeboxes. There were (and no doubt still are) a couple of commerical packages that made all that transparent (lets face it, the jukebox still has to go through those steps whether or not the end user is aware of it.)
The general technique was to cache (on disk) the directories of all the CDs and the first block or so of every file. The cache filesystem was "magic" and required adding drivers to the kernel (this on a SunOS box). For routine stuff like 'ls', 'find' and even 'file', just hitting the cache was all that was necessary. For a read, the cache filesystem served up what was in the cache while finding and loading the appropriate CD-ROM, so that subsequent reads came directly from it (it also did some pre-reading and buffering). Of course, if you did an lseek() you were going to have to wait. This is much simpler on a readonly filesystem (like CD-ROM), but I think they supported writeable (eg CD-RW, Magneto-optical, etc.) It also could treat multiple CD drives as part of a single filesystem. (E.g. one jukebox I got this working with had room for over 1000 ROMs and could mount six simultaneously.)
Fast, transparent access to everything on a whole mess of CDs. (Mind, if you're physically changing discs alot, i.e. you have more than the jukebox will hold, you have the hassle of rebuilding the cache whenever you manually swap discs in and out of the changer.)
Seems to me it wouldn't be too hard for some filesystem/kernel hackers to come up with something like this for Linux, at least on a level that would support small changers like the NEC.
(Just don't ever try reading from two CDs simultaneously in a changer like that -- you'll wear out the changer mechanism
Re:IDE-SCSI Emulation (Score:1)
*BSD anyone? (Score:1)
wdc1 at 0x170-0x177 irq 15 flags 0xa0ffa0ff on isa
wdc1: unit 0 (atapi): , removable, iordy
acd0: drive speed 689KB/sec, 128KB cache
acd0: supported read types: CD-DA
acd0: Audio: play, 255 volume levels
acd0: Mechanism: ejectable changer, unlocked
acd0: changer slot 0 disk present
acd1: changer slot 1 no disk
acd2: changer slot 2 no disk
acd3: changer slot 3 no disk
You can mount all the discs and it will change the 'active' disc as you access it; no special drivers or software required.
Re:Here's a program that'll do it... (Score:1)
This would create a problem if you were perusing about 3000 files... fill up that cache disk quite nicely...
Auto-switching on EIDE (Score:3)
easy way to make them auto-switch CDs, despite what everyone else says.
SCSI host emulation doesn't do what you want, but
the kernel automounter (normally used for NFS)
can be told to run a command when a filesystem
is mounted, and that certain filesystems are
mutually exclusive. So mine does an eject -c0 for
eject -c1 for
man pages/docs tell you how to do it.
Re:Upadte on the server for those interested. (Score:1)
Re:Consider an alternative to a CD changer (Score:1)
It would be fase hold 30 cd's worth of of data etc.
Mount all disc's at once with /dev/changer (Score:3)
Some guy... (Score:1)
I HAVE an NEC 6x4 (Score:1)
I was going to use, I should say, because the fscking thing doesn't work! Needless to say, I'm pretty steamed.
The problem is whenever I insert a disc (it's like a car's CD player) facing label up or down, it spins for a few seconds, then kicks the disc out!
Linux (RH52 Orig. kernel 2.0.32) recognizes it the same way as the BIOS (NEC 252). Windoze 95 OSR 2.1 sees four drives, giving the impression of working (*gasp!*), but the drive still kicks discs out!
I've tried to find tech support at nec.com, but the site is always down.
Anyone out there who can help?
-----
We concentrate on the stuff that matters: It's the code, stupid.
Why Even Consider a CD Changer for a Server? (Score:1)
That's the kind of things people lose their jobs over... or at least a lot of respect.
The idea of putting the CD images on HD-based shares is perfect. If the content/apps can be served from a shared CD, they should work from shared HD as well.
Re:CD Changers DO have a place on the network (Score:1)
I don't think I'm mistaken. If the architect of the solution specifies the amount of concurrent accesses supported and it is acceptable, more power to them.
Re: IDE channels vers controller's (Score:1)
That means you have 4 ide channels already, so it's all full.
Your Onboard controller has two channel (really two controllers in one) and the Promise one has two channels (same as onboard).
worked for me... (Score:1)
i had a bash sript that would ask me which slot to change to (used xmessage ). guess it's time to go and hack gnomes cd_mount_app to change cd slots...
nmarshall
#include "standard_disclaimer.h"
R.U. SIRIUS: THE ONLY POSSIBLE RESPONSE
Use the eject command (Score:1)
The command is 'eject -c#' where # is the tray number (0 being the first tray).
--Mike
Big HDD vs. CD changers (Score:1)
+ It's fast
+ It can handle multiple reads at once
+ Good price/performance ratio
+ Easy setup
- Takes a lot of time to copy all the CD's to the HDD's the first time
IMHO, the HDD setup is a better way to go unless you need to change CD's too often.
-- Martin
CD Changers DO have a place on the network (Score:1)
In the right circumstances, a CD changer can be an important, vital storage device. Large CD Jukeboxes, like the types made at Meridian Data [meridian-data.com] are perfect for long-term, near-line storage of critical data. Many models serve over 500 CD's (that's well over 300GB, quite an expensive set of hard drives) with anywhere from 2 to 8 CD-ROM drives allowing for multiple simultaneous access of different CDs. You can also get jukeboxes with CD-R drives for permanently burning important data to a media that has a shelf life of up to 50 years (better than an average hard drive's 10 years).
CD Changers and Jukeboxes are a vital part of any comprehensive Off-line/Near-line/On-line backup strategy, along with tape archives and hard drives. But laborious load times, hard user limits, and lamentable throughput will probably dog the media forever.
However, in the right situation it is the perfect solution.
Re:IDE-SCSI Emulation (Score:1)