Linux grub

From Lolly's Wiki
Revision as of 16:20, 25 November 2021 by Lollypop (talk | contribs) (Text replacement - "<source" to "<syntaxhighlight")
Jump to navigationJump to search

Grub Linux

grub rescue>

The problem: <syntaxhighlight lang=bash> ... Entering rescue mode... grub rescue> </source>


Get into the normal grub

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

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. <syntaxhighlight lang=bash> grub rescue> ls (lvm/vg--root-lv--root)/boot/grub/i386-pc ... normal.mod ... </source>

Set the prefix to the right place

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

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

<syntaxhighlight lang=bash> grub rescue> insmod normal grub rescue> normal </source>

If the menu not occurs you get something like this: <syntaxhighlight lang=bash>

                 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> </source>

Normal grub is bootet, now start the Kernel

Example for LVM: <syntaxhighlight lang=bash> 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 </source>

Example for ZFS-Root: <syntaxhighlight lang=bash> 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 </source>