Grub: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
(2 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt) | |||
Zeile 42: | Zeile 42: | ||
chroot /t | chroot /t | ||
dpkg-reconfigure grub-pc | dpkg-reconfigure grub-pc | ||
</pre> | |||
= Beispiele = | |||
<pre> menuentry "configfile hd0,gpt4" { | |||
insmod part_gpt | |||
insmod btrfs | |||
insmod ext2 | |||
set root='hd0,gpt4' | |||
configfile /boot/grub/grub.cfg | |||
} | |||
menuentry "Other Linux" { | |||
# assuming that UUID is 763A-9CB6 | |||
search --no-floppy --set=root --fs-uuid 763A-9CB6 | |||
# search by label OTHER_LINUX (make sure that partition label is unambiguous) | |||
#search --no-floppy --set=root --label OTHER_LINUX | |||
linux /boot/vmlinuz (add other options here as required, for example: root=UUID=763A-9CB6) | |||
initrd /boot/initrd.img (if the other kernel uses/needs one) | |||
} | |||
menuentry "Other Linux" { | |||
set root=(hd0,2) | |||
linux /boot/vmlinuz (add other options here as required) | |||
initrd /boot/initrd.img (if the other kernel uses/needs one) | |||
} | |||
</pre> | |||
= Tipps = | |||
* Dauerhaft Menü einblenden: Modifizieren von /etc/grub.d/40_custom: | |||
<pre> | |||
#!/bin/sh | |||
exec tail -n +3 $0 | |||
# This file provides an easy way to add custom menu entries. Simply type the | |||
# menu entries you want to add after this comment. Be careful not to change | |||
# the 'exec tail' line above. | |||
menuentry "start config from /dev/sda3" { | |||
search --no-floppy --fs-uuid --set=root 85d66001-4f02-402a-96ea-14458a4eb305 | |||
configfile /boot/grub/grub.cfg | |||
} | |||
</pre> | </pre> |
Aktuelle Version vom 22. Februar 2022, 14:58 Uhr
Links[Bearbeiten]
Grub und BtrFS[Bearbeiten]
linux /@/boot/vmlinuz-5.0.0-32-generic root=UUID=.... rootflags=subvol=@ initrd /@/boot/vmlinuz-5.0.0-32-generic
Boot-Recovery[Bearbeiten]
- Wenn das "normale" Grub-Menü angezeigt wird, mit "c" kommt man in die Grub-Kommandozeile
- Wenn nach dem Booten die Grub-Shell (Zeilenanfang "grub>") angezeigt wird, können evt. folgende Befehle helfen:
# Info für uber die 1.te Platte (z.B. sda), erste Partition: ls (hd0,1) # Laden des Grub-Menüs von der 2.ten Platte: configfile (hd1,1)/boot/grub/grub.cfg # Laden des Grub-Menüs von der 1.ten Platte: configfile (hd0,1)/boot/grub/grub.cfg # Grub mitteilen, wo die Konfiguration liegt: set prefix=(hd1,1)/boot/grub insmod normal # Starten des Standard-Bootmenüs: normal # Starten ohne Konfiguration linux /boot/vmlinuz root=/dev/sdb1 initrd /boot/initrd.img boot
Grub-Konfiguration korrigieren[Bearbeiten]
setxkbmap de DEV=sda2 mkdir /t mount /dev/$DEV /t for dir in proc dev sys; do mount -o bind /$dir /t/$dir done chroot /t dpkg-reconfigure grub-pc
Beispiele[Bearbeiten]
menuentry "configfile hd0,gpt4" { insmod part_gpt insmod btrfs insmod ext2 set root='hd0,gpt4' configfile /boot/grub/grub.cfg } menuentry "Other Linux" { # assuming that UUID is 763A-9CB6 search --no-floppy --set=root --fs-uuid 763A-9CB6 # search by label OTHER_LINUX (make sure that partition label is unambiguous) #search --no-floppy --set=root --label OTHER_LINUX linux /boot/vmlinuz (add other options here as required, for example: root=UUID=763A-9CB6) initrd /boot/initrd.img (if the other kernel uses/needs one) } menuentry "Other Linux" { set root=(hd0,2) linux /boot/vmlinuz (add other options here as required) initrd /boot/initrd.img (if the other kernel uses/needs one) }
Tipps[Bearbeiten]
- Dauerhaft Menü einblenden: Modifizieren von /etc/grub.d/40_custom:
#!/bin/sh exec tail -n +3 $0 # This file provides an easy way to add custom menu entries. Simply type the # menu entries you want to add after this comment. Be careful not to change # the 'exec tail' line above. menuentry "start config from /dev/sda3" { search --no-floppy --fs-uuid --set=root 85d66001-4f02-402a-96ea-14458a4eb305 configfile /boot/grub/grub.cfg }