Login
Newsletter
Mi, 26. Januar 2005, 22:24

Bootbare CD mit Grub erstellen

Um eine bootfähige CD mit dem Bootloader Grub zu erstellen, kann man folgendermaßen vorgehen.

Man legt erst mit mkdir -p iso/boot/grub das Verzeichnis iso/boot/grub (im aktuellen Verzeichnis) an. Dann kopiert man stage2_eltorito in das Verzeichnis von grub:

cp /lib/grub/i386-pc/stage2_eltorito iso/boot/grub

Jetzt kopieren wir noch einen Kernel und eine Initrd-Datei in das Bootverzeichnis der CD:

cp /boot/initrd.img-2.6.10-1-k7 iso/boot
cp /boot/vmlinuz-2.6.10-1-k7 iso/boot

Jetzt müssen wir noch im Verzeichnis Grub die Datei menu.lst erstellen, die zum Beispiel so ausehen kann:

# menu.lst - See: grub(8), info grub, update-grub(8)
# grub-install(8), grub-floppy(8),
# grub-md5-crypt, /usr/share/doc/grub
# and /usr/share/doc/grub-doc/.

timeout 100

color cyan/blue white/blue

title Debian GNU/Linux, kernel 2.6.10-1-k7
kernel (cd)/boot/vmlinuz-2.6.10-1-k7 root=/dev/hda6 ro vga=7
initrd (cd)/boot/initrd.img-2.6.10-1-k7

title Debian GNU/Linux, kernel 2.6.7-1-k7
kernel (hd0,4)/vmlinuz-2.6.7-1-k7 root=/dev/hda6 ro vga=7
initrd (hd0,4)/initrd.img-2.6.7-1-k7

title Debian GNU/Linux, kernel 2.6.7-1-k7 (recovery mode)
kernel (hd0,4)/vmlinuz-2.6.7-1-k7 root=/dev/hda6 ro vga=7 single
initrd (hd0,4/initrd.img-2.6.7-1-k7

title Debian GNU/Linux, kernel 2.6.6-1-k7
kernel (hd0,4/vmlinuz-2.6.6-1-k7 root=/dev/hda6 ro vga=7
initrd (hd0,4/initrd.img-2.6.6-1-k7

title Debian GNU/Linux, kernel 2.6.6-1-k7 (recovery mode)
kernel (hd0,4)/vmlinuz-2.6.6-1-k7 root=/dev/hda6 ro vga=7 single
initrd (hd0,4)/initrd.img-2.6.6-1-k7

title Debian GNU/Linux, kernel 2.4.27-1-k7
kernel (hd0,4)/vmlinuz-2.4.27-1-k7 root=/dev/hda6 ro vga=7
initrd (hd0,4)/initrd.img-2.4.27-1-k7

title Debian GNU/Linux, kernel 2.4.27-1-k7 (recovery mode)
kernel (hd0,4)vmlinuz-2.4.27-1-k7 root=/dev/hda6 ro vga=7 single
initrd (hd0,4)/initrd.img-2.4.27-1-k7

title SUSE LINUX 9.2
kernel (hd0,11)/boot/vmlinuz root=/dev/hda12 vga=7
initrd (hd0,11)/boot/initrd

title Window XP Professional
 root (hd0,0)
 makeactive
 chainloader +1

Die CD hat dann folgende Dateistruktur:

./iso/boot: grub initrd.img-2.6.10-1-k7 vmlinuz-2.6.10-1-k7
./iso/boot/grub: menu.lst stage2_eltorito

Jetzt muss noch das bootbare ISO-Image mit mkisofs erstellt werden, das machen wir mit folgender Befehlszeile:

mkisofs -R -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 -boot-info-table -o grub.iso iso

Kommentare (Insgesamt: 25 || Alle anzeigen )
Re: Mit Grub von CD booten (nullplan, Do, 12. Juli 2007)
Re[3]: Mit Grub von CD booten (Günther Frick, Mo, 6. Juni 2005)
Re[2]: lilo booten von diskettenlaufwerk (Taesi, Do, 24. Februar 2005)
Re[3]: SPLASH (michaxyz, Di, 22. Februar 2005)
Dateisystem auf CD (michaxyz, Mo, 21. Februar 2005)
Pro-Linux
Pro-Linux @Facebook
Neue Nachrichten