|
Project: Linux Articles
Linux and the laser
By Mayank Sarup <mayank@freeos.com>
Posted: ( 2000-10-10 10:10:02 EST by )
CD-Writer are very common these days and can be seen on most desktops. Linux,
as with most things, doesn't make things very easy for you. I've suffered
through it so you don't.
CD-Writers are very popular now and Linux does have good support for your cd-writer. Your cd-writer should work just fine with Linux unless you have a really old one. If you have a SCSI cd-writer then it should work right out of the box. If you have an IDE cd-writer then there is a little more work involved. You will have to recompile your kernel with SCSI support. This SCSI support is just a emulation and not an actual SCSI implementation. USB writers are not supported as of now, though parallel port writers seem to be. You can check out the list of CD-Writers known to work under Linux in the CD-Writing HOWTO. My current config is : Red Hat 6.2 Kernel 2.2.16 Plextor 8X IDE The Kernel Mount the CD and install the kernel sources from the CD. Most distributions already install the kernel sources by default so the following steps may not be needed. In Red Hat you would do the following. mount /dev/cdrom rpm -ivh /mnt/cdrom/RedHat/RPMS/kernel-source-xxx.rpm ... where xxx would be the version number of your kernel. This will install the kernel source code under /usr/src/linux cd /usr/src/linux make menuconfig The following changes need to be made to the kernel configuration: Under block devices: Enhanced IDE/MFM/RLL - Y(es) IDE/ATAPI Support - N(o) SCSI emulation support - Y(es) Loopback device - M(odule) Under SCSI: SCSI support - Y(es) SCSI CDROM support - Y(es) Enable vendor specific extensions - Y(es) SCSI generic support - Y(es) Under Filesystems: ISO 9660 CDROM filesystem support - Y(es) Microsoft Joliet filesystem support - Y(es) Here I am enabling SCSI support right into the kernel. You can have it as a module but then you will have to make sure that the module is loaded at startup. Something else that you can do here, is go into the Processor type and select the processor class that you have. This way you optimise your kernel for your processor for better performance. Otherwise leave everything the way it is. Exit and say yes to saving the kernel configuration. Now comes the compiling part. Take the following steps. make dep - This will setup the dependencies make clean - clean up the source directory make bzImage - compile the kernel. Watch the case ! make modules - compile the modules Before you install the modules, make sure that you move your old modules directory out of the way. Your kernel modules will be found under /lib/modules/your-kernel-version. make modules_install - install the modules You could also put all of the above into a single line as make dep clean bzImage modules modules_install Either of the two methods will give you the same result but it is safer to do everything individually so you can keep an eye on the process. Take a break till the kernel is compiled. The kernel image will have been put in /usr/src/linux/arch/i386/boot directory as bzImage. Copy this image to /boot. cp /usr/src/linux/arch/i386/boot/bzImage /boot To check it out edit /etc/lilo.conf in pico or vi or your favourite text editor. Make a copy and edit the other linux entry or add a new entry like the following at the end of the file. image=/boot/bzImage label=cdrlinux root=/dev/hda1 ( Replace this with the root= given in the other image entry ) read-only Reboot and enter cdrlinux at the lilo prompt. If you followed my kernel setting then scsi support will have been compiled into the kernel and scsi support for your cdwriter will be enabled at boot. Look for a message as below. scsi0 : SCSI host adapter emulation for IDE ATAPI devices scsi : 1 host. Vendor: PLEXTOR Model: CD-R PX-W8432T Rev: 1.05 Type: CD-ROM ANSI SCSI revision: 02 Detected scsi CD-ROM sr0 at scsi0, channel 0, id 0, lun 0 sr0: scsi3-mmc drive: 32x/32x writer cd/rw xa/form2 cdda tray Do not worry about other IDE cdroms in your system using scsi support. You will still be able to use them as normal. The only difference is that the drives will now be referenced as /dev/scd0 for the first cdrom device and /dev/scd1 for the second and so on. Use these when mounting or un-mounting your cdroms. Now your mount commands will look like mount /dev/scd0 /mnt/cdrom If all of the above seems way too hard then here's what some well wishers off the net have sent in. BoyLinux has a much faster way to get there without compiling the kernel Before you start, check out your kernel modules directory. Most new distributions will carry the scsi emulation modules as part of the default install. Look in the scsi directory and look for files named ide-scsi.o and sg.o. If they exist then you don't need to re-compile your kernel. Just add the following to /etc/lilo.conf. append="hdc=ide-scsi" Replace hdc with the device your CD-Writer is represented by. Run /sbin/lilo and reboot. After the reboot, the scsi module will be loaded for your CD-Writer. Only your CD-Writer will be using SCSI emulation. JohnnyO sends in word that Mandrake 7.1 does not require any of the above steps. Mandrake at installation will detect your CD-Writer and take the necessary steps. So then you will have to do the following. 1. Click on the KDE Start bar. K -> Applications -> Archiving -> Cd Burning 2. Pick a program * Kiosco * Kover * XCDRoast * gtoaster 3. Go burn.... CD-Record Now comes the time to install the cd-recording software. Cdrecord is the best utility for this. It is available on most Linux distributions or from this site here The latest version as of writing this articles is 1.81. Download the rpm or the tar.gz if you prefer. CDrecord recognises most cdwriters so you should not face any problems there unless it is a hot off the lines model. If you face problems with your version of cdrecord then try a newer version. The first thing to do as root is cdrecord -scanbus. All writing will need to be done as root. You should get a display like this Cdrecord 1.8 (i686-pc-linux-gnu) Copyright (C) 1995-2000 Jörg Schilling Using libscg version 'schily-0.1' scsibus0: 0,0,0 0) 'LG ' 'CD-ROM CRD-8482B' '1.00' Removable CD-ROM 0,1,0 1) * 0,2,0 2) * 0,3,0 3) * 0,4,0 4) * 0,5,0 5) * 0,6,0 6) * 0,7,0 7) * Note the sequence of numbers that precede your cd-writer entry (0,0,0 here). Find an ISO image to write. The cdrecord command line is very simple. cdrecord -v -dev=0,0,0 -speed=8 -v = Verbose. More information. Definitely should be there. -dev = This is the ID of your scsi device which you should have after the 'scanbus' command above. -speed = This speed to write at. The above 3 options are all that I required in normal usage. Additionally if you come across a re-writeable CD then you should know how to blank the CD before you write to it. Use the command line option blank. cdrecord -v -dev=0,0,0 -speed=8 -blank=fast Blanking has a lot more options. Look at the man page for that. Fast will do a quick erase of the PMA, TOC and the pregap. You can blank specific tracks or do a more thorough blanking but generally you can get away with 'fast' unless it's a stubborn re-writeable. Mkisofs Before you can write a CD, you will have to create an ISO image of your compilation. An ISO images is essentially a raw image of the CD layout and its contents. mkisofs like cdrecord is available with most Linux distributions. But if your distribution doesn't have it or you want to try out the latest version then you can get it here. ISO's can be built by any user. You do not need to be root as you would have to be to write a CD. Create a directory to hold your cd contents. Into that directory, copy all your data up to a limit of 650MB. There are some CD's with higher capacity and using techniques like overburning but I haven't been able to try that out. Once you have all the data in there, you can use mkisofs to build an ISO. Get out of the directory with your data and give the following command. mkisofs -o foo.iso -J -r foocd/ -o - Output filename. This could be anything you want and point to any path that you want. -J - This puts in a Joliet file descriptor on to the CD. This way any long filenames will be preserved under Windows machines too. -r - You will need the Unix Rockeridge extensions for the long filenames under Linux. The iso9660 standard does not allow very long filenames. The last item in the command line is the path which contains the data that needs to be part of the iso image. Soon enough you will have an ISO image which you can burn using cdrecord. That's about it for basic cd-writing and the creation of ISO images. There is a lot more that you can do. Mulitsession CDs as well as audio CD creation and bootable CDs too. The CD-Writing HOWTO is an excellent resource for information, so do go through that too. If all this creation of images and writing seems a bit too complex then you might want to try X-CD-Roast. It's an excellent GUI tool and will work for just about all your CD-Writing requirements. Get it from www.xcdroast.org. Burn on!
CD-Writing Howto
Cdreecord Home Page
Mkisofs Home Page
Other articles by Mayank Sarup
Current Rating: [ 8.56 / 10 ]
Number of Times Rated: [ 9 ]
|