DEV Community

Cover image for Launching system from GRUB2 console
pgrz
pgrz

Posted on

1 1

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.

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay