Ask Slashdot: Linux and IDE CD-ROM Changers
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."
What is needed is a 15GB hard drive. Copy the CDs to the hard drive, serve from there. Cost, about $250-$280. Lets you access a minimum of 20 CDs concurrently, much faster seeks, faster throughput. Maybe a hair more expensive...
But then, I didn't play with the kernel autofs stuff.
Get yourself a large, cheap IDE drive. A 9 MB drive is going to hold about 15 CD's worth of data and will be much faster on just transfer speed. Copy your CD-ROM images there and mount them on the loopback block device. Then you should be able to have them all online simultaneously, with no disk switching.
/dev/loop devices. RedHat comes with 0-7 (block major 7) installed. Obviously you make use mknod to create the rest (up to 255), but the kernel might not accept that many (can't tell from the configuration).
Not sure what the kernel limit is on the number of
You really should always unmount a device before changing/removing media.
CD changers are not made for servers and won't stand up to concurrent accesses (especially IDE CD-ROM drives).
Do what other people have said and use a hard drive for holding these CD images or use discrete CD-ROM drives (with selectable LUNs).
http://ecco.bsee.swin.edu.au/unix/uh/text/unix-is- dead.html
Various companies seem to think so too. Those "CD Force" towers by an outfit called Procom Technology run Linux (hacked to say "MESA"...) and just export images via SMB/NFS/etc.
Of course, they have one physical CD-ROM drive per disc, and want a ton of money for their stuff, so I just wrote my own. Now we just buy local commodity hardware, slap in a good SCSI disk subsystem (controller, *1* CD-ROM, hard drives), load my code on it, and cart it out to the location. It saves probably $2000 per machine.
Changers are worthless unless you're all alone on the machine with no possibility of concurrent multi-disk usage and you REALLY need to cheap out.
- An AC who used to identify himself before any of these accounts existed...
With the CD changer, you can switch CDs using
'eject -c' (see the eject man page).
However, you cannot have all of the CD's mounted
at once -- so there's no access to multiple CD's
for the system to handle.
If you really want to have a CD server, skip the
CD changer altogher. Buy a really big HD and a
conventional CD-ROM drive. Copy the CD images to
the HD (with 'dd'), and mount the image using
the loopback feature. This way, your machine
appears to have as many CDs as you have images,
and access is MUCH faster.
what steps would i need to get my mitsumi CDR to work under linux? (using RH6)
I use a nec 4x4 with an automounter script and it works perfectly. I found the script on dejanews and it was written by Richard Sharman and called auto.changer.sh so you know what to search for.
Ward Wouts
And boy, is our "network technician" idiot an idiot. The bad news is that, since anyone who has a clue knows that district staff are all idiots, no non-idiot would want to work there - at least not for longer than it takes to find a better job.
Let me tell you about the height of Our Idiot's idiocy. No, wait, a little background: the original Netware server in our building was deemed inadequate to oversee the operation of this cheesy 7-drive CD tower (apparently they saved a few bucks by getting one that's just an external SCSI drive-holding box filled with overpriced SCSI drives - that was Our Idiot's work, too). So they put in another Netware server, and I don't care to think about how many thousands they then pissed away buying licenses to allow the (hypothetical) users to connect to it. Okay, so far Our Idiot is just following he path of least intelligence, right?
So last spring one department gets the hots for this interactive multimedia... uhm, I'm not real clear on just what it actually does. From what I've seen it seems to be a really clunky computerized version of a job skills/preferences inventory that takes at least twice as long to complete as the old-fashioned pencil and paper verison. Anyway, Our Idiot decides that this will prove that he was right to piss away thousands of dollars on this CD tower (that still has no real use so far as I know) and the almost pointless second Novell server (that has had some apps moved to it, but they were working just fine on the old server, so I'm sure it was a case of "well, it's just sitting there..."). Our Idiot says "hey, yeah, let's install the two multimedia data disks in the tower and serve them to dozens of clients over the network!" In fact, Our Idiot even claims to have gotten this working for s trial install, and he sends the project along to Our Poor Techs, who are really nice people and, on the whole, orders of magnitude more clueful than Our Idiot. To cut an already over-long story a little shorter, the denouement of this little exercise came when S., arguably the most clued of Our Poor Techs, after a couple days of on and off struggle with getting this piece of junk running while using the data disks from the CD tower, finally gets a tech in the software maker's tech support department who has himself some small bit of a clue. S describes - again - the setup and the problems he's been running into, and hte tech tells him, "oh, you can't run this off a shared CD for multiple users - it requires much too much bandwidth!" Well, yeah, I'd already done a back-of-envelope that said that four or five clients playing the video clips that help mkae this thing so time-consuming to use would completely saturate the 10M ethernet - overlooking the fact that the server couldn't pull four or five simultaneous streams off a CD-ROM drive smoothly enough for this app.
As I said up front, Our Idiot is still employed by district, and the signs are that our New MIS Director relies on Our Idiot, so the chances of one getting the axe without the other seem slim. Perhaps Our New Superintendent will, in the fullness of time, dispense with both of them. Perhaps. But I don't see this as a reason to abandon all hope; there are reports of Bubonic plague in Arizona.
And you wonder why the public schools are a mess?
Go to http://unfix.org/projects/changer/ and use the device there. I have 2 IDE 4 disk changers, and use this program to access the disks.
/dev/changer module, or else /dev/changer will not find any drives. Put a pre-install changer.o modprobe ide-cd in your /etc/conf.modules file and it will load automatically. You will also have to alias block-major-42 changer in the same file.
/dev/hdc /mnt/big_harddrive /mnt/big_harddrive/a_cd.iso /mnt/a_cd
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.
I picked up an NEC 4x4 IDE CD-ROM a little while back, then discovered that the user-space CD control software I had wouldn't change between disks. So I wrote a program that would.
/dev/cdrom, but even a non-C-programmer should be able to figure out where to change that in the source. The error checking needs some work, too, but it *does* change discs (though it's mildly entertaining seeing it report "ioctl failed : Success" when it does).
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...
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.
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.
FWIW: At a place I used to work at, they were considering a very large CD changer system (~60+ IIRC). After looking into it in greater detail, they decided instead to buy a bunch of HDDs instead and copy the CDs onto the HDDs. If you use SCSI HDDs, then multiple people can access multiple files/disks at the same time, and the overall cost (for them anyways) actually worked out cheaper. I suspect that at the prices you quoted, you wont be able to access multiple CDs simultaneously. Disk will be more expensive for you, but probably a better all-around solution.
no, scsi emulation does'nt help.
I suggest to copy the CD images to a hard disk and mount them using a loop device.
Gerd
Just do it via IDE-SCSI Emulation and it should work just like it does with a SCSI changer. It changes discs automatically. As far as conflicts go, I believe it will switch to fulfill the next request as soon as the first is complete, but don't quote me on that. I'm not a kernel/hardware wizard, but I have worked with a SCSI CD changer (Pioneer 604x) and am looking at getting a few IDE changers.
--
Isn't it cool how they can Maintain huge market share, Make great profit, Produce Innovative products and still not be in a position to Leverage anything ?
:).
Seams you only need to twist arms and forcibly bundle stuff when you are producing crap
--= Isn't it surprising how badly I spell ?
There are few advantages to going with an Adaptec card. They're heinously expensive and really aren't anything special. You can get equivelent performance out of a Symbios-based card ($65 for an Ultrawide, U2W is still much cheaper than Adaptec) and if you really want high performance, step up to a Mylex or DPT. The advantage to a Symbios, Mylex or DPT is also that these companies have historically been strong supporters of Linux. (The astute reader can probably also point out other good Adaptec alternatives...ICP Vortex, Initio, Advnasys etc).
Bottom line - Adaptec is very popular and common because it's "the standard," but is often not the best choice.
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.
Look in /usr/src/linux/Documentation/cdrom at the file ide-cd. In the end of this text document you will find a small program you can clip and compile that will allow you to manually change the drives on a multi-CD drive. I currently use this on my own system to control a 4x4 drive. It does require that the drive be unmounted before use and then remounted again, however it is a trivial matter to write an interface script to do this for you. You can provide some kind of cataloging and drive locking scheme that will allow your users to access the data they need on demand.
/usr/src/linux/Documentation/Configure.help.
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,
"LinuX - Dropping the c u r t a i n on Windoze." -- Vee Schade, vschade at mindless dot com
There are user space programs to switch discs - I just ripped the code at the end of the cdrom text in the kernel docs and hacked it into cdtool.
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.
sanity points???
... He whose name must not be spoken!
Do I sense a CoC player nearby
B~ll Gat~s
Now we know!!!
James Ray Kenney mailto:jrkenney@swbell.net
I've not used this but it caught my attention... http://unfix.org/projects/changer/
Thanks for the helpful information. There are a few things here that I haven't tried yet for that server. I went ahead and built it - for the technically inclined these are the specs:
;)
;)
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.
Hell is being intelligent in a world full of idiots.
linux/Documentation/cdrom/ide-cd
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.
Why read the article when I can just make up a snap judgement?
I remember, infact, having CD changer programs made especiallly for multi-CD holding drives that would switch the running disks on demand for me. :)
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.
Have you tried SCSI host adapter emulation? That's what I use for my ATAPI CD burner and my PD/CD drive.
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.
Yes...
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.
"All those tubes and wires and careful notes!"
Yep... well I have complained and nagged the kernel guru's and well basically they did respond untill I asked the infamous 'device locking' question. Then they stopped replying to my emails... maybe they are too busy? I contacted HPA for a device number but even he started responding after a while and yes my mail box works. That's why I still have the seperate patch unlike what I thought would be and what Alan said at first... that it would be put into the 2.3 series untill proven it was working 100% but hey they're al busy guys&gals just like me... :)
http://unfix.org
Rob himself wrote an Afterstep Applet to control a cd changer. I don't know why he didn't mention it. Maybe because it doesn't work :P
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
-----BEGIN GEEK CODE BLOCK----- Version: 3.12 GIT d? s: a-- C++++ UL++++ P++ L+++ E- W++ N o-- K- w--- O- M+ V PS+ P
I have a NEC 6x4 that works just fine, in that I can mount any of the 4 CDs, but only one at a time. To switch discs, you have to umount, eject -c , mount. (See the man page for eject.)
:-)
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
-- Alastair
On a side note, FreeBSD sees an IDE changer as four drives...
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.
I've got two NEC 4x4 CD changers, and there's a reasonably :) /cdrom1, /cdrom2 etc. Works lovely. The automount
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.
Yes, thats right, you too can mount all the discs in your cdrom changer at once with the /dev/changer device driver. There is a kernel patch available here for Linux kernel 2.2.9. Hopefully this driver will make it into a kernel source tree near you!
... that goes by the name of COMMANDER TACO (wink, wink) wrote a little graphical cdchanger program. Its on his website, works fine for me.
I have an NEC 6x4 (Type CDR-4300A, but shows up in BIOS booting as NEC-252 or something) CD Changer. I willingly admit my plans to use it on my server.
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.
-----
Ping? PONG!
Unless you're dealing with an audience of one, or very occasional usage, why would an admin even consider serving up CDROM's with a changer?
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.
---- Politics: Kissing ass and pointing blames.
It all depends on how many users need to access the CD library at one time. Any solution utiliting a changer/jukebox mechanism inherently limits the amount of users who can connect to the library simultaneously.
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.
---- Politics: Kissing ass and pointing blames.
well, from what you said, you have 8 ide devices.
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).
...i have a 4 slot IDE CD_ROM, to get it working i read some of the doc/cdrom, somewhere there is c program in the doc's that lets you change cd slot.
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
nmarshall
The law is that which it boldly asserted and plausibly maintained..
--Colonel Burr 1783
I have an NEC 4x4 IDE CD-ROM changer, and I use the eject command to change discs. It does not do on-demand changing of CDs, but it works just fine for my desktop applications where I'm only using one CD at a time.
The command is 'eject -c#' where # is the tray number (0 being the first tray).
--Mike
We're using big HDD's here (2x9Gb) on a Linux box. Here's the pros and cons that I've found with this approach:
+ 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
-- Martin
In the right circumstances, a CD changer can be an important, vital storage device. Large CD Jukeboxes, like the types made at Meridian Data 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.
Matthew P. Barnson
I learn what I think when I read what I write