chrislale@users.sourceforge.net
Revision History | ||
---|---|---|
Revision 1.0 | 14th August 2002 | Revised by: CTL |
Initial release | ||
Revision 1.1 | 28th August 2002 | Revised by: CTL |
Modified in response to comments. New sections added: "Checklist" and "Where to find out more". | ||
Revision 1.2 | 31st August 2002 | Revised by: CTL |
Modified in response to comments. |
Copyright ©2002 Chris Lale (chrislale@users.sourceforge.net). Permission is granted to copy, distribute and/or modify this document with no Invariant Sections, with no Front-Cover texts and with no Back-Cover Texts under the terms of the GNU Free Documentation License, version 1.1 or any later version, published by the Free Software Foundation. A copy of the license can be found at http://www.fsf.org/copyleft/fdl.html
If you find any errors, omissions etc, please let me know at chrislale@users.sourceforge.net
This document is written in UK English (not American English). If you spot a mistake, please check with a UK dictionary or spell-checker before contacting me! You can find a summary of English punctuation and grammar at http://www.bolton.ac.uk/webpublishing/guidelines/grammatical.html
I have tested these instructions on my i386 system (AMD Athlon XP 1600+ processor). I started with a fresh, clean, base installation of Woody 3.0 r0. I then installed The X Window System (core) and the desktop (Gnome and KDE) using tasksel.
All the work is done from the command-line. You can use a terminal window within X (such as "xterm") or a virtual terminal. To change to a different virtual terminal, hold down the "Ctrl" and "Alt" keys and press a function key. (<CTRL> + <ALT> + <function key> where <function key> is <F1>, <F2>, ... <F6> for terminal mode or <F7> for X.)
You will need root permissions for this installation and setting up. Good practice is to log in as a normal user and invoke the su command.
chris@athlon:~$ su |
Password: (enter the root password) |
athlon:/home/chris# |
When you have finished, enter the exit command to resume normal user status.
athlon:/home/chris# exit |
chris@athlon:~$ |
You need to know your CD-R or CDRW drive's recording speed and data buffer size. The speed is a number representing how much faster the drive is than 150 kBytes/s (eg 4, 8, 10, etc). The data buffer size is the number of MBytes. You can find this information on the drive's original packaging or documentation, on the Web or via software you may already use with the drive on other operating systems. Entering dmesg | grep ATAPI may also report a memory size, but I am not sure how reliable this is.
Your ide cd writer will only work if Linux is fooled into thinking that it is a scsi cd writer. To do this, you must have a kernel with the ide-scsi module. You can check this by using the command lsmod in a terminal window. You must have root permissions to do this.
chris@athlon:~$ su |
Password: (enter the root password) |
athlon:/home/chris# lsmod | grep scsi |
If you have the ide-scsi module, you should see a line something like this:
ide-scsi 7060 0 |
athlon:/home/chris# |
If the ide-pci module is present, you can skip the next section and move on to installing the basic software. If you do not have the ide-scsi module you must install a kernel that does have it. The next section explains how to install a different kernel.
Make sure that you have a text editor installed. I used emacs. The detailed instructions in this document assume that you will be using emacs, although you can use any text editor. You can install emacs with apt-get:
athlon:/home/chris# apt-get install emacs21 |
You will need these if you wish to allow normal users to record CDs. They are both in the "adduser" package.
athlon:/home/chris# apt-get install adduser |
You can skip this section if you can detect the ide-scsi module using lsmod (see SCSI emulation in the previous section). Otherwise, you must install a kernel with the ide-scsi module. The pre-compiled kernel images are supplied as .deb packages on the official CDROMs. A safe choice is kernel-image-2.2.20.
If you have other operating systems on your PC, or you are using a boot-loader such as Partition Magic, you must be careful not to write to the master boot record (mbr). If you do write to the mbr, you may find that systems such as Windows NT will not boot. You will have to repair them with the system's "emergency repair disc" or "recovery disc", or restore the mbr from a backup copy (see below). You do not have to worry about this if you are using LILO to boot your other operating systems.
Make sure that you have an up-to-date emergency repair disc for systems such as Windows NT. |
You can make a backup copy of your existing mbr to floppy disc as a precaution. Put a formatted floppy in drive f0 and use the following command to copy the mbr from hard drive hda. (You must have root permissions.)
athlon:/home/chris# mount /floppy |
athlon:/home/chris# dd if=/dev/hda of=/fd/MBR bs=512 count=1 |
athlon:/home/chris# umount /floppy |
You can restore the mbr from the floppy using this command:
athlon:/home/chris# dd if=/fd/MBR of=/dev/hda bs=446 count=1 |
See /usr/share/doc/lilo/Manual.txt.gz for more details.
You must be able to boot back into Debian if the installation goes wrong. You can do this from the Official Binary CDROMs providing that they are bootable on your PC. Now would be a good time to try. Boot your PC with the Official Binary CD in your CDROM drive. Press F3 at the boot: prompt, and read about the RESCUE option.
Alternatively, you may have made a boot floppy when you originally installed Debian. If not, you can make an up-to-date boot floppy during this installation. Make sure that you have a floppy disc ready.
You can check which pre-compiled kernels are available using apt-cache.
athlon:/home/chris# apt-cache pkgnames | grep kernel-image | more |
A good choice is to install "kernel-image-2.2.20", because it includes the "ide-scsi" module. Use apt-get to start the installation process.
athlon:/home/chris# apt-get install kernel-image-2.2.20 |
A new kernel has been installed at /boot/vmlinuz-2.2.20 |
Would you like to create a boot floppy now? [No] |
Enter y if you would like to create a boot floppy, and follow the instructions.
Would you like to create a boot floppy now? [No] y |
Now you need to install a boot block. This makes your system bootable from the hard drive. If Debian is the only operating system on your PC, you can probably accept the default answers. If you have other operating systems and a boot manager other than lilo you must be careful not to install a boot block in the mbr nor to make your Linux root partition active.
My system has other operating systems on /dev/hda1, /dev/hda2 and /dev/hda5. The Linux swapspace is on /dev/hda6 and the Debian root is on hda7. My boot manager expects to boot Debian Linux from partition /dev/hda7. This is what I have to enter:
Install a boot block using the existing /etc/lilo.conf [Yes] n |
Wipe out your old LILO configuration and make a new one? [No] y |
Do you wish to set up Linux to boot from the hard disk? [Yes] y |
Install a partition boot block on partition /dev/hda7? [Yes] y |
Make /dev/hda7 the active partition? [Yes] n |
You should be able to work out your needs by looking at this listing. See /usr/share/doc/mbr/README and documents in /usr/share/doc/lilo for more details
If you find that you want to re-install this kernel, you will have to make it available to apt-get again by un-installing it
This command un-installs the kernel image:
athlon:/home/chris# dpkg --purge --force-remove-essential kernel-image-2.2.20 |
This command regenerates the apt cache and displays a list of kernel images in the regenerated cache:
athlon:/home/chris# apt-cache --generate search kernel-image | more |
Burning a disc is a two-part process. First you must make a disc image using mkisofs. Then you use cdrecord to burn the image onto your recordable CDROM disc. Use apt-get to install both packages. You must install these packages before you set up SCSI emulation, otherwise you will not be able to read the packages from your CDROM drive(s). This is because your CDROM drive(s) will not be recognised until they are re-configured for the emulated SCSI bus.
athlon:/home/chris# apt-get install cdrecord mkisofs |
During the installation of cdrecord you are asked whether you want cdrecord to be installed SUID root. This allows users in group "cdrom" to burn CDs. This makes sense on a personal desktop PC. You can change this configuration later using dpkg-reconfigure cdrecord.
Do you want /usr/bin/cdrecord to be installed SUID root? yes |
If you do this, don't forget to make yourself a member of group "cdrom". To add user "chris" you would enter:
athlon:/home/chris# adduser chris cdrom |
(This may not take effect until after a reboot. Any user can check which groups they belong to using the command groups.)
Install the ide-scsi module by running modconf.
athlon:/home/chris# modconf |
scsi Drivers for SCSI controller cards and classes of SCSI device Ok |
ide-scsi - SCSI emulation support OK |
Install this module in the kernel? Yes |
Enter Command-Line Arguments (leave blank) Ok |
Installation succeeded |
Please press ENTER when you are ready to continue. <enter> |
Exit Finished. Return to previous menu. Ok |
Exit Finished. Return to previous menu. Ok |
athlon:/home/chris# |
The ide-scsi module will be included in the kernel at the next boot. Re-boot the system
athlon:/home/chris# shutdown -r now |
After re-booting, use dmesg to check the start-up messages. You are looking for confirmation that the ide-scsi emulation is working. In my case a drive called "scsi0" is listed. You also need to know the block device for your CD (re-)writer drive - in my case it is "hdc".
athlon:/home/chris# dmesg | grep ATAPI |
Here is a listing of the output from my system:
hdc: PHILIPS CDRW1610A, ATAPI CDROM drive hdc: ATAPI 40X CD-ROM CD-R/RW drive, 8192kB Cache scsi0 : SCSI host adapter emulation for IDE ATAPI devices |
There are two entries for "hdc". This is the only CDROM drive in my PC. As you can see, the listing also suggests that the drive has 8MB of memory.
You need to modify "lilo.conf" so that Linux recognises your CD (re-)writer drive as a SCSI drive. You can use any text editor, but I have given detailed instructions for emacs.
If you are working in a terminal window, you must invoke emacs from the terminal prompt (not from the desktop menu). This is so that you retain root privileges during editing.
athlon:/home/chris# emacs /etc/lilo.conf |
My lilo.conf looked like this (but it may contain comment lines too):
boot=/dev/hda7 root=/dev/hda7 compact install=/boot/boot.b map=/boot/map vga=normal delay=20 image=/vmlinuz label = Linux read-only |
Under the line beginning with "root=", add this line (substituting for block device "hdc" if necessary):
append="hdc=ide-scsi max_scsi_luns=1" |
Save the file and exit using these commands:
<F10> f s |
<F10> f e |
It should now look something like this:
boot=/dev/hda7 root=/dev/hda7 append="hdc=ide-scsi max_scsi_luns=1" compact install=/boot/boot.b map=/boot/map vga=normal delay=20 image=/vmlinuz label = Linux read-only |
The new settings will not take effect until you run lilo and reboot.
Do not forget to run LILO after making these changes. |
athlon:/home/chris# lilo |
athlon:/home/chris# shutdown -r now |
After rebooting, login and use dmesg to look at the lines near the end of the start-up messages. Check that your "SCSI" CDROM has been detected, and that it has changed from "hdx" to "scx" . Mine was changed from "hdc" to "sc0".
athlon:/home/chris# dmesg |
scsi0 : SCSI host adapter emulation for IDE ATAPI devices scsi : 1 host. Vendor: PHILIPS Model: CDRW1610A Rev: P1.4 Type: CD-ROM ANSI SCSI revision: 02 Detected scsi CD-ROM sr0 at scsi0, channel 0, id 0, lun 0 sr0: scsi3-mmc drive: 40x/40x writer cd/rw xa/form2 cdda tray |
You are now ready to test the cd writer.
Use cdrecord -scanbus to check the SCSI id of your cd writer on the SCSI bus. If there are no other "SCSI" devices, the SCSI id should be 0,0,0.
athlon:/home/chris# cdrecord -scanbus |
Cdrecord 1.10 (i686-pc-linux-gnu) Copyright (C) 1995-2001 Jörg Schilling Using libscg version 'schily-0.5' scsibus0: 0,0,0 0) 'PHILIPS ' 'CDRW1610A ' 'P1.4' 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) * |
You need this information when you edit /etc/default/cdrecord. The /etc/default/cdrecord file contains defaults that are used if no command line option or environment are present.
athlon:/home/chris# emacs /etc/default/cdrecord |
This is the listing of etc/default/cdrecord for my 8x speed Philips CDRW1610A with a 2MB buffer. (I have been conservative here. The drive reports 8MB, but the packaging states 2MB. The drive is advertised to write at 10x, but has been measured at 8x by "Roxio Easy CD Creator" in Windows 98.)
# The default device, if not specified elsewhere # CDR_DEVICE=philips # # The default speed, if not specified elsewhere # CDR_SPEED=8 # # The default FIFO size if, not specified elsewhere # CDR_FIFOSIZE=2m # # The following definitions allow abstract device names. # They are used if the device name does not contain the # the characters ',', ':', '/' and '@' # # drive name device speed fifosize driveropts # philips= 0,0,0 8 2 "" |
Save the file and exit using these commands:
<F10> f s |
<F10> f e |
Put a non-blank data CD in the drive to test that you can read from the drive. Enter the following command, substituting for the SCSI id "0,0,0" if necessary:
athlon:/home/chris# cdrecord dev=0,0,0 -v -toc | more |
This command prints the table of contents to the screen. The first few lines should look something like this:
Cdrecord 1.10 (i686-pc-linux-gnu) Copyright (C) 1995-2001 Jörg Schilling TOC Type: 1 = CD-ROM Using libscg version 'schily-0.5' atapi: 1 Device type : Removable CD-ROM Version : 0 Response Format: 1 Vendor_info : 'PHILIPS ' Identifikation : 'CDRW1610A ' Revision : 'P1.4' Device seems to be: Generic mmc CD-RW. Using generic SCSI-3/mmc CD-R driver (mmc_cdr). |
If the CD (re)writer is your only CDROM drive, you need to make it available as "/dev/cdrom". Then you will be able to read your distribution CDs again. If it is your second CDROM drive, you need to make it available as a different device, for example "/dev/cdrw".
Skip this section if your CD (re)writer is your second CDROM drive, and go on to making a second CDROM drive available
You need to get rid of the current (non-functional) ide "/dev/cdrom", and replace it with a symlink to the emulated SCSI "/dev/scd0".
athlon:/home/chris# cd /dev |
Rename "cdrom" rather than deleting it.
athlon:/dev# mv cdrom cdrom.old |
Create the symlink to "scd0".
athlon:/dev# ln -s scd0 cdrom |
That's it! Now test that you can read from /cdrom again. Put a data CD in the drive. Then:
athlon:/dev# mount /cdrom |
athlon:/dev# ls /cdrom |
athlon:/dev# umount /cdrom |
Skip this section if your CD (re)writer is your only CDROM drive. You should have carried out the instructions for making a single CDROM drive available. You need to create a new device ("/dev/cdrw", for example), and create a symlink to the emulated SCSI device "/dev/scd0".
athlon:/home/chris# cd /dev |
Create the symlink to "scd0".
athlon:/dev# ln -s scd0 cdrw |
The symlink does not point to anything yet. You need to set up a directory for the mount point:
athlon:/dev# cd / |
athlon:/# mkdir cdrw |
Now modify /etc/fstab:
athlon:/# emacs /etc/fstab |
Look for the existing cdrom line:
/dev/cdrom /cdrom iso9660 ro,user,noauto 0 0 |
Add a line for cdrw underneath using identical parameters.
/dev/cdrw /cdrw iso9660 ro,user,noauto 0 0 |
Your fstab should look something like this:
# /etc/fstab: static file system information. # # <file system> <mount point> <type> <options> <dump> <pass> /dev/hda7 / ext2 errors=remount-ro 0 1 /dev/hda6 none swap sw 0 0 proc /proc proc defaults 0 0 /dev/fd0 /floppy auto user,noauto 0 0 /dev/cdrom /cdrom iso9660 ro,user,noauto 0 0 /dev/cdrw /cdrw iso9660 ro,user,noauto 0 0 |
That's it! Now test that you can read from /cdrom and /cdrw. Put a data CD in each drive in turn. Then:
athlon:/# mount /cdrom |
athlon:/# ls /cdrom |
athlon:/# umount /cdrom |
athlon:/# mount /cdrw |
athlon:/# ls /cdrw |
athlon:/# umount /cdrw |
Now the moment of truth. Put a blank CD-R in the drive. Make an image of, for example, your home directory with mkisofs. Save the image file to /tmp since you do not want to keep it beyond the current session. Then burn the image onto the CD-R using cdrecord.
athlon:/# cd /tmp |
athlon:/tmp# mkisofs -r -o home-dir.img /home/chris/ |
This may take a little while, depending on the amount of data to be imaged.
athlon:/tmp# cdrecord dev=0,0,0 -v -data home-dir.img |
This may also take a little while. When the burn has finished, mount the the new CD and check its contents with ls.
athlon:/tmp# mount /cdrom |
athlon:/tmp# ls /cdrom |
athlon:/tmp# umount /cdrom |
Congratulations! You have now (hopefully) made a backup copy of your home directory on CD. You are now ready to add a front end for X.
You can now install a package like "X-CD-Roast" which runs in the X-window system.
The version of X-CD-Roast supplied with Debian Linux 3.0 r0 ("Woody") is cdroast 0.98+0 alpha.Some features are not yet implemented (including multi-session CDs). The version in "testing" does support multi-session CDs. This software did not destroy any of my test CDs.
You can install xcdroast 0.98+0alpha using apt-get:
athlon:/home/chris# apt-get install xcdroast |
For information on how to download the "testing" version of cdroast, see the "APT HOWTO" at http://www.debian.org/doc/manuals/apt-howto/index.en.html. This document explains how to use apt on-line (broadband connection recommended), or locally with downloaded files (for dial-up connections).
Support for multi-session and CDRW blanking. Nice features but I found it problematic to install. Install using apt-get install gtoaster.
Check the speed and buffer memory size of your cd (re-)writer drive.
Check that the ide-scsi module is available for your kernel. If not, install a kernel that does have the module.
Check that you have a text editor (eg emacs) available from the command line, and the adduser package.
Install the packages cdrecord and mksisofs. Give any non-root users access to cdrecord and mkisofs by adding them to group src.
Set up SCSI emulation using modconf. Modify the /etc/lilo.conf file and run lilo.
Configure cdrecord and test it.
Set up a block device Configure /dev/cdrom if the cd (re-)writer is your only CDROM drive, or /dev/cdrw of it is an additional CDROM drive.
Make a test recording.
Optional: add a front end for X.
Documents in /usr/share/doc/lilo/ including /usr/share/doc/lilo/Manual.txt.gz
/usr/share/doc/mbr/README.
The manpage for adduser.
The manpage for mkisofs.
The manpage for cdrecord.
"APT HOWTO" at http://www.debian.org/doc/manuals/apt-howto/index.en.html.