If you succeed setting up your hardware and the rest of your Linux-system,
the command cdrecord -scanbus
shows you a list of devices
available for writing. The goal of this chapter is to guide you in setting up your Linux-system, so that you finally end up seeing something like:
shell> cdrecord -scanbus
Cdrecord release 1.7a1 Copyright (C) 1995-1998 Jörg Schilling
scsibus0:
0) 'Quantum ' 'XP34300 ' 'F76D' Disk
1) 'SEAGATE ' 'ST11200N ' '8334' Disk
2) *
3) 'TOSHIBA ' 'MK537FB/ ' '6258' Disk
4) 'WANGTEK ' '5150ES SCSI-36 ' 'ESB6' Removable Tape
5) 'EXABYTE ' 'EXB-8500-85QUE ' '0428' Removable Tape
6) 'TOSHIBA ' 'XM-3401TASUNSLCD' '3593' Removable CD-ROM
7) *
scsibus1:
100) 'Quantum ' 'XP31070W ' 'L912' Disk
101) *
102) *
103) 'TEAC ' 'CD-R55S ' '1.0H' Removable CD-ROM
104) 'MATSHITA' 'CD-R CW-7502 ' '4.02' Removable CD-ROM
105) *
106) 'YAMAHA ' 'CDR400t ' '1.0d' Removable CD-ROM
107) *
Listing 1: Detecting devices on your SCSI-bus
The example was provided by Jörg Schilling and shows a total of four cd-writers. You cannot distinguish ordinary CD-ROM drives from those CD-ROM drives with burning capability. But the product identification often has hints about the feature in form of a R, -R or -RW.
The Linux-kernel can be equipped with drivers for various features. You can compile the drivers into the kernel-image statically or you can compile them as a module for loading on-demand. The last method is preferred for drivers not essential for bringing your Linux-system into life. Example: if your system lives on a IDE-harddisk, you must have the driver for IDE-harddisks in the kernel (and not as a module).
There are three different types of CD-writers: SCSI, IDE/ATAPI and external writers for the parallel port. Table 4 shows how to configure the Linux-kernel for those hardware types. The first column of the table is the section of the configuration menu, where you can find the setting. The second column is the description of the feature. The third column gives the name of the resulting module.
Y stands for yes and means you should put the beast into the kernel. M stands for module and means you should compile this feature as a module. Y/M gives you the option to decide between both. Empty settings don't need to be modified and not changing them increases the chance that the resulting kernel will work for you (if it did before...).
To check which drivers are active (provided by both, statical and dynamical drivers) in your running kernel, you can read the file /proc/devices. To check which modules are loaded, issue the command 'lsmod'. To check which modules are available for loading, issue the command 'modprobe -l'. If you need a module not available on your system, you must recompile and reinstall the kernel. Please read the Kernel-HOWTO for more information upon this. The most recent information about handling of kernel-modules can be read in the Module-HOWTO.
Sect. Description Module SCSI IDE PP
------------------------------------------------------------
BLOCK Enhanced IDE/MFM/RLL... Y
BLOCK IDE/ATAPI CDROM ide-cd M/N/Y
BLOCK SCSI hostadaptor emulation ide-scsi M
BLOCK Loopback device loop M M M
PARIDE Parallel port IDE device paride Y/M
PARIDE Parallel port ATAPI CD-ROMs M
PARIDE Parallel port generic ATAPI M
PARIDE (select a low-level driver) Y
SCSI SCSI support scsi_mod Y/M Y/M
SCSI SCSI CD-ROM support sr_mod Y/M Y/M
SCSI Enable vendor-specific Y Y
SCSI SCSI generic support sg Y/M Y/M
SCSI (select a low-level driver) Y
FS ISO 9660 CDROM filesystem iso9660 Y Y Y
FS Microsoft Joliet cdrom... joliet M M M
Table 4:
If you have success in building or finding the required modules, either add their names to /etc/modules or let an automatic facility (kmod, kerneld) load them. Consult the documentation of your Linux-distribution if you are unsure.
The feature "SCSI hostadaptor emulation" was named "SCSI emulation" in earlier kernels (around 2.0.36). If your kernel allows it, compile the driver for IDE/ATAPI CD-ROMs as a module. If not, disable it (N) and use the driver for SCSI-CD-ROMs instead. For the 2.2 series of the Linux kernel, it is no longer possible to run the drivers for IDE and SCSI on the same physical device at the same time (if you still have 2.0.36, read below).
The loopback device is an optional feature, which helps you to test the image before writing it to the media.
If you want to be able to read CD-ROMs, you need support for the ISO 9660 filesystem. This driver automatically includes RockRidge Extensions. If you want to have MS Joliet cdrom extensions, compile them as a module and load them.
In any case, you need a low-level driver for your hardware. Low-level refers to the driver, which interacts directly with the hardware. For SCSI and the parallel port, there are a lot of low-level drivers available, which are described below.
With kernel-version 2.2.1, don't enable CONFIG_SCSI_MULTI_LUN ('probe for multiple luns') and ide-scsi support at the same time, there is an ide-scsi bug that prevents this. Anyway, it is recommended to upgrade to 2.2.5.
Some users reported conflicts with pre-compiled binaries and the 2.2-release. This is a problem of the Linux-kernel. Solutions:
Kernels prior to 2.0.31 have several bugs and can't read the last file on a CD-ROM. Please upgrade to 2.0.36.
With 2.0.36 and above, you can select which driver (IDE or SCSI) to use for
which ATAPI-device. To be more precise, you can add the feature "SCSI
emulation" to your kernel and activate the emulation for specific devices
on the kernel commandline (before/while booting). For example, if your
cd-writer has the devicefile /dev/hdb, then add the statement
hdb=ide-scsi
.
image=/boot/zImage-2.0.36
label=Linux
read-only
append="hdb=ide-scsi"
Listing 2: Example configuration for lilo (/etc/lilo.conf)
linux "Linux 2.0.36" {
image=/boot/zImage-2.0.36
cmdline= root=/dev/hda5 readonly hdb=ide-scsi
}
Listing 3: Example configuration for chos (/etc/chos.conf)
After you have installed all necassary drivers, boot the new kernel. It should have all the features you need for the following sections.
[Users of devfs need not to care about the following steps of manually setting up device files. If you use devfs, everything will automacigally appear on the right place.]
Goto the /dev
-directory and check for loopback devices.
It's not critical if you don't have those devices, but it's convenient if
you do (see 3.5). If you already have them, the ls
-command should
show loop0
-loop7
:
shell> cd /dev
shell> ls loop*
loop0 loop1 loop2 loop3 loop4 loop5 loop6 loop7
Listing: devicefiles for loopback
If you don't have those device-files, then create them by using the
/dev/MAKEDEV
-script:
shell> cd /dev/
shell> modprobe loop
shell> ./MAKEDEV loop
Listing: commands to create loopback devices
The last command only succeeds if you have the loop
-module in your
kernel. What you read so far about handling of loop-devicefiles can be
applied to all other devicefiles (sg*, pg*, hd*, ...) and is not
explicitely mentioned in the following.
ATAPI means "SCSI-commands over the IDE-bus". In other words, your IDE/ATAPI-drives speak the SCSI-protocol (with some limitations) and thus can act as if they were SCSI-drives.
Under Linux you can make your IDE-writer appear as a SCSI-devices using the kernel-features "SCSI (hostadaptor) emulation". So activate the associated kernel module ide-scsi like described above and proceed as if you had a SCSI-writer.
Please make sure that your writer is recognized by the BIOS of your computer. It makes no sense to proceed if your computer does not accept the hardware (the fact that it doesn't spit it out is no confirmation; a message on the screen is required).
If you plan to connect your SCSI-drive to your parallel port, you need a special active cable and a special kernel-driver. Read read http://www.torque.net/parport/parscsi.html to learn more about this option.
The devicefiles /dev/sd* and /dev/sr* for accessing SCSI harddisks and SCSI CD-ROM drives are limited to block-oriented data transfer. This makes them so fast and idealy suited for data storage. Driving the laser of a CD-writer is a more complicated task and requires more than block-oriented data transfer. To keep the sd* and sr* devices clean and fast, a new type of SCSI-devices was introduced, the so called generic SCSI-devices. As everthing can be done to SCSI-hardware through the generic devices they are not fixed to a certain purpose - therefore the name generic.
As true for other devices, you should find them in the /dev directory (by convention):
shell> cd /dev
shell> ls sg*
sg0 sg1 sg2 sg3 sg4 sg5 sg6 sg7
If you don't have those device-files then create them by using
the /dev/MAKEDEV
-script:
shell> cd /dev/
shell> ./MAKEDEV sg
I have no clue about this, sorry. Please read http://www.torque.net/parport/paride.html or your local file /usr/src/linux/Documentation/paride.txt.
A survey of tools related to produce CD-ROMs is available from http://www.fokus.gmd.de/research/cc/glone/employees/joerg.schilling/private/cdb.html.The CD building project for UNIX
One of the following packages are required to generate prototypes of CD-Rs:
ftp://tsx-11.mit.edu/pub/linux/packages/mkisofs/ (mkisofs)ftp://ftp.ge.ucl.ac.uk/pub/mkhfs (mkhybrid)
Depending on the model of your CD-writer (see 1.3), one of the following software for writing prototypes to CD-Rs is required:
ftp://ftp.fokus.gmd.de/pub/unix/cdrecord/ (cdrecord)
Don't trust the man-page of (old) mkisofs
which states you need
version 1.5 of cdwrite
. Just use cdrecord and you are fine.
Please note that use the mkisofs shipped with cdrecord has a few extensions
(referenced in the documentation of cdrecord).
Front-ends are really front-ends under Linux. That means, you still have to install the command-line utilities, but you access them in a better looking manner.
X-CD-Roast is a program-package dedicated to easy CD creation under
Linux. It combines command line tools like cdrecord
and
mkisofs
into a nice graphical user interface.
http://www.fh-muenchen.de/home/ze/rz/services/projects/xcdroast/e_overview.html
BurnIT is a JAVA front-end to cdrecord, mksiofs and cdda2wav-0.95 making it a complete package for burning CD's on the Unix platform. It's available from
http://sunsite.auc.dk/BurnIT/