Debian Kernel Update Config Grub

Bitte loggen sie sich ein oder registrieren sie sich.

Einloggen mit Benutzername, Passwort und Sitzungslänge
Erweiterte Suche  

Autor Thema: Debian Kernel Update Config Grub  (Gelesen 4321 mal)

0 Mitglieder und 1 Gast betrachten dieses Thema.

wbauer

  • Grünschnabel
  • *
  • Offline Offline
  • Beiträge: 5
Debian Kernel Update Config Grub
« am: 13.Dezember 2007, 13:44:21 »

Hallo,

nach einem Kernel Update von 2.6.18-4-amd64 auf 2.6.18-5-amd64 nimmt der Server beim Booten leider dennoch den alten Kernel.
Wie sollte ich die menu.lst verändern ?

Was mache ich, falls der Server nach der Änderung und einem reboot nicht mehr hochfährt ?

Danke.

wbauer

Hier die menu.lst

default         0
timeout         5
color cyan/blue white/blue

title           Debian GNU/Linux, kernel 2.6.18-4-amd64
root            (hd0,1)
kernel          /boot/vmlinuz-2.6.18-4-amd64 root=/dev/md1 apm=off ro noapic acpi=off nolapic
initrd          /boot/initrd.img-2.6.18-4-amd64
savedefault

title           Debian GNU/Linux, kernel 2.6.18-4-amd64 (single-user mode)
root            (hd0,1)
kernel          /boot/vmlinuz-2.6.18-4-amd64 root=/dev/md1 ro noapic acpi=off nolapic single
initrd          /boot/initrd.img-2.6.18-4-amd64
savedefault
### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
##      kopt_2_6_8=root=/dev/hdc1 ro
##      kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=/dev/md1 ro

## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd0,1)

## should update-grub create alternative automagic boot options
## e.g. alternative=true
##      alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
##      lockalternative=false
# lockalternative=false

## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=

## should update-grub lock old automagic boot options
## e.g. lockold=false
##      lockold=true
# lockold=false

## Xen hypervisor options to use with the default Xen boot option
# xenhopt=

## Xen Linux kernel options to use with the default Xen boot option
# xenkopt=console=tty0
## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
##      altoptions=(single-user) single
# altoptions=(single-user mode) single

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
##      howmany=7
# howmany=all

## should update-grub create memtest86 boot option
## e.g. memtest86=true
##      memtest86=false
# memtest86=true

## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false

## ## End Default Options ##

title           Debian GNU/Linux, kernel 2.6.18-5-amd64
root            (hd0,1)
kernel          /boot/vmlinuz-2.6.18-5-amd64 root=/dev/md1 ro
initrd          /boot/initrd.img-2.6.18-5-amd64
savedefault

title           Debian GNU/Linux, kernel 2.6.18-5-amd64 (single-user mode)
root            (hd0,1)
kernel          /boot/vmlinuz-2.6.18-5-amd64 root=/dev/md1 ro single
initrd          /boot/initrd.img-2.6.18-5-amd64
savedefault

title           Debian GNU/Linux, kernel 2.6.18-4-amd64
root            (hd0,1)
kernel          /boot/vmlinuz-2.6.18-4-amd64 root=/dev/md1 ro
initrd          /boot/initrd.img-2.6.18-4-amd64
savedefault

title           Debian GNU/Linux, kernel 2.6.18-4-amd64 (single-user mode)
root            (hd0,1)
kernel          /boot/vmlinuz-2.6.18-4-amd64 root=/dev/md1 ro single
initrd          /boot/initrd.img-2.6.18-4-amd64
savedefault

### END DEBIAN AUTOMAGIC KERNELS LIST

« Letzte Änderung: 13.Dezember 2007, 13:47:57 von wbauer »
Gespeichert


White2001

  • Jungspund
  • *
  • Offline Offline
  • Geschlecht: Männlich
  • Beiträge: 163
Re: Debian Kernel Update Config Grub
« Antwort #1 am: 14.Dezember 2007, 17:34:36 »

savedefault geht nur wenn du

default saved

benutzt.
und dann kansnte auch an kommandozeile mit grub-set-default 0  den index setzen.

is quasi nen byte im bootloader. ich nutz das imme rals fallback für nen neuen kernel.

default saved
kernel 0: mit panic=1
savedefault 1.

kernel 1:

kommandozeile grub-set-default 0 net vergessen.
Gespeichert

wbauer

  • Grünschnabel
  • *
  • Offline Offline
  • Beiträge: 5
Re: Debian Kernel Update Config Grub
« Antwort #2 am: 14.Dezember 2007, 17:54:06 »

Erstmal danke für Deine Antwort.

Allerdings stehe ich etwas auf der Leitung:

