Boot-CD inlusive Partitionen erstellen

Post Reply
Message
Author
mrdeath
Posts: 21
Joined: 17. Aug 2001 21:49

Boot-CD inlusive Partitionen erstellen

#1 Post by mrdeath »

Hallo,

folgendes Problem:
Ich habe einen P2 mit einer 6 Gb Festplatte als Router umfunktioniert (SuSE 7.2 textbasiert, IPTABLES, PPPoE und das andre nötige Zeugs), allerdings sind diese 6 Gb völlige Verschwendung für einen Router, weshalb ich diese Platte nun in einen anderen PC reinstecken will. Mir ist nun folgende Idee gekommen, dass es ja möglich wäre, anstatt der Festplatte eine CD (für die festen Dateien) und ein ZIP-Laufwerk (für die variablen Dateien) zu verwenden. Wie erstelle ich nun einen bootbare CD, die zudem noch ein paar Verzeichnisse (bin, sbin, dev, lib, opt, usr, und die anderen festen Verzeichnisse) enthält und die auch gleich in das System implementiert werden. Außerdem sollte gleich das ZIP-Laufwerk gemountet werden, wo die variablen Verzeichnisse (var, tmp, proc, usw) liegen.

Dies wäre meine Vorgehensweise, allerdings habe ich keinen Plan, wie ich das gescheit umsetze:
1. PC (Router) mit Festplatte und ZIP-Laufwerk starten und die Installation beginnen
2. alle Partitionen mit festen Verzeichnissen werden nun auf die Festplatte erstellt, alle Partitionen mit variablen Verz. auf das ZIP-Laufwerk
3. Nun sollte die Festplatte (mit den Partitionen) auf eine CD gespiegelt werden (besser gesagt sollte diese Spiegelung als Image vorliegen, um es nachher unter einem anderen Betriebssystem *g* zu brennen, weil der Brenner in einem anderen PC steckt), mit welchem Programm kann ich das machen???
4. Nun sollte aus diesem Image eine CD gebrannt werden.
5. Die festplatte wird aus dem Router ausgebaut, im Bios wird dann eingestellt, dass als erstes die (erstellte) CD gebootet werden soll

Würden hierbei eigentlich die Datei- und Verzeichnis-Attribute beibehalten?
Mit ist schon klar, dass ich jedesmal, wenn ich etwas GRUNDLEGENDES ändern will, nun wieder die Festplatte auspacken müsste ...

Ich hoffe, irgendjemand hat mein Problem verstanden?!?

Christian B.

Re: Boot-CD inlusive Partitionen erstellen

#2 Post by Christian B. »

Ob das so geht wie Du Dir das vorstellst weiss ich nicht, aber ist das alles ueberhaupt noetig ???

Da gibt es doch spezielle DISKETTEN-IMAGES die einen kompletten Router enthalten.

Dann muss in dem Rechner noch nichtmal ein CD-ROM eingebaut sein.

Such mal bei Google nach "Router on a floppy" oder so

Sebastian Ude

Re: Boot-CD inlusive Partitionen erstellen

#3 Post by Sebastian Ude »

Also, mal ein paar Fakten:

<li>Eine CD-ROM hat keine Partitionstabelle im eigentlichen Sinne, kann aber zumindest theoretisch mehere Datentracks beinhalten
<li>Die mkisofs-Doku sagt folgendes:

<u>What is El Torito?</u>

Simply put, El Torito is a specification that says how a cdrom should be formatted such that you can directly boot from it.

The "El Torito" spec says that ANY cdrom drive should work (scsi/eide) as long as the BIOS supports El Torito.So far this has only been tested with EIDE drives because none of the scsi controllers that has been tested so far appears to support El Torito.The motherboard definately has to support El Torito. The ones that do let you choose booting from HD, Floppy, Network or CDROM.

<u>How To Make Bootable CDs</u>

For the x86 platform, many BIOS's have begun to support bootable CDs.
The standard my patches for mkisofs is based on is called "El Torito".

The "El Torito" standard works by making the CD drive appear, through BIOS calls, to be a normal floppy drive. This way you simply put an floppy size image (exactly 1440k for a 1.44 meg floppy) somewhere in the iso fs. In the headers of the iso fs you place a pointer to this image.The BIOS will then grab this image from the CD and for all purposes it acts as if it were booting from the floppy drive. This allows a working LILO boot disk, for example, to simply be used as is.

It is simple then to make a bootable CD. First create a file, say "boot.img" which is an exact image of the boot floppy currently in use. There is at least one HOWTO on making bootable floppies. If you have a bootable floppy handy, you can make a boot image with the command

dd if=/dev/fd0 of=boot.img bs=10k count=144

assuming the floppy is in the A: drive.

Place this image somewhere in the hierarchy which will be the source for the iso9660 filesystem. It is a good idea to put all boot related files in their own directory ("boot/" under the root of the iso9660 fs, for example), but this is not necessary.

One caveat - Your boot floppy MUST load any initial ramdisk via LILO, not the kernel ramdisk driver! This is because once the linux kernel starts up, the BIOS emulation of the CD as a floppy disk is circumvented and will fail miserably. LILO will load the initial ramdisk using BIOS disk calls, so the emulation works as designed.

The "El Torito" specification requires a "boot catalog" to be created as ll.
This is a 2048 byte file which is of no interest except it is required.
My patches to mkisofs will cause it to automatically create the boot catalog. You must specify where the boot catalog will go in the iso9660 filesystem. Usually it is a good idea to put it the same place as the boot image, and a name like "boot.catalog" seems appropriate.


So we have our boot image in the file "boot.image", and we are going to put it in the directory "boot/" under the root of the iso9660 filesystem.
We will have the boot catalog go in the same directory with the name "boot.catalog". The command to create the iso9660 fs in the file bootcd.iso is then

mkisofs -b boot/boot.imh -c boot/boot.catalog -o bootcd.iso .

The -b option specifies the boot image to be used (note the path is relative to the root of the iso9660 disc), and the -c option is for the boot catalog file.

Now burn the CD and its ready to boot!

<u>CAVEATS</u>

I don't think this will work with multisession CDs.

If your bootable floppy image needs to access the boot floppy, it has to do so through BIOS calls. This is because if your O/S tries to talk to the floppy directly it will bypass the "floppy emulation" the El Torito spec creates through BIOS. For example, under Linux it is possible to have an initial RAM disk loaded when the kernel starts up. If you let the kernel try to read in the initial RAM disk from floppy, it will fail miserably because Linux is not using BIOS calls to access the floppy drive.
Instead of seeing the floppy image on the CD, Linux will be looking at the actually floppy drive.

The solution is to have the initial boot loader, called LILO, load your initial RAM disk for you. LILO uses BIOS calls entirely for these operations, so it can grab it from the emulated floppy image.

I don't think making a CD bootable renders it unreadable by non-El Torito
machines. The El Torito spec uses parts of the iso9660 filesystem which were reserved for future use, so no existing code should care what it does.

Mkisofs currently stores identification records in the iso9660 filesystem saying that the system is a x86 system. The El Torito spec also allows one to write PowerPC or Mac id's instead. If you look at the code in write.c you could figure out how to change what is written.

Sebastian Ude

Re: Boot-CD inlusive Partitionen erstellen

#4 Post by Sebastian Ude »

Nochwas:

Du müsstest alle Verzeichnisse, auf die während des Betriebes geschrieben werden muss (/tmp, log-Verzeichnisse usw.) auf eine Ramdisk legen.

Rossi

Re: Boot-CD inlusive Partitionen erstellen

#5 Post by Rossi »

"/" readonly ? Kann "/etc" readonly monitert werden (mtab & co ?)

Jochen

Re: Boot-CD inlusive Partitionen erstellen

#6 Post by Jochen »

Schau mal unter <a href="http://www.kernel.org/pub/dist/superrescue/v2/" target="_blank"><!--auto-->http://www.kernel.org/pub/dist/superres ... <!--auto--> nach, da findest Du die (m.E. geniale) Super Rescue CD. Bootet von CD, hat die lebenswichtigen Daten auf einer RAM-Disk und packt mittels zisofs ca. 1.4GB Daten auf die CD - inkl. KDE2, beispielsweise. Ausserdem findest Du da auch ein Paket zum Selberbauen solcher CDs, die Du Dir dann auch gerne selber anpassen kannst.

Viel Spass dabei!

Jochen

mrdeath
Posts: 21
Joined: 17. Aug 2001 21:49

Re: Boot-CD inlusive Partitionen erstellen

#7 Post by mrdeath »

Danke für die guten Tips,

ich werde am Wochenende mal probieren, solch eine CD zu erstellen, ich sag dann bescheid, ob's geklappt hat ...

Post Reply