Quicklinks

EndUser

Test/Virtualisaton


Installieren

Kernel - Tuning

Network

Display / Pads

Bock Devices

Printer

USB-Devices

BenutzerSW

Server

Install Notes

General/Hints

anoyances.org

Collection of installation & troublshooting info related to my linux (debian/mint/ubuntu) installations

Grub

Zusammenfassung

blkid (für uuid)
/dev/hda1 - (hd0,0)
/dev/sda1 - (hd1,0) Devices und Partitons fangen in Grub legacy bei 0

[grep -v rootfs /proc/mounts > /etc/mtab] - ev. bei chroot oder QEMU-Boot
[mount --bind /dev/.../boot /boot] - sehr nützlich, wenn Grub ab CD-Rom installiert wird.

meist ist die Installation sehr einfach
(in eigener Installation, auf 1. Platte)
grub-install [--recheck --root-directory=/mnt/] /dev/sda]
grub-install [--recheck] --root-directory=/ /dev/sdb (aus chmod Installation, ev /boot) [1]
update-grub (installiert in das bestehende /boot/grub,

hints:

Prüfen, ob Grub (Legacy) die Files lesen kann

  • geometry (hdx,y)
  • find /boot/grub/menu.lst
  • wenn Grub die Files nicht sieht, auf Grub2 od. andere Bootmanager (selten)
  • Grub kann Stage1 nicht finden, obwohl menu.lst gefunden wird [1] grub-install --root-directory=/ angeben
  • keine Device nicht gefunden für /boot /etc/mtab/ neu erstellen, siehe oben.

Grub ist etwas heikel

  • --rootdirectory mit abschliessendem /
  • chroot - Drives scheinen nicht korrekt gemappt
    • Grub will statt ins chroot ins die nr der root-partiton installieren:-), Vorsicht: workarround ln -s /dev/sdaF /dev/sdaK
  • ev. ab Bootable, mit einer guten Grub-Version

Speziallfälle
in grub-cmdline
root (hd0,1)
install --stage2=/boot/grub/stage2 /boot/grub/stage1 d (fd0) /boot/grub/stage2 0x8000 (hd0,1)/boot/grub/menu.lst

Grub Floppy

fdformat /dev/fd0H1440
mkfs -t ext2 /dev/fd0
mount /dev/fd0 /mnt/floppy
grub-install --root-directory=/mnt/floppy /dev/fd0   (od. grub-floppy /dev/fd0) 

Grub Config und Beispiele:

  • Grub besteht aus stage1 (im Bootrecord) und stage2 in einer Partiton.
  • menu.lst (meist in /boot/grub)
  • grub.conf
  • grub.map (Device Map)

Grub installiert
Grub Commandline (z.B.) in Kanotix, Knoppix u.ä. oder vorinstalliert z.B. auf Boot-Diskette.

Im allgemeinen wird menu.lst angezeigt, wo man die entsprechenden Bootzeile anklicken kann.
Das Menü kann aber auch fehlen (absichtlich oder im Fehlerfall)
Grub Befehle

  • 'c' Menu <-> Commandozeile
    diverse Edirbefehle
  • help, help befehl
  • geometry (ähnlich fdisk -l)
    (hd0,0) (erste bootbare Device. i.a. hda1)
  • find /vmlinuz
  • command und file-Completion mit [ESC]
  • von Netz
    grub> ifconfig --adress=192.168.1.3 --server=192.168.1.1
    grub> root (nd)
    grub> kernel /vmlinuz root=/dev/hda1
    grub> boot

booten ab Grub Commandline

  • Selektion der Bootzeile (ev. Editieren und verändern)
  • auf Commandzeile (Syntax wie in menu.lst)
    root (hd0,1) /* "cd" /dev/hda1 */
    kernel /boot/vmlinuz-2.4.18-586tsc root=/dev/hda2 ro hdc=ide-scsi
    initrd /boot/initrd.img-2.4.18-586tsc
    boot

