ZhoubaWiki:GrubShellBoot

From ZhoubaWiki
Jump to: navigation, search

Grub Shell Boot

Sometimes an installation of Grub bootloader fails on the halfway, probably caused by changing partitions order or so. In cases like this either Grub Shell or Grub Rescue shell is presented.

This section shows how to manually boot a system from the Grub Shell. The Grub shell offers an autocomplete feature, so utilize it to save your fingers.

1/ list disks and partitions <syntaxhighlight> grub> ls </syntaxhighlight>

2/ identify your partition by listing partion contents like this: <syntaxhighlight> grub> ls (hd0,gpt5)/ </syntaxhighlight>

3/ Set root partition. No spaces around equals sign! <syntaxhighlight> grub> set root=(hd0,gpt5) </syntaxhighlight>

4/ Set path to a linux image. Autocomplete your way out or use symlinks generated to system root in case your GNU/Linux distro prepares them for you. (if not, use /boot/vmlinuz-XXXX instead) <syntaxhighlight> grub> linux /vmlinuz root=/dev/nvme0n1p5 </syntaxhighlight>

  • use linuxefi command for UEFI native mode partitions
  • root param must not be forgotten!

5/ Set path to an initrd. Autocomplete your way out or use symlinks generated to system root in case your GNU/Linux distro prepares them for you. (if not, use /boot/initrd-XXXX instead) <syntaxhighlight> grub> initrd /initrd.img </syntaxhighlight>

  • use initrdefi command for UEFI native mode partitions

6/ Boot! <syntaxhighlight> grub> boot </syntaxhighlight>

  • Your system should be booting right now in case everything went OK.