Linux grub

From Lolly's Wiki
Jump to navigationJump to search

Grub Linux

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