Contents
0. Where to get help
1. Before Creating a bootcd
2. Creating a bootcd image
3. Burning the image
4. Booting from bootcd
5. Installing bootcd on Harddisk
6. Other
7. Known Bugs


0. Where to get help

0.1 
Q: Is there a mailing list for bootcd users ?
A: Yes since august 2003 we have a mailing list:
   http://lists.alioth.debian.org/mailman/listinfo/bootcd-user


1. Before Creating a bootcd

1.1
Q: What has to be compiled in the kernel?
A: First of all, if you use a standard debian kernel from the rescue-disk
   everything should work. 
   
   This Question is only important for you if you have compiled your
   own kernel.

   To boot from bootcd the kernel must be able to read from cdrom.  
   A ramdisk is necessary to run bootcd. This has to be compiled built-in 
   in the kernel because it is needed before the kernel is able to load 
   additional modules.
   
   <*> means you must configure the feature as built-in.  <M> means you can
   configure the feature as built-in or as module. 
   If you use modules you have to make sure that the modules are loaded by
   editing /etc/modules.

   To build a bootcd with bootcdwrite you need:

     Block devices --->
       <M> Loopback device support	                    CONFIG_BLK_DEV_LOOP

     If you have an IDE Writer you need:
     							        BLK_DEV_IDESCSI 

       If your IDE Writer is normally accessable as 
       /dev/hdc for example you also have to put the 
       following in lilo.conf and run lilo:
         append="hdc=ide-scsi"

   To boot from bootcd you need:

     Block devices --->
       <*> RAM disk support                                  CONFIG_BLK_DEV_RAM
       <*> Initial RAM disk (initrd) support              CONFIG_BLK_DEV_INITRD

     File systems --->
       <*> Second extended fs support (for RAMDISK)              CONFIG_EXT2_FS
       <*> ISO 9660 CDROM file system support                 CONFIG_ISO9660_FS

     If you have a scsi CDROM Drive you need
       SCSI support --->
         <*> SCSI support
         <*> SCSI CD-ROM support      
         SCSI low-level drivers --->
           <*> "Driver for your scsi-card"

     If you have a non scsi CDROM Drive you need either:

       ATA/IDE/MFM/RLL support --->
         <*> ATA/IDE/MFM/RLL support
	 IDE, ATA and ATAPI Block devices --->
	   <*> Enhanced IDE/MFM/RLL disk/cdrom/tape/floppy support
	   <*> Include IDE/ATAPI CDROM support

     or you need:

       Old CD-ROM drivers (not SCSI, not IDE)  --->
         [*] Support non-SCSI/IDE/ATAPI CDROM drives
         <*> "Driver for your CDROM"

     If your CDROM doesn't support booting from it, you have to
     boot from an MSDOS Floppy. You need:

       File systems --->
         <*> DOS FAT fs support                                   CONFIG_FAT_FS
         <*> MSDOS fs support                                   CONFIG_MSDOS_FS
	 <*> VFAT (Windows-95) fs support                        CONFIG_VFAT_FS

1.2
Q: When I boot from bootcd I get error messages from depmod. What should I
   do?
A: depmod tries to write module dependencies on a read-only file on bootcd.
   Because nothing has changed, you can simply ignore this message. If you do 
   not want the message you have to change "depmod -a" to "depmod -A" in 
   /etc/init.d/modutils before running bootcdwrite.

1.3
Q: I want to use initrd. Can I use the default /boot/initrd.img-<KernelVersion>
A: You have to install bootcd-mkinitramfs. This will update your initrd.

1.4
Q: How can I enable DEVFS?
A: 1. Read /usr/src/linux/Documentation/filesystems/devfs/README
   2. Install devfsd (apt-get install devfsd)
   3. Read /usr/doc/devfsd/README.Debian 
   4. Compile your kernel with CONFIG_EXPERIMENTAL=y, CONFIG_DEVFS_FS=y and
      CONFIG_DEVFS_MOUNT=y
   5. Reboot

1.5 
Q: How can I use compression to get more data on one CD ?
A: You can use the transparent-compression ISO 9660/Rock Ridge filesystem.
   To do this you have to make sure your Kernel has the following Options:

     File systems  --->
     <*> ISO 9660 CDROM file system support                   CONFIG_ISO9660_FS
     [*]   Transparent decompression extension                    CONFIG_ZISOFS

   Also you should configure COMPRESS=yes in bootcdwrite.conf

1.6 
Q: How can I rebuild an initrd with initramfs-tools
A: update-initramfs -tu

