DEV Community

Cover image for Launching system from GRUB2 console
pgrz
pgrz

Posted on

Launching system from GRUB2 console

Note: these are my self-help notes. Please let me know if they're wrong :)

A Linux system that isn't visible in Grub2 can be launched using Grub2 console.

0. Entering the console

To enter the grub2 console you need to press c key.

1. Choosing the device

The ls command prints out all the disk devices formatted as (hd0), (hd0,msdos1), (hd0,msdos2) which translates to /dev/sda, /dev/sda1, /dev/sda2.

You choose the disk using set root=(hd0,1).

2. Choosing the kernel and system image

Now you can view the disk content using ls. You should be looking for vmlinuz* and initrd* files in /boot subdirectory.

After finding them you need to set them:

linux /boot/vmlinuz-3.13.0-29-generic root=/dev/sda1

initrd /boot/initrd.img-3.13.0-29-generic

The root argument isn't required but omitting it may result in errors when grub2 runs from another device like a pendrive or live cd.

It's crucial to point to the same version in both commands. In case the system became unbootable after kernel upgrade you obviously need to specify the older version.

3. Booting

The final touch is the boot command.

Top comments (0)