Linux grub: Difference between revisions

From Lolly's Wiki
Jump to navigationJump to search
m (Text replacement - "[[Kategorie:" to "[[Category:")
m (Text replacement - "</source" to "</syntaxhighlight")
Line 7: Line 7:
Entering rescue mode...                                                         
Entering rescue mode...                                                         
grub rescue>         
grub rescue>         
</source>
</syntaxhighlight>




Line 15: Line 15:
<syntaxhighlight 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===
Line 22: Line 22:
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===
<syntaxhighlight 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"===
Line 33: Line 33:
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:
Line 44: Line 44:


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


==Normal grub is bootet, now start the Kernel==
==Normal grub is bootet, now start the Kernel==
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:
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>

Revision as of 16: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