1.7
Q: How can I reset network configuration on a bootcd ?
A: This is described in bootcdwrite.conf in the function extra_changes().

   
2. Creating a bootcd

2.1
Q: How can I use bootcd to run a diskless PC?
A: 1. Install another PC (that has disk and cd-burner) as usual. Be sure 
      not to use more than 650 MB.
   2. Build a bootcd with bootcdwrite from this PC.
   3. Run the diskless PC from the CD. 
   4. Save changes to a floppy with bootcdflopcp.
   5. Next time you boot, be sure the bios tries to boot the cd before the
      floppy.

2.2
Q: How can I use bootcd to install many PCs?
A: 1. Install a PC (that has a cd-burner) as usual. Be sure not to use 
      more than 650 MB.
   2. Build a bootcd with bootcdwrite.
   3. Boot one of the PCs you want to install with the bootcd.
   4. Be sure /etc/bootcd/bootcd2disk.conf has all Variables set to "auto"
   5. Use bootcd2disk. This will format the first disk, copy the cd to it
      and make it bootable
   6. Now boot from the PC and change hostname, ip-address ...

2.3
Q: I get an Error saying: "mkisofs finds 2 files with the same Rock Ridge name"
A: It was not possible to reproduce this kind of error on the authors machine. 
   But the error in the bug report says:
     mkisofs: Error: '/mnt/etc/cron.daily/find' and 
     '/var/spool/bootcd/changes/etc.ro/cron.daily/find'
     have the same Rock Ridge name 'find'.
   The bugreporter said a workaround was, to add $SRCDISK/etc/cron.daily to 
   NOT_TO_CD.


3. Burning the image

3.1
Q: How can I burn the image ?
A: For cdrom install cdrecord and see man cdrecord(1). Example
     cdrecord -scanbus
     cdrecord dev=0,2,0 -v -eject blank=fast
     cdrecord dev=0,2,0 -v -eject /var/spool/bootcd/cdimage.iso
   For dvd install package dvd+rw-tools and see man growisofs(1m). Example: 
     dvd+rw-format /dev/dvd
     growisofs -dvd-compat -Z /dev/dvd=/var/spool/bootcd/cdimage.iso

3.2
Q: How can I create a floppy ?
A: If you need to boot from floppy and to save changes made in ram you can
   do this:
     mount -o loop /var/spool/bootcd/cdimage.iso /mnt
     dd if=/mnt/cdboot.img of=/dev/fd0
     syslinux /dev/fd0
   If you need it only to save changes made in ram you can do this:
     mke2fs /dev/fd0


4. Booting from bootcd

4.1
Q: Can I change the amount of RAM available for ramdisk at boottime?
A: Yes: Interrupt the boot process and type "linux ramdisk_size=2048"
   This will build two 2MB disks.

4.2
Q: How can I use my bootcd on a PC which detects the CDROM as another device
   (not the device defined in bootcdwrite.conf as CDDEV)
A: Start booting again from the bootcd, interrupt and continue with 
   "linux root=/dev/scd0" (Or whatever your CD device is)

4.3
Q: Where is /var/www/index.html?
A: /var is very big. When you boot from bootcd /var has to be in ramdisk. 
   Because the ramdisk is normally not big enough to hold all files only the
   directory structure of /var is recreated in the ramdisk. But all files 
   from /var are on the bootcd in the directory /var.ro. You could copy the
   files to /var at boottime or you could create symbolic links to the files
   in /var.ro (see option NOT_TO_RAM in /etc/bootcd/bootcdwrite.conf).

4.4
Q: How can I change bootoptions on HPPA
A: Interrupt boot with ESC. Interact with IPL at boottime with "b <path> ipl".
   Now you can change options for example "root=/dev/scd0". 
   If Backspace does not work try Ctrl-H.

4.5
Q: What can I do if bootcd hangs at boot time
A: If the CD is burned and you get an error at boot time it's not easy 
   to find the problem. Therefor it is a good idea to edit /etc/default/rcS
   on the system that will be copied to cd and to set SULOGIN=yes to let
   sulogin be spawned on bootup.

   You can then login and do the boot steps manually to find the problem. This
   would be very helpful in a bug report.

   After login go to /etc/rcS.d and start the scripts S12bootcdram.sh and
   S13bootcdflop.sh.

5. Installing bootcd on Harddisk

5.1
Q: Performance problem: bootcd2disk is too slow. What can I do?
A: If your DVD drive is slow. Or if you have bootet from an virtual DVD drive
   like you do with HP ILO, bootcd2disk can be very slow. 

   With "bootcd2disk -url ..." you can now copy your bootcd to your swap Partition
   temporarily. This works much faster.

