Linux grub: Difference between revisions

From Lolly's Wiki
Jump to navigationJump to search
(Die Seite wurde neu angelegt: „Grub Linux =grub rescue>= The problem: <source lang=bash> ... Entering rescue mode...…“)
 
m (Text replacement - "</source" to "</syntaxhighlight")
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
[[Kategorie:Linux|Grub]]
[[Category:Linux|Grub]]
[[Kategorie:Grub|Linux]]
[[Category:Grub|Linux]]
=grub rescue>=
=grub rescue>=
The problem:
The problem:
<source lang=bash>
<syntaxhighlight lang=bash>
...
...
Entering rescue mode...                                                         
Entering rescue mode...                                                         
grub rescue>         
grub rescue>         
</source>
</syntaxhighlight>




Line 13: Line 13:


Find your devices:
Find your devices:
<source lang=bash>
<syntaxhighlight lang=bash>
grub rescue> ls
grub rescue> ls
</source>
</syntaxhighlight>


===Find the directory where the normal.mod file resides===
===Find the directory where the normal.mod file resides===
In this example we have LVM and the /boot/grub is in VG vg-root and the LV lv-root.
In this example we have LVM and the /boot/grub is in VG vg-root and the LV lv-root.
<source lang=bash>
<syntaxhighlight lang=bash>
grub rescue> ls (lvm/vg--root-lv--root)/boot/grub/i386-pc
grub rescue> ls (lvm/vg--root-lv--root)/boot/grub/i386-pc
... normal.mod ...
... normal.mod ...
</source>
</syntaxhighlight>


===Set the prefix to the right place===
===Set the prefix to the right place===
<source lang=bash>
<syntaxhighlight lang=bash>
grub rescue> set prefix=(lvm/vg--root-lv--root)/boot/grub
grub rescue> set prefix=(lvm/vg--root-lv--root)/boot/grub
</source>
</syntaxhighlight>


===Now you can load and start the module called "normal"===
===Now you can load and start the module called "normal"===
<source lang=bash>
<syntaxhighlight lang=bash>
grub rescue> insmod normal
grub rescue> insmod normal
grub rescue> normal
grub rescue> normal
</source>
</syntaxhighlight>


If the menu not occurs you get something like this:
If the menu not occurs you get something like this:
<source lang=bash>
<syntaxhighlight lang=bash>
                   GNU GRUB  version 1.99,5.11.0.175.2.0.0.42.2
                   GNU GRUB  version 1.99,5.11.0.175.2.0.0.42.2


Line 44: Line 44:


grub>
grub>
</source>
</syntaxhighlight>


==Normal grub is bootet, now start the Kernel==
==Normal grub is bootet, now start the Kernel==
Example for LVM:
Example for LVM:
<source lang=bash>
<syntaxhighlight lang=bash>
insmod gzio
insmod gzio
insmod part_msdos
insmod part_msdos
Line 56: Line 56:
linux  /boot/vmlinuz-4.4.0-53-generic root=/dev/mapper/vg--root-lv--root ro   
linux  /boot/vmlinuz-4.4.0-53-generic root=/dev/mapper/vg--root-lv--root ro   
initrd  /boot/initrd.img-4.4.0-53-generic
initrd  /boot/initrd.img-4.4.0-53-generic
</source>
</syntaxhighlight>


Example for ZFS-Root:
Example for ZFS-Root:
<source lang=bash>
<syntaxhighlight lang=bash>
insmod gzio
insmod gzio
insmod part_msdos
insmod part_msdos
Line 66: Line 66:
linux  /ROOT/ubuntu-15.04@/boot/vmlinuz-4.4.0-57-generic root=ZFS=rpool/ROOT/ubuntu-15.04 boot=zfs zfs_force=1 ro  quiet splash nomdmonddf nomdmonisw $vt_handoff
linux  /ROOT/ubuntu-15.04@/boot/vmlinuz-4.4.0-57-generic root=ZFS=rpool/ROOT/ubuntu-15.04 boot=zfs zfs_force=1 ro  quiet splash nomdmonddf nomdmonisw $vt_handoff
initrd  /ROOT/ubuntu-15.04@/boot/initrd.img-4.4.0-57-generic
initrd  /ROOT/ubuntu-15.04@/boot/initrd.img-4.4.0-57-generic
</source>
</syntaxhighlight>

Latest revision as of 17:51, 25 November 2021

grub rescue>

The problem:

...
Entering rescue mode...                                                         
grub rescue>


Get into the normal grub

Find your devices:

grub rescue> ls

Find the directory where the normal.mod file resides

In this example we have LVM and the /boot/grub is in VG vg-root and the LV lv-root.

grub rescue> ls (lvm/vg--root-lv--root)/boot/grub/i386-pc
... normal.mod ...

Set the prefix to the right place

grub rescue> set prefix=(lvm/vg--root-lv--root)/boot/grub

Now you can load and start the module called "normal"

grub rescue> insmod normal
grub rescue> normal

If the menu not occurs you get something like this:

                  GNU GRUB  version 1.99,5.11.0.175.2.0.0.42.2

   Minimal BASH-like line editing is supported. For the first word, TAB
   lists possible command completions. Anywhere else TAB lists possible
   device or file completions.

grub>

Normal grub is bootet, now start the Kernel

Example for LVM:

insmod gzio
insmod part_msdos
insmod lvm
insmod ext2
set root='lvmid/KAlPF4-Qb8I-Sx41-10cC-lACw-Msoh-3qEohv/pmE9Nt-rLG3-FlNM-CwOT-hy42-gSnm-fZSn3l'
linux   /boot/vmlinuz-4.4.0-53-generic root=/dev/mapper/vg--root-lv--root ro  
initrd  /boot/initrd.img-4.4.0-53-generic

Example for ZFS-Root:

insmod gzio
insmod part_msdos
insmod zfs
set root='hd0,msdos4'
linux   /ROOT/ubuntu-15.04@/boot/vmlinuz-4.4.0-57-generic root=ZFS=rpool/ROOT/ubuntu-15.04 boot=zfs zfs_force=1 ro  quiet splash nomdmonddf nomdmonisw $vt_handoff
initrd  /ROOT/ubuntu-15.04@/boot/initrd.img-4.4.0-57-generic