Was muss ich der menu.lst ersetzen/einkommentieren ?
Sind deine Angaben in die menu.lst einzutragen ?
An welcher Stelle ?

und zum Schluß am prompt: grub-set-default 0 eingeben ?

Dann nimmt er kernel 0 ?
Und bei panic kernel 1 ?

Danke für Deine Mühe ...
Gespeichert

White2001

  • Jungspund
  • *
  • Offline Offline
  • Geschlecht: Männlich
  • Beiträge: 163
Re: Debian Kernel Update Config Grub
« Antwort #3 am: 15.Dezember 2007, 00:49:22 »

naja ich bin net so ins detail gegangen sondern wollte nur allgemein meine vorgehensweise schildern.

Sehr ausfürlich sit dies in der Anleoitung zu Grub erklärt. In nem extra Kapitel.
ich empfehle dringed das durchzulesen als irgendwo was abzuschrieben.
Wäre doof wenns net geht. Jeder Server ist doch bissle anders.
so Mein tipp:
Das ist ziemlich eifnach und kurz erklärt.
http://gentoo-wiki.com/HOWTO_Remote_Kernel_Upgrade
http://de.gentoo-wiki.com/Remote_Kernel_Upgrade
Ins Detail geht dagegen die Grub info pages.

Hoffe das hilft....
Gespeichert

wbauer

  • Grünschnabel
  • *
  • Offline Offline
  • Beiträge: 5
Re: Debian Kernel Update Config Grub
« Antwort #4 am: 15.Dezember 2007, 17:39:43 »

Ich bitte Dich nochmal um Hilfe.
Hier meine geänderte menu.lst:

default saved
timeout 10
fallback 0
color cyan/blue white/blue

title           Debian GNU/Linux, kernel 2.6.18-4-amd64
root            (hd0,1)
kernel          /boot/vmlinuz-2.6.18-4-amd64 root=/dev/md1 apm=off ro noapic acpi=off nolapic
initrd          /boot/initrd.img-2.6.18-4-amd64
savedefault

title           Debian GNU/Linux, kernel 2.6.18-4-amd64 (single-user mode)
root            (hd0,1)
kernel          /boot/vmlinuz-2.6.18-4-amd64 root=/dev/md1 ro noapic acpi=off nolapic single
initrd          /boot/initrd.img-2.6.18-4-amd64
savedefault

### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
##      kopt_2_6_8=root=/dev/hdc1 ro
##      kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=/dev/md1 ro

## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd0,1)

## should update-grub create alternative automagic boot options
## e.g. alternative=true
##      alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
##      lockalternative=false
# lockalternative=false

## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=

## should update-grub lock old automagic boot options
## e.g. lockold=false
##      lockold=true
# lockold=false

## Xen hypervisor options to use with the default Xen boot option
# xenhopt=

## Xen Linux kernel options to use with the default Xen boot option
# xenkopt=console=tty0

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
##      altoptions=(single-user) single
# altoptions=(single-user mode) single

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
##      howmany=7
# howmany=all

## should update-grub create memtest86 boot option
## e.g. memtest86=true
##      memtest86=false
# memtest86=true

## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false

## ## End Default Options ##

title           Debian GNU/Linux, kernel 2.6.18-5-amd64
root            (hd0,1)
kernel          /boot/vmlinuz-2.6.18-5-amd64 root=/dev/md1 ro
initrd          /boot/initrd.img-2.6.18-5-amd64
savedefault fallback

title           Debian GNU/Linux, kernel 2.6.18-5-amd64 (single-user mode)
root            (hd0,1)
kernel          /boot/vmlinuz-2.6.18-5-amd64 root=/dev/md1 ro single
initrd          /boot/initrd.img-2.6.18-5-amd64
savedefault fallback

title           Debian GNU/Linux, kernel 2.6.18-4-amd64
root            (hd0,1)
kernel          /boot/vmlinuz-2.6.18-4-amd64 root=/dev/md1 ro
initrd          /boot/initrd.img-2.6.18-4-amd64
savedefault

title           Debian GNU/Linux, kernel 2.6.18-4-amd64 (single-user mode)
root            (hd0,1)
kernel          /boot/vmlinuz-2.6.18-4-amd64 root=/dev/md1 ro single
initrd          /boot/initrd.img-2.6.18-4-amd64
savedefault

### END DEBIAN AUTOMAGIC KERNELS LIST


Mich irritieren die doppelten Einträge oben und unten ...

Ist die Configuration so okay ?
Jetzt müßte ich grub-set-default 1 setzen, wenn ich das richtig verstanden habe ?

und später, falls er bootet

grub-set-default

ausführen ?
Gespeichert

