SCSI Burning
From Gentoo Linux Wiki
Contents |
[edit] Introduction
This document will teach you everything you need to know to get your ATAPI CD-R/CD-RW drive working using SCSI emulation. If you are running a 2.6.x series kernel and you're not interested in burning across a network, I suggest that you instead read ATAPI CD Burning, which covers ATAPI burning. Read on for SCSI emulation and burning across a network (RSCSI).
[edit] Getting Started
To begin, first you'll need to know what IDE bus your CD-R(W) drive is on. The IDE buses translate as follows:
| Code: IDE busses |
IDE Primary Master = /dev/hda IDE Primary Slave = /dev/hdb IDE Secondary Master = /dev/hdc IDE Secondary Slave = /dev/hdd |
So if your CD burner was the IDE Secondary Master, it would be located at /dev/hdc. Simple, really.
[edit] Recompiling Your Kernel
Yes, that's right. You'll probably need to recompile your kernel. Now now, don't look so sad, it's not gonna be very hard. After all, you've already got your basic config set up, right? All you need to do is enable a few kernel options. The paths through menuconfig are slightly different for 2.4.x and 2.6.x (why are you reading this?), and I've outlined them both below.
| Linux Kernel Configuration: |
ATA/IDE/MFM/RLL Support -->
IDE, ATA, and ATAPI Block Devices -->
<M> SCSI Emulation Support
SCSI Support -->
<M> SCSI Support
<M> SCSI CDROM Support
<M> SCSI Generic Support
Device Drivers --->
ATA/ATAPI/MFM/RLL Support --->
<M> SCSI Emulation Support
SCSI device support --->
<M> SCSI disk support
<M> SCSI CDROM support
<M> SCSI generic support
|
Once you have enabled SCSI emulation in your kernel, it's time to recompile it. Again, simple.
Compiling 2.4.x series kernel:
make dep make clean && make bzImage modules modules_install
Compiling 2.6.x series kernel:
make clean make make modules_install
Once you've compiled the kernel, you need to copy your new kernel to your boot partition.
mount /boot ... (Only needed if /boot is on a separate partition) cp /usr/src/linux/arch/i386/boot/bzImage /boot/WHATEVER_YOU_NAME_YOUR_KERNEL cp /usr/src/linux/System.map /boot/System.map-2.4 cp /usr/src/linux/.config /boot/config-2.4 (Recommended, not required) umount /boot ... (Only needed if /boot is on a separate partition)
That's all that's necessary to recompile your kernel. Next up, modifying your bootloader.
[edit] Modifying your bootloader
In order to map your CD burner to the SCSI emulation, you need to pass a kernel parameter. It is slightly different in GRUB and LILO. Each one is listed here.
| File: /boot/grub/grub.conf |
title Gentoo Linux root (hd#,#) kernel (hd#,#)/vmlinuz root=/dev/hdx# hdc=ide-scsi |
| File: /etc/lilo.conf |
# Linux bootable partition config image = /boot/YOUR_KERNEL_NAME_HERE append = "hdc=ide-scsi" root = /dev/hdx# label = Gentoo read-only |
If you're using GRUB you're done, you can reboot your computer, and go on to the next section. But, if you're using LILO, you need to reinstall it with the new config.
/sbin/lilo
At this point, reboot your computer. The CD burner should now be configured to use SCSI emulation
[edit] Checking
There is one small point though. Since you have compiled your supports as a module, you may have to do the following to get your cd-writer working.
modprobe ide-scsi
If this is so add the line "ide-scsi" to /etc/modules.autload.d/kernel-2.4
Checking your configuration is simple enough. To do that, just go and type the following.
cdrecord -scanbus
Note that cdrecord is included into the cdrtools" package, simply install it via
emerge cdrtools
If that shows your CD burner, then you're good to go. If not, first check and make sure that your ide-scsi module is loaded (lsmod) and then check and make sure that you set the emulation up correctly in your kernel config line in the bootloader.
[edit] RSCSI
RSCSI can be used to burn from one machine to another. For example, computer A is an application server and computer B is a thin client with a burner, all on a local area network. With RSCSI it is possible to burn from computer A to the burner in computer B. That is the good news. The bad news is that establishing RSCSI is sometimes associated with going mad. Hopefully we can complete this without madness.
[edit] Cdrtools
I haven't seen a need to use cdrkit, so I'm sticking with cdrtools.
You have emerge app-cdr/cdrtools on both machines, haven't you?
On the burner machine cp /etc/default/rscsi.dfl /etc/default/rscsi
| File: /etc/default/rscsi |
USER=rscsi ACCESS=rscsi FQDN -1 -1 -1 -1 |
Hostnames don't work in /etc/default/rscsi, use a FQDN. And make sure /etc/default/rscsi is tab delimited. Later, if things go awry, you might need to uncomment
| File: /etc/default/rscsi |
DEBUG=/tmp/RSCSI |
The burner box should look something like this:
| Command: cdrecord -scanbus |
Cdrecord-ProDVD-ProBD-Clone 2.01.01a34 (i686-pc-linux-gnu) Copyright (C) 1995-2007 Jörg Schilling
Linux sg driver version: 3.5.34
Using libscg version 'schily-0.9'.
scsibus0:
0,0,0 0) 'SONY ' 'CD-RW CRX230E ' 'QYS1' 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) *
|
/usr/sbin/rscsi needs to be suid root, so chmod 4755 /usr/sbin/rscsi.
[edit] xinetd
emerge sys-apps/xinetd. Then change disable in /etc/xinetd.d/rsh to yes. RSCSI, you see, works by rsh. Then, /etc/init.d/xinetd start. Don't forget to rc-update add xinetd default.
[edit] useradd
useradd -m -G users rscsi. Then change the shell in /etc/passwd to /usr/sbin/rscsi. For example:
| File: /etc/passwd |
rscsi:x:1000:1000::/home/rscsi:/usr/sbin/rscsi |
Then change the rscsi line in /etc/shadow from rscsi:!: to rscsi::. You don't want cdrecord to require a password.
With any luck, on computer A, the application server, you should be able to something like:
| Command: |
# cdrecord dev=REMOTE:rscsi@burner-machine -scanbus
Cdrecord-ProDVD-ProBD-Clone 2.01.01a34 (i686-pc-linux-gnu) Copyright (C) 1995-2007 Jörg Schilling
scsidev: 'REMOTE:rscsi@burner-machine'
devname: 'REMOTE:rscsi@burner-machine'
scsibus: -1 target: -1 lun: -1
Warning: Using remote SCSI interface.
Using libscg version 'schily-0.9'.
scsibus0:
0,0,0 0) 'SONY ' 'CD-RW CRX230E ' 'QYS1' 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) *
|
If you have reached this far, the rest is a piece of cake.
[edit] Xcdroast
Don't laugh! Xcdroast is the best burning GUI out there. Why? Because, as far as I know, it is the only one to support RSCSI. After installing, under setup and Manually add device enter REMOTE:rscsi@burner-machine. You should be able to right click and show details.
[edit] Documentation
Some of the best documentation about RSCSI is the xcdroast FAQ. After that there is the cdrtools readme. A distant third is Scroogle.
