1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445
|
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.9
Q: Network interfaces from different lan cards changing order from time to time
on booting from CD/DVD.
A: The drivers for lan cards are loaded as modules and it happends that the
order changed beetween two boots. Since udev exists, this problem is
resolved by using the script /etc/udev/rules.d/z25_persistent-net.rules.
Bootcdwrite removes this script (UDEV_FIXNET=yes) because of wrong
behavior if you install the CD/DVD on other machines. But at boottime it
will be recreated.
If you have a problem with the order of your network interfaces on a
booted CD or machine (after bootcd2disk) and you want to change this
order do the following things:
- remove the network modules (modprobe -r <name>)
- remove /etc/udev/rules.d/z25_persistent-net.rules
- load modules in order you want it
The file /etc/udev/rules.d/z25_persistent-net.rules is created by udev
and the order is persitent from now on.
|