5.2
Q: bootcd2disk does not delete all old logical volumes
A: Only if the disk will be reused again, bootcd2disk tries to delete them.
   You can manually delete the disks with "dd if=/dev/zero of=<disk> bs=1k count=1".
   Then you have to reboot.


6. Other

6.1
Q: How can I create a bootable Floppy Disk from a bootcd ?
A: You have to write the file /cdboot.img from the bootcd to Floppy. 
   Example: dd if=/cdrom/cdboot.img of=/dev/fd0
   The floppy now has a FAT Filesystem. If needed you can edit the file 
   syslinux.cfg and change the root device (See 3.2).

6.2 
Q: bootcd displays Warnings, can I ignore it ?
A: That depends. Some commands print messages on stdout or stderr or 
   return with non zero exitcodes. If those messages are not known
   by bootcd a warning will be displayed with the command that produced it. 
   You can now look at the command's manpage, before trying to redo the
   command or to ignore the message.

6.3
Q: Why don't you calculate Needed RAM simple as sizes of
   /etc + /home + /root - sizes of files/dirs in NOT_TO_RAM ?
A: First of all the calculation is not exact, because "du" is not
   exact, because filesizes can change while bootcdwrite runs, 
   because there are different INODE definitions in the filesystem 
   on disk, ram and on cd and because there could be bugs in 
   bootcdwrite.

   But just for fun, do you remember set theory as for example
   described in http://www.enm.bris.ac.uk/teaching/enbwp/SetTheory.pdf?

                ______
	       /      \
        ______/        \
       /     / \   B    \
      /      \__\__     /
     /   A  / \**\ \   /   AnB = intersection of set A and set B
     \     /   \*/__\_/    AvB = union of set A and set B
      \   /     /    \     |A| = number of elements in set A
       \__\____/  C  /
           \        /
            \______/

  Here is an example to calculate the intersection of A, B and C 
  as shown by the asterixes in the picture:
    |AnBnC| = |AvBvC| + |A| + |B| + |C| - |BvC| - |AvB| - |AvC|


  We can use set theory to calculate the Needed RAM as shown by 
  the asterixes in the picture with the following formula:

  NeededRam = |RvNRvNC|-|NRvNC|
                ______
	       /      \
        ______/        \
       /*****/ \   NR   \
      /******\__\__     /
     /** R */ \  \ \   /   |R| = MB needed for (/etc v /home v /root)
     \*****/   \_/__\_/   |NR| = MB needed for (NOT_TO_RAM)
      \***/     /    \    |NC| = MB needed for (NOT_TO_CD)
       \**\____/ NC  /
           \        /
            \______/

  The formula NeededRamSimple = |R| - |NR| is not correct, as shown in
  the following examples:

    Assumptions for all Examples about some directories in the filesystem:
      /etc = 10 MB 
      /home = 10 MB
      /root/dir1/dir2 = 25 MB
      /root/dir1 = 30 MB (including /root/dir1/dir2)
      /root = 60 MB (including /root/dir1 and /root/dir1/dir2) 
      /usr/lib = 30 MB
      => |R| = 80

    Example 1: 
      Assumption of user definitions in bootcdwrite.conf:
        NOT_TO_CD (NC) = /root/dir1/dir2
        NOT_TO_RAM (NR) = /root/dir1 
      Results:
      => |RvNRvNC|=80  |NRvNC|=30  |NR|=30
         NeededRam=50(ok) NeedeRamSimple=50(ok)

    Example 2:
      NOT_TO_CD (NC) = /root/dir1
      NOT_TO_RAM (NR) = /root/dir1/dir2
      => |RvNRvNC|=80  |NRvNC|=30  |NR|=25
         NeededRam=50(ok) NeedeRamSimple=55(wrong)
    
    Example 3:
      NOT_TO_CD (NC) = /root/dir1/dir2
      NOT_TO_RAM (NR) = "/root/dir1 /usr/lib"
      => |RvNRvNC|=110  |NRvNC|=60  |NR|=60
         NeededRam=50(ok) NeedeRamSimple=20(wrong)

6.4
Q: How can I copy bootcd to disk for higher performance and mount the disk 
   read-only for security reasons?
A: You can not use bootcd2disk. This is only for normal read-write disk usage.
   You can copy bootcd with dd to a partition on disk. Then you will have a 
   read-only iso9660 image. But when you want to make this image bootable with 
   lilo the read-only file /boot/map has to be modified. So you have to copy 
   /boot/map to another partition that is writable. 

   For example: 
     CD  = /dev/hdc 
     Disk = /dev/hda (disk has no data and can be newly formatted)
     booting from bootcd and calling "df" shows bootcd is 253024k big.

     Do the following after booting from bootcd
     1. create /dev/hda1 with at least 253024k 
     2. dd if=/dev/hdc of=/dev/hda1 bs=1k count=253024

     After booting from bootcd with option "root=/dev/hda1" do the following:
     1. create /dev/hda2, create a filesystem and mount it as /mnt
     2. mkdir /mnt/boot
     3. cp /boot/map /mnt/boot
     4. create /mnt/etc/lilo.conf 
          boot=/dev/hda
          root=/dev/hda1
          map=/mnt/boot/map
          delay=20
          append="ramdisk_size=8192"
          image=/vmlinuz
                label=cdimage
                read-only
        You may have to change ramdisk_size.
     5. lilo -C /mnt/etc/lilo.conf

6.5
Q: Why can't I define a different ramdisk_size for each of the two ramdisk 
   filesystems that are created by bootcd?
A: The kernel can only handle ramdisks /dev/ram0, /dev/ram1, /dev/ram2,
   ... with the same size. This size can be changed with ramdisk_size=<SIZE>
   at boot time. It seems not to be possible to create more than one partition 
   on one ramdisk with fdisk. So it is not possible to have 2 ram filesystems
   with different sizes. Please tell me if you know a better way to solve the 
   problem. 

6.6
Q: Can I use an USB memory stick as floppy replacement?
A: Yes. First of all set FLOPPY_RUNTIME_DEV="/dev/sda1" in your
   /etc/bootcd/bootcdwrite.conf. If you use a static compiled kernel with all
   needed drivers compiled into it your are done. If you use an initrd kernel
   you need to tweak some files. 

   Make sure the following modules are loaded:
   usb-storage

   Make sure all needed kernel modules are included in initrd. For example:
   /lib/modules/2.4.18-1-586tsc/kernel/drivers/usb/usbcore.o
   /lib/modules/2.4.18-1-586tsc/kernel/drivers/usb/usb-uhci.o
   /lib/modules/2.4.18-1-586tsc/kernel/drivers/usb/usb-ohci.o
   /lib/modules/2.4.18-1-586tsc/kernel/drivers/usb/storage/usb-storage.o
 
6.7 
Q: How can I enable or disable the bootcd hardware detection

A: Since version 2.56 it is possible to disable or enable the bootcd 
   hardware discovery method implemented in /usr/share/bootcd/bootcdmodprobe.
   The default behaviour can be configured with 
   BOOTCDMODPROBE=standard|bootcd in bootcdwrite.conf.

   When booting from CD this option will be transferred as Kernel
   commandline option "bootcd=standard" or "bootcd=bootcd". 

   You can redefine the commandline from the isolinux prompt for example as:
   "kernel=/isolinux/vmlinuz initrd=/isolinux/initrd root=auto \
   ramdisk_size=16384 bootcd=standard"

6.8 
Q: Can I use bootcd to backup and restore redhat or suse?
A: You can create a bootcd which contains a backup (<bootcd-with-backup>) of 
   almost any linux system (<target-system>). 
   
   You can either do this backup online, or offline. 
   Online is good, if you do not want to stop the <target-system>. but be aware 
   of the fact, that the backup of a running database may be corrupt. 
   If you want to be sure, that everything is stopped, you may prefer to create
   an offline backup.

6.8.1
Q: Why should I create a <bootcd-with-backup>, mentioned in the above question,
   How can I use it.
A: The <bootcd-with-backup> can be used to recover the <target-system>, even if
   it is not bootable anymore.

   The <bootcd-with-backup> can be used to restore the <target-system>
   if the harddisk has been changed to another, maybe larger, harddisk.

   The <bootcd-with-backup> can also be mounted from the <target-system>
   to restore only specific files.

   The <bootcd-with-backup> can be used to reinstall the <target-system>, with
   a changed filesystem layout.


6.8.2
Q: How can I create a <bootcd-with-backup> with an online backup ?