Grub installieren und konfigurieren

  • Beispiel Grub auf einem USB-Stick installieren - gewisse USB-Sticks missbrauchen FAT-Space
  • :apt-get install grub
  • :grub-install /dev/hdXX #where to put the bootloader
    :grub-install --recheck /dev/sda (erneuert device-map)
    :grub-install --root-directory=/mnt /dev/sda (menu.lst wird nicht überschrieben)
  • grub --batch --device-map=/boot/grub/device.map </etc/grub.conf
  • Befehl auf Commandzeile eingeben, dann install (Beziehung Grub -> Stage1,2 und menu.lst)

menu.lst
default=0
timeout=10
splashimage=(hd0,4)/grub/splash.xpm.gz

title ...
kernel /vmlinuz-2.4.24 ro root=/dev/hda2 ide0=nodma

title GNU/Linux Fedora Core 1 (2.4.22-1.2174.nptl)
root (hd0,4)
kernel /vmlinuz-2.4.22-1.2174.nptl ro root=LABEL=/ hdc=ide-scsi apm=off acpi=on rhgb
initrd /initrd-2.4.22-1.2174.nptl.img

title Microsoft Windows XP Pro
rootnoverify (hd0,0)
chainloader +1

grub.config
root (hd0,1)
install --stage2=/boot/grub/stage2 /boot/grub/stage1 d (fd0) /boot/grub/stage2 0x8000 (hd0,1)/boot/grub/menu.lst
quit

Besonderheiten

  • Dos erste Platte, erste Partition
    title dos
    map (hd2) (hd0) - "Korrektur des Env"
    root (hd2,0) -> hier aber effektive Ort
    makeactive
    chainloader +1
  • Windows

Schönheit

  • Splashscreen
    convert -colors 14 -geometry 640x480 grubsplash.jpg
    grubsplash.xpm
    gzip grubsplash.xpm

Beispiel

default saved
timeout 15
color cyan/blue white/blue
foreground ffffff
background 2f5178
splashimage /boot/grub/mepis.xpm.gz

title MEPIS at hda8, kernel 2.4.26
kernel (hd0,7)/boot/vmlinuz-2.4.26 root=/dev/hda8 nomce quiet splash=verbose vga=791 hdc=ide-scsi
initrd (hd0,7)/boot/initrd.mepis
savedefault
title MEPIS at hda8, kernel 2.6.7
kernel (hd0,7)/boot/vmlinuz-2.6.7 root=/dev/hda8 nomce psmouse.proto=imps quiet splash=verbose vga=791
initrd (hd0,7)/boot/initrd.mepis
savedefault

title SuSE at hda5, kernel 2.6.6
kernel (hd0,4)/boot/vmlinuz-2.6.6-1-686 root=/dev/hda5
initrd (hd0,4)/boot/initrd.img-2.6.6-1-686
savedefault

title Debian Sarge at hda7, kernel 2.6.4-52
kernel (hd0,6)/boot/vmlinuz-2.6.4-52-default root=/dev/hda7
initrd (hd0,6)/boot/initrd-2.6.4-52-default
savedefault

title Windows at hda1
rootnoverify (hd0,0)
chainloader +1
savedefault

title MEMTEST
kernel /boot/memtest86.bin

title Benutze qwertz Tastatur mit GRUB
setkey y z
setkey z y
setkey Y Z
setkey Z Y
setkey equal parenright
setkey parenright parenleft
setkey parenleft asterisk
setkey doublequote at
setkey backquote equal
setkey plus bracketright
setkey minus slash
setkey slash ampersand
setkey ampersand percent
setkey percent caret
setkey underscore question
setkey question underscore
setkey semicolon less
setkey less numbersign
setkey numbersign backslash
setkey colon greater
setkey greater bar
setkey asterisk braceright
setkey caret backquote
setkey backslash minus

Edit Page - Page History - Printable View - Recent Changes - WikiHelp - SearchWiki
Page last modified on July 05, 2009, at 04:33 PM, visited:$PageCount