White2001

  • Jungspund
  • *
  • Offline Offline
  • Geschlecht: Männlich
  • Beiträge: 163
Re: Debian Kernel Update Config Grub
« Antwort #5 am: 15.Dezember 2007, 19:02:45 »

*umdenk * joop müßte so gehen. ich habs nur immer andersrum. 0 der neue und 1 der fallback.

aber glaube das sind die falschen kernel ? du hast da jetzt 5 stück drinne ?
und 0 und 1 sind ja der selbe kernel nur 1 ist im single modus.

das sieht aus das debian die config automatisch anhängt.
Da kann ich dir leider net sagen was davon was ist, da ich kein debian einsetze.

tip: machs dir übersichtlicher und hau alles raus bis auf die beiden genutzten Blöcke.
(geht auch mehrere...)


ps: wenn er dann erfolgreich bootet kannste die grub-config dann ändern... einfacher als bei jedem start grub-set-default 1 zu machen :)

und wen man das vergisst und euserv mal wieder strom ausmacht wundert man sich das der alte kernel da ist :)
« Letzte Änderung: 15.Dezember 2007, 19:04:37 von White2001 »
Gespeichert

wbauer

  • Grünschnabel
  • *
  • Offline Offline
  • Beiträge: 5
Re: Debian Kernel Update Config Grub
« Antwort #6 am: 15.Dezember 2007, 22:03:21 »

Okay, danke

So müßte es dann gehen ?

default saved
timeout 10
fallback 1
color cyan/blue white/blue


title           Debian GNU/Linux, kernel 2.6.18-5-amd64
root            (hd0,1)
kernel          /boot/vmlinuz-2.6.18-5-amd64 root=/dev/md1 ro
initrd          /boot/initrd.img-2.6.18-5-amd64
savedefault fallback

title           Debian GNU/Linux, kernel 2.6.18-5-amd64 (single-user mode)
root            (hd0,1)
kernel          /boot/vmlinuz-2.6.18-5-amd64 root=/dev/md1 ro single
initrd          /boot/initrd.img-2.6.18-5-amd64
savedefault fallback

title           Debian GNU/Linux, kernel 2.6.18-4-amd64
root            (hd0,1)
kernel          /boot/vmlinuz-2.6.18-4-amd64 root=/dev/md1 apm=off ro noapic acpi=off nolapic
initrd          /boot/initrd.img-2.6.18-4-amd64
savedefault

title           Debian GNU/Linux, kernel 2.6.18-4-amd64 (single-user mode)
root            (hd0,1)
kernel          /boot/vmlinuz-2.6.18-4-amd64 root=/dev/md1 ro noapic acpi=off nolapic single
initrd          /boot/initrd.img-2.6.18-4-amd64
savedefault
Gespeichert

watchdog

  • Gast
Re: Debian Kernel Update Config Grub -> Falle in den Images
« Antwort #7 am: 29.Juli 2008, 12:23:16 »

Nein, das dürfte nicht funktionieren, weil Du nun als Fallback den single-user mode eintrag gesetzt hast.

Natürlich sollte man grub in- und auswendig kennen, wenn man einen Server betreiben will, aber selbst wenn man Debian kennt, ist hier eine unnötige Falle im Image eingebaut, weil  die Vorgänge beim Debian-Kernel-Update nicht berücksichtigt wurden.

Das Problem ist, dass die Debian Images (zumindest Debian 4.0r0 - 64Bit - SATA - RAID1 - Minimal (si)) zwei manuelle Einträge am Anfang der menu.lst enthalten. Innerhalb der DEBIAN AUTOMAGIC KERNELS LIST wird der neue Kernel von den Update-Scripten eingetragen, allerdings bleiben weiterhin am Anfang der Datei menu.lst die manuellen Einträge, die bei der Grub-Nummerierung mitzählen- somit startet bei einem "default 0" weiterhin der alte Kernel. Ein "grub-set-default 0" ergibt dasselbe. Die neuen Kernel stehen weiter unten - aber ACHTUNG! zu allem Überfluss waren in meinem Falle hier auch noch die Einträge für root falsch - da stand "root (0,0)" anstatt "root (0,1)" - was dann leicht nochmal zu einer zusätzlichen Runde rescue-System starten, menu-lst ändern, reboot führen kann.

Wie auch immer die Einträge in die menu.lst geraten sind - falls jemand nach einem Kernel-Update noch den alten Kernel laufen hat oder das System nicht mehr erreichbar ist, einfach mal da nachschauen.


watchdog

« Letzte Änderung: 29.Juli 2008, 21:07:07 von watchdog »
Gespeichert
 

Seite erstellt in 0.213 Sekunden mit 22 Abfragen.