A: Here is an example to create a bootcd which contains a backup 
   (<bootcd-with-backup>) of a linux system (<target-system>).

   You need space to hold an image of the backup on the <target-system>.
   We assume you found space in </var/space> and you do not want the large 
   partition </data> to be backed up, because it would not fit on one DVD.

   There is now a wizard that can help. Get it with:
     wget ftp://bootcd.alioth.debian.org/pub/bootcd/bootcdbackupwizard.tar.gz

   The tar includes the debian packages a README and a script to extract the
   debian packages. After extracting you can run bootcdbackupwizard.
     ./bootcdbackupwizard -d </var/space> -e </data>
     
   The bootcdbackupwizard does the following:

   1. The wizard gets the debian debootstrap package.
      wget http://ftp.de.debian.org/debian/pool/main/d/debootstrap/debootstrap_<version>.deb

   2  The wizard starts a script to create the bootcd-with-backup image.
      ./bootcddebootstrap -d </var/space> $PWD/debootstrap_<version>.deb

   3. Now some Information from the running target-system have to be selected. And
      the  file bootcd2disk.conf has to be created with this information. This can
      be done with the script bootcdmk2diskconf.
      
    . The wizard uses the script from the new created bootcddebootstrap.
      ./bootcdmk2diskconf -b >/var/space/backup/bootcd2disk.conf

   4. Now the wizard does an online Backup. If you are running databases, it
      would have been better if you had stopped them before running the wizard.
      The wizard mounts the disks used by the target-system into the chroot 
      environment. The wizard knows about this disks from bootcd2disk.conf
   
      chroot /var/space "bootcd2disk -c /backup -onlymount"

   5. Then the wizard starts the backup
      
      chroot /var/space "tar -c -C/mnt --exclude </data> -zf /backup/backup.tgz ."

   6. If you need to modify the options in bootcdwrite.conf, do this now.

      vi /var/space/backup/etc/bootcdwrite.conf

   7. Unmount the previously mounted filesystems of the target-system:
     
      chroot /var/space "bootcd2disk -c /backup -onlyunmount"

   8. Create the image:
      
      chroot /var/space bootcdwrite

   9. Now use your favorite tool to burn the CD/DVD.


6.8.3.
Q: How can I create a <bootcd-with-backup> with an offline backup ?

A: For the example below, we assume, you have another system with debian 
   installed (<debian-system>). You can use this to create a <mini-bootcd>. 
   Then you can boot the <target-system> with the <mini-bootcd>. 
   You can copy the data from the <target-system> to the <debian-system>. 
   And then you can use the <debian-system> to create the needed 
   <bootcd-with-backup>.

   To do this you need enough space on the <debian-system>. For the example
   below, we assume there is space in the directory </space> on the 
   <debian-system>. Also maybe not all data from the <target-system> will fit 
   on one DVD. So we assume we have found the directory </data> on the 
   <target-system> which can be backuped separately and should not go to
   the <bootcd-with-backup>.

   Do the following steps:

   1. Create backup directory on your <debian-system>:

       <debian-system># mkdir /backup

   2. Run bootcdmk2disconf from <debian-system> on the <target-system> and 
      copy the result back to the <debian-system>

      <target-system># scp <debian-system>:/usr/share/doc/bootcd/examples/bootcdmk2diskconf /tmp
      <target-system># /tmp/bootcdmk2diskconf -b >/tmp/bootcd2disk.conf
      <target-system># scp /tmp/bootcd2disk.conf <debian-system>:/backup/bootcd2disk.conf

   3. Create a <mini-bootcd> from the <debian-system> with bootcdwrite.
      <debian-system># bootcdwrite

   4. Burn the <mini-bootcd> to a DVD.
      
   5. Boot the <target-system> from the <mini-bootcd> and mount the system you 
      want to backup to /mnt.
      
      bootcd2disk -c /backup -onlymount

   6. Backup the system you want to backup:

      tar -c -C/mnt -zf - . | \
        ssh -c blowfish root@<debian-system> "cat >/backup/backup.tgz"

   7. Create the <bootcd-with-backup> from the <debian-system>

      <debian-system># bootcdwrite

   8. Now use your favorite tool to burn the CD/DVD.

6.8.4
Q: How do I reinstall from a <bootcd-with-backup>

A: To install a new system with the <bootcd-with-backup>, boot the 
   new system from the <bootcd-with-backup> and run

   1. bootcd2disk -c /backup

   Before you run this command you can set specific configuration options
   in /backup/bootcd2disk.conf

   The RESTORECMD defined in bootcd2disk.conf defines how the backup is
   restored. Because we restore a backup no files will be modified.
   If you restore your backup to another hardware, this may require changes
   in the files included in the backup (/etc/fstab). 

7. Known Bugs

7.1
Q: Does bootcd support selinux
A: No, this is not supported by bootcd until now.
   Bootcd would have to use star instead of tar or cpio. This has not been
   implemented until now. If you have for example restored a backup made 
   with bootcdbackupwizard of fedora-7 you will get an error when you try to 
   login. To disable selinux on the restored system, you have to boot in 
   single user mode and change the file /etc/selinux/config to contain 
   SELINUX=disabled
