BBS水木清华站∶精华区
发信人: linuxrat (竹剑居士*打回原形), 信区: Linux
标 题: 在Linux下安装IDE CD-R刻录机[FWD]
发信站: BBS 水木清华站 (Wed Jan 19 10:20:58 2000)
英文的啦, 谁有空给翻译一下. 有能力的就实践一下. 我负责转文章的说. 呵呵
URL: www.thelinuxgurus.org
=======Begin=========
Installing an IDE CD-R Under Linux
So, you have a brand new IDE CDR for your Linux box and your just
itching to burn Linux CDs to give out to all your friends, buddies,
pals, and anyone who will listen. Getting that IDE CDR to actually
work under Linux is the problem. No, it is not difficult, and chances
are your IDE CDR will work fine, plus there is tons of software for
it. Here is the problem, there are no native IDE CDR drivers in Linux
and all the CDR software is designed to work with a SCSI CDR. Follow
the simple instructions below and you will soon be burning CDs like a
madman (or woman).
A word of warning, you MUST recompile your kernel in order to get
support for your IDE CDR. If you are uncomfortable with this then you
may want to skip this tutorial and have someone else do it for you
(buy me plane tickets, Ill come do it for you!).
The process is actually fairly straight forward. There is no KERNEL
option called IDE CR-R Support, if there were then this would be easy.
No, what we must do is use a little known feature of the kernel to
make you IDE CD-ROMS look like scsi CD-ROMS and CD-Rs.
Let us start. Log into your Linux machine as root and navigate to the
/usr/src/linux directory and issue this command: make xconfig
Your machine will be busy for a few seconds to a few minutes depending
on what speed your machine is. Once finished you will be left with a
menu that looks something like this (depending on your kernel
version).
[kernelconfig.jpg]
We are only concerned with a few options, I will not go through each
and every option of kernel configuration, only the ones we are
concerned with. Press the option labeled Block Devices and you will
get a new menu. The first thing we have to do is turn OFF IDE CD-ROM
support. The option for IDE CD-ROM support is 6 or 7 lines down,
simply choose n to not include it in your new kernel . One more option
has to be turned on, scroll down until you see the SCSI emulation
support and turn it on and then go back to the main menu.
Now we have to turn on SCSI support (yes, I know you have an IDE
drive, bear with me). You should be back at the main menu now, press
the SCSI support button and a new menu pops up. Say yes to the very
first menu option which will compile in SCSI support. Now,three or
four lines down you will see the option to include SCSI CD-ROM
drivers, say yes to that option. Also say yes to SCSI generic support
and press the Main Menu button at the bottom of the screen.
Ok, now that you are at the main menu choose Save and exit to return
to your shell prompt. Now you must compile the kernel. Issue the
following command:
make dep;make clean;make bzImage;make modules;make modules_install
Depending on your machine this could take quite awhile, so take a
break and go get a snack. When it is finished it is time to install
the new kernel and reboot the machine.
Welcome back! Your kernel should be done compiling, so now you must
install it. The new kernel will be residing in the following
directory: /usr/src/linux/arch/i386/boot. Go there now, you will see a
file named bzImage. Copy this file to your /boot directory with some
sort of descriptive name. I will call mine scsi and use the following
command: cp ./bzImage /boot/scsi.
The kernel is compiled and copied to the /boot directory, now it is
time to tell LILO about it. I assume you use LILO to boot your
machine, fire up your favorite text editor and load up the LILO
configuration file which resides in /etc/lilo.conf. Mine looks like
this:
boot=/dev/hda
read-only
prompt
timeout=100
vga=no
image=/boot/vmlinuz
root=/dev/hda3
label=LinuxSMP
This file tells LILO where your kernels are located and a bit more
information to boot your machine. The lines we are concerned with are
the following:
image=/boot/vmlinuz
root=/dev/hda3
label=LinuxSMP
We must add a new entry to the lilo configuration file. Basically just
copy the information, but change the image=/boot/vmlinuz entry to
image=/boot/scsi (or whatever you named your new kernel). We must also
change the label line. In place of whatever is there now, chose a new
label, such as scsi. This label is how you tell LILO which kernel you
want to boot. After editing my lilo.conf file looks like this:
boot=/dev/hda
read-only
prompt
timeout=100
vga=normal
image=/boot/vmlinuz
root=/dev/hda3
label=LinuxSMP
image=/boot/scsi
root=/dev/hda3
label=scsi
As you can see I added a new entry and changed the image and label
lines. After modifying lilo.conf run lilo to add the new entry , just
enter the command lilo on a line by itself and press enter, lilo will
read in your new config file and you are ready to reboot.
A word of warning, once you reboot you will NOT be able to get to your
CD-ROM and CDR drives until a few changes are made. Go ahead and
shutdown and reboot the machine now. When you get the LILO boot prompt
type in whatever name you placed on the label= line to start your new
kernel. If your new kernel does not boot correctly then you can revert
to using the old kernel.
Ok, now we have to find out where our CDR and CDROMs are. Use the
dmesg command to scroll through the system startup messages by issuing
the command dmesg | more. The relevant sections of mine look like
this:
scsi0 : SCSI host adapter emulation for IDE ATAPI devices
scsi : 1 host.
Vendor: GoldStar Model: CD-ROM CRD-8241B Rev: 2.03
Type: CD-ROM ANSI SCSI revision: 02
Detected scsi CD-ROM sr0 at scsi0, channel 0, id 0, lun 0
Vendor: CREATIVE Model: CD-RW RW4224E Rev: 1.20
Type: CD-ROM ANSI SCSI revision: 02
Detected scsi CD-ROM sr1 at scsi0, channel 0, id 1, lun 0
scsi : detected 2 SCSI generics 2 SCSI cdroms total.
*sr0: scsi3-mmc drive: 1x/24x cd/rw xa/form2 cdda tray
Uniform CDROM driver Revision: 2.56
*sr1: scsi3-mmc drive: 24x/24x writer cd/rw xa/form2 cdda tray
I have added the asterisks to the bottom lines to show you what to
look for. Basically this tells me that 2 scsi devices were found, one
at /dev/sr0 and the other at /dev/sr1. If you try and use such things
as your CD player etc they probably will not work, we need to set a
few links and change a few files.
According the above output of the dmesg command my regular plain
vanilla CD-ROM manufactured by Goldstar is located at /dev/sr0 . I
want to make this my standard CD-ROM device for general CD usage and
music playing so I will link it to the /dev/cdrom device using the
following command:
ln -sf /dev/sr0 /dev/cdrom
Replace the /dev/sr0 with the actual location reported to you during
system startup.
This sets a link to the CD-ROM device and you should be able to play
music now, go ahead and try it. Now we need to deal with the CDR
device which is located at /dev/sr1 on my system, but could be
different on yours. First I want to create a directory to mount the
CDR in. I personally like to mount all my external file-systems under
some subdirectory of / . Many distributions default to mounting
external file-systems to a subdirectory of /mnt, such as /mnt/cdrom
for the CD-ROM. It does not really matter what you do, I created a
directory called /cdr for my CD-R by navigating to the / directory and
creating a new directory with the following commands:
cd /
mkdir cdr
Pretty simple, once you have done this make sure everything is working
correctly by placing a good CD (not music) into the recorder and
trying to mount it with the following command:
mount -t auto /dev/sr1 /cdr
You will need to replace the /dev/sr1 to whichever location was
reported to you on system boot-up and replace the /cdr to the location
of the directory you created in the above step to create a directory
to mount your cdr under.
Ok, once you've mounted the CD-R goto whatever location you mounted it
at get a directory list to make sure everything is ok, if so leave the
directory and unmount the cdr. We are ready to edit our /etc/fstab,
but first breathe and take a little break, we are almost done!
Now, the final part to get it all installed and working, to edit our
/etc/fstab file. Go ahead and load the file into your favorite text
editor, which I know is vi. We need to tell our linux system where the
CD-ROM and CD-R are located, more than likely you have already have an
entry for your CD-ROM but not the CD-R. Here is what mine looks like:
/dev/hda2 swap swap defaults 0 0
/dev/hda3 / ext2 defaults 1 1
/dev/hda1 /boot ext2 defaults 1 2
/dev/hdc /cdrom iso9660 ro,noauto,user,exec 0
0
/dev/fd0 /floppy auto noauto,user 0 0
none /proc proc defaults 0 0
Ok, see the line that reads
/dev/hdc /cdrom iso9660 ro,noauto,user,exec 0 0
this is the entry for our CD-ROM drive, simple edit the first part
that says /dev/hdc and replace it with whatever location reported to
you during system startup, in my case I would edit the line to read:
/dev/sr0 /cdrom iso9660 ro,noauto,user,exec 0 0
Now, make an EXACT duplicate of the line but edit the first field to
represent the location of your CDR and the second filed to the
directory you want to mount it under. The line for my CD-R looks like
this:
/dev/sr1 /cdr iso9660 ro,noauto,user,exec 0 0
My entire /etc/fstab now looks as so:
/dev/hda2 swap swap defaults 0 0
/dev/hda3 / ext2 defaults 1 1
/dev/hda1 /boot ext2 defaults 1 2
/dev/sr0 /cdrom iso9660 ro,noauto,user,exec 0 0
/dev/sr1 /cdr iso9660 ro,noauto,user,exec 0 0
/dev/fd0 /floppy auto noauto,user 0 0
none /proc proc defaults 0 0
Save and close the file. We are done installing and setting up the
CDR!!!!
Now, for software, I will not show you how to use the various software
packeages, but I will point you to a few packages and web pages.
First, the software that is pretty much required:
mkisofs - This is a premastering tool for mastering iso9660 cdroms.The
1.10 version contains *many* enhancements over the previous version.
These include:
* * Support for generating multi-session discs.
* * Support for El-Torito bootable cdroms.
* * Now configured with GNU autoconf.
Most of the CD burning tools require this package to be present on
your system.
cdrecored - Command line CD buring utility. Needed by most GUI burning
software.
cdparanoia - A tool for ripping songs tracks off of a CD. This tool is
also used by many GUI burning utilities.
cdda2wav - cdda2wav is a sampling utility for CD-ROM drives that are
capable of sending audio CD data in digital form to your computer
(CDDA). Data can be dumped into wav, sun or cdr format files. Options
control the recording format (stereo/mono, 8,12,16 bits, different
rates), as well as sound pitch. SCSI cdrom drives and burners, as well
as many IDE cdrom drives are supported.
Check your distribution, many distributions come with these packages.
Now for burning software:
CDR-Toaster - My personal favorite, from the CDR-Toaster webpage:
This is a graphical front-end for the excelent programs 'mkisofs' and
'cdrecord'.
It can also burn mp3 to cd audio.
It's good for:
* Avoiding coasters due to command-line mistakes
* Eliminating the tedium of consulting documentation
* Feeling more secure in a correct set of options
* Being lazy
Gnome Toaster - A graphical utility to burn CDs for Gnome fans.
Disclaimer: No Microsoft products were used in the creation of this
web-site. No Microsoft employees or users were harmed in the creation
of this web-site.
This site was created with vi.
=======End===========
--
|======================+========================+====================|
| 以无法为有法 , | 拳本无法,有法也空; | 我爱GNU/Linux, |
| 以无限为有限 | 一法不立,无法不容。| 因为我爱自由! |
| | | |
| 截拳道宗师-李小龙 | 意拳宗师-王芗斋 | 土人 Linuxrat |
|======================+========================+====================|
※ 来源:·BBS 水木清华站 smth.org·[FROM: 202.112.168.253]
BBS水木清华站∶精华区