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. Other


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: No, you have to make sure that all modules needed for booting from cdrom
   are present in the initrd.img and will be loaded at boottime. 
   You can change the initrd.img with the command bootcdmkinitrd

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
   
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. Other

5.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).

5.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.

5.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)

5.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

5.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. 

5.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. Add following line to /etc/mkinitrd/modules:

   usb-storage

   This will load the driver for the stick in the initrd. Then add all needed
   kernel modules to /etc/mkinitrd/files:

   /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
 
   Replace 2.4.18-1-586tsc with your kernel version. To enable automatic usb
   detection generate following script /etc/mkinitrd/scripts/51bootcdusb with
   execute permissions:

   #!/bin/sh
   F2=$INITRDDIR/scripts/bootcdusb
   cat <<end2 >$F2
   /bin/echo "running /scripts/bootcdusb" >&2
   mount -nt proc proc /proc
   MODULES=\$(discover --disable-all --enable=pci --enable=usb --module usb)
   for M in \$MODULES; do
     modprobe \$M
   done
   umount -n /proc
   end2
   chmod 755 $F2

   Now run bootcdmkinitrd and bootcdwrite (don't forget to set INITRD in
   /etc/bootcd/bootcdwrite.conf).
