Slashdot is powered by your submissions, so send in your scoop

 



Forgot your password?
typodupeerror
×
Linux Software

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."
This discussion has been archived. No new comments can be posted.

Ask Slashdot: Linux and IDE CD-ROM Changers

Comments Filter:
  • by Anonymous Coward
    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.

    One gotcha: If you dynamically load your IDE-CD driver as a module, you will have to load it BEFORE loading the /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.

    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 /dev/hdc /mnt/big_harddrive
    dd if=/dev/cdrom of=/mnt/big_harddrive/a_cd.iso
    mount -t iso9660 -o loop /mnt/big_harddrive/a_cd.iso /mnt/a_cd

    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 [ci-n.com].

    It's pretty straightforward - it's just basically a command line interface to the CDROM_SELECT_DISC ioctl. It currently only works with /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 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
  • You can certainly access multiple CD images simultaneously, even if the server is using IDE. It may not be nearly as fast as SCSI, and if you have a lot of different users (about one per changer, say :-)) it would be best to go SCSI, but IDE disk space is cheap, especially with the new 20-25 gig disks out. And it's certainly tons faster than the changers when two users try to use the same disc, or worse different disks in the same changer, at once...
  • 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.
  • That does not work so well. On my PPro 200, I mounted a CD image and I was able to get 150K/s
    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.
  • There's some info in Documentation/cdrom/ide-cd

    --

  • 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 :).
  • That's a good point, especially since you can likely get a 14 gig drive (which should hold 20 CDs) for a lot less than four or five CD changer drives.
  • 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 don't know if the kernel supports more than two IDE/EIDE controllers.

    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.

    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 /usr/src/linux/Documentation/Configure.help.

    Regards,
  • by jwm ( 7499 )
    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???
    Do I sense a CoC player nearby

    B~ll Gat~s ... He whose name must not be spoken!
    Now we know!!!
  • 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.
  • 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.
  • You can have up to 4 IDE controllers for 8 IDE devices, I believe. This is exactly the thread I've been waiting for, cause I need to embezzle a 4x4 from work to serve like 3 discs. Doesn't sound like it will be SEAMLESS, but maybe not that bad really.
  • by Rahga ( 13479 )
    I remember, infact, having CD changer programs made especiallly for multi-CD holding drives that would switch the running disks on demand for me. :)
  • 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.

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

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

  • 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.
  • 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... :)
  • 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
  • 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 :-)

  • Doesn't copying the images to the hard drive kind of completely destroy the reason that he has a CD-changer in the first place? Cool idea, but not the right problem.
  • 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.

  • as far as your wrapper goes, for multiple access across disks, couldn't something be written to cache every file request, and spit that out off the hd instead of the cdr? then it could whack that cached file after, say 10 minutes or so...

    This would create a problem if you were perusing about 3000 files... fill up that cache disk quite nicely...
  • by jamie32 ( 25798 ) on Friday June 11, 1999 @08:47AM (#1855298) Homepage
    I've got two NEC 4x4 CD changers, and there's a reasonably
    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 /cdrom1,
    eject -c1 for /cdrom2 etc. Works lovely. The automount
    man pages/docs tell you how to do it.
  • Sure, you can add IDE Controllers onto your machine.. Ive never tried it, but you might wanna check out http://www.buy.com/comp/product.asp?sku=1002345
  • How about a promise technology Fastrack IDE RAID0+1 ($75) and 2 10.4 Gb drives ($150 each)
    It would be fase hold 30 cd's worth of of data etc.
  • by torment ( 31584 ) on Friday June 11, 1999 @08:55AM (#1855301)
    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 [unfix.org] 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.
  • 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.
  • 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.
  • 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
  • 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
  • I'm afraid you're mistaken: CD Changers do have an important place in the enterprise -- but probably not ones this small.

    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.

  • Um, loopback mounting doesn't use LAN at all. mount -o loop cdimage.iso /mnt at least, that works on my box.

Get hold of portable property. -- Charles Dickens, "Great Expectations"

Working...