(gelöst) grub älteren Kernel als Default booten

Du hast Probleme mit Deinem eMail-Programm, Webbrowser oder Textprogramm? Dein Lieblingsprogramm streikt?
Antworten
ren22

(gelöst) grub älteren Kernel als Default booten

Beitrag von ren22 » 03.11.2019 08:45:28

Hallo,

wie kann ich unter Debian 10 (stable) mit grub(2.02+dfsg1-20) einen ,"älteren" Kernel (4.19.0-6-amd64), als Default booten lassen ?
Unter /boot liegt "vmlinuz-4.19.0-6-amd64" und "vmlinuz-5.3.7" .
GRUB_DEFAULT=3 in /etc/default/grub scheint keine Wirkung zu haben, nach update-grub, reboot, zeigt mir uname -a immer noch Kernel 5.3.7 an.

Danke
Zuletzt geändert von ren22 am 03.11.2019 11:25:41, insgesamt 1-mal geändert.

willy4711

Re: grub älteren Kernel als Default booten

Beitrag von willy4711 » 03.11.2019 08:55:13

Wenn der Kernel richtig installiert ist
wird das durch die Zeile in der /etc/default/grub geregelt.

Code: Alles auswählen

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"
Normalerweise ist die so wie bei mir auskommentiert. Wenn du dann im Grub Menü
auf die "erweiterten Optionen" gehst,
sollten dir neben dem Recovery Mode sämtliche installierten Kernel angezeigt werden.

Edit:
und dann natürlich

Code: Alles auswählen

update-grub

ren22

Re: grub älteren Kernel als Default booten

Beitrag von ren22 » 03.11.2019 10:08:41

guten Morgen Willy

vielleicht sollte ich erwähnen das ich nur Zugriff per ssh habe, also im grub menu kann ich so zu sagen, da ssh, nichts auswählen, daher muss der boot Eintrag automatisch gewählt werden... blos wie?
die /etc/default/grub sieht so aus:

Code: Alles auswählen

# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'

#GRUB_DEFAULT=0
GRUB_DEFAULT=3
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet"
GRUB_CMDLINE_LINUX="video=off console=ttyS0,57600"

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
GRUB_DISABLE_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"
GRUB_TERMINAL=serial
GRUB_SERIAL_COMMAND="serial --unit=0 --speed=57600 --stop=1"
aus der generierten /boot/grub/grub.cfg entnehme ich:

Code: Alles auswählen

sudo grep 'menuentry ' /boot/grub/grub.cfg | cut -f 2 -d "'" | nl -v 0
     0  Debian GNU/Linux
     1  Debian GNU/Linux, with Linux 5.3.7
     2  Debian GNU/Linux, with Linux 4.19.0-6-amd64
     3  Debian GNU/Linux, with Xen hypervisor
     4  Debian GNU/Linux, with Xen 4.12.1 and Linux 5.3.7
     5  Debian GNU/Linux, with Xen 4.12.1 and Linux 4.19.0-6-amd64
     6  Debian GNU/Linux, with Xen 4.12.1.config and Linux 5.3.7
     7  Debian GNU/Linux, with Xen 4.12.1.config and Linux 4.19.0-6-amd64
     8  Debian GNU/Linux, with Xen xenpolicy-4.12.1 and Linux 5.3.7
     9  Debian GNU/Linux, with Xen xenpolicy-4.12.1 and Linux 4.19.0-6-amd64

Code: Alles auswählen

sudo grub-set-default 2
hilft auch nicht ...

Code: Alles auswählen

sudo grub-reboot 2
passiert nichts, und ein reboot bringt mich wieder zurück zu 5.3.7
Zuletzt geändert von ren22 am 03.11.2019 10:47:02, insgesamt 1-mal geändert.

willy4711

Re: grub älteren Kernel als Default booten

Beitrag von willy4711 » 03.11.2019 10:27:34

Hallo, das ist natürlich einen andere Situation.
Hier gab es mal einen Thread dazu, vielleicht hilft es:
viewtopic.php?f=33&t=156305
an die /boot/grub/grub.cfg sollte man tunlichst nicht ran gehen.

Ich mache so was mit dem verpönten Debiangrub-customizer. :facepalm:
Allerdings braucht man da wieder direkten Zugriff (Grafisch) auf den Rechner (VNC möglich ?)

Edit:
Hab noch was gefunden.
nach https://www.tfonfara.de/linux-bootmenu- ... ten-teil-2
kann man wohl auch die Datei /etc/grub.d/00_header bearbeiten. was ich allerdings noch nie getan habe

frogbert
Beiträge: 200
Registriert: 08.11.2008 01:23:45

Re: grub älteren Kernel als Default booten

Beitrag von frogbert » 03.11.2019 11:12:52

in /etc/default/grub:
# For full documentation of the options in this file, see:
# info -f grub -n 'Simple configuration'


"'GRUB_DEFAULT'
The default menu entry. This may be a number, in which case it
identifies the Nth entry in the generated menu counted from zero,
or the title of a menu entry, or the special string 'saved'. Using
the id may be useful if you want to set a menu entry as the default
even though there may be a variable number of entries before it.

For example, if you have:

menuentry 'Example GNU/Linux distribution' --class gnu-linux --id example-gnu-linux {
...
}

then you can make this the default using:

GRUB_DEFAULT=example-gnu-linu"
Also in Deinem Falle in /etc/default/grub ändern:

Code: Alles auswählen

GRUB_DEFAULT="Advanced options for Debian GNU/Linux>Debian GNU/Linux, with Linux 4.19.0-6-amd64"
(vorher vergewissern, ob die Nomenklatur (Andvanced options for Debian GNU/Linux) auch tatsächlich so in der /boot/grub/grub.cfg zu finden ist (nach 'submenu').
#update-grub
oder sudo update-grub
und fertig, nein?

ren22

Re: grub älteren Kernel als Default booten

Beitrag von ren22 » 03.11.2019 11:25:25

endlich .... nach 2 Stunden herum probieren.

Also die Lösung, damit man den "alten" Kernel 4.19.0-6-amd64 als DEFAULT booten kann ist entweder, bei grub <= Version 2.0 in der /etc/grub/default

Code: Alles auswählen

GRUB_DEFAULT='Advanced options for Debian GNU/Linux>Debian GNU/Linux, with Linux 4.19.0-6-amd64' 
oder bei grub >= 2.0 in der /etc/default/grub

Code: Alles auswählen

GRUB_DEFAULT='gnulinux-advanced-ade26d00-d397-4de3-aabf-b3c7df8e5ce1>gnulinux-4.19.0-6-amd64-advanced-ade26d00-d397-4de3-aabf-b3c7df8e5ce1'
gefunden habe ich die Lösung, die gut platziert ist, in der grub Fehlermeldung:
hatte zuerst probiert

Code: Alles auswählen

GRUB_DEFAULT='Debian GNU/Linux, with Linux 4.19.0-6-amd64' 
zu benutzen, aber dann bei einem "grub-update" hat grub den entsprechenden Hinweis gegeben:
Warning: Please don't use old title `Debian GNU/Linux, with Linux 4.19.0-6-amd64' for GRUB_DEFAULT, use `Advanced options for Debian GNU/Linux>Debian GNU/Linux, with Linux 4.19.0-6-amd64' (for versions before 2.00) or `gnulinux-advanced-ade26d00-d397-4de3-aabf-b3c7df8e5ce1>gnulinux-4.19.0-6-amd64-advanced-ade26d00-d397-4de3-aabf-b3c7df8e5ce1' (for 2.00 or later)
zum Schluss nochmal meine jetzige /etc/default/grub die auch den Kernel 4.19.0-6-amd64 bootet

Code: Alles auswählen

cat /etc/default/grub
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'

#GRUB_DEFAULT=0
#GRUB_DEFAULT=2
#GRUB_DEFAULT='Advanced options for Debian GNU/Linux, with Linux 4.19.0-6-amd64'  # for grub < 2.0
GRUB_DEFAULT='gnulinux-advanced-ade26d00-d397-4de3-aabf-b3c7df8e5ce1>gnulinux-4.19.0-6-amd64-advanced-ade26d00-d397-4de3-aabf-b3c7df8e5ce1'
#GRUB_DEFAULT=saved
#GRUB_SAVEDEFAULT=true

GRUB_TIMEOUT=1
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet"
GRUB_CMDLINE_LINUX="video=off console=ttyS0,57600"

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
GRUB_DISABLE_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"
GRUB_TERMINAL=serial
GRUB_SERIAL_COMMAND="serial --unit=0 --speed=57600 --stop=1"
Vielen Dank Willy4711 & frogbert :THX:

Antworten