Skip to main content
Home
The Baheyeldin Dynasty
The journey for wisdom starts with knowledge
  • Home
  • About
  • Site Map
  • Contact

What To Do When Linux Boots To A Grub Prompt?

  1. Home

By Khalid on 2026/05/07 - 12:03, last updated 2026/05/07 - 12:05

What do you do when your Linux machine boots in a Grub prompt?
This happened to me a few weeks ago, and searching resulted in old advice that didn't work for me.
I am on Xubuntu 24.04 LTS, with UEFI.

Among things that you could try are:

  • Hit Enter
  • Type 'boot' then hit Enter

Other advice was to mount the EFI partition and so on.

What ended up working in my case is what I describe in the rest of the article.

The root cause was that the file /etc/default/grub was missing, for some unknown reason.
It is likely that a update renamed it to grub.ucf-dist and didn't complete the update tasks so it ended up missing.

Know Your Partitions
Before you start, it helps to know what your partitions look like.
On my laptop, they are like this:

Device         Mount Point
/dev/nvme0n1p1 /boot/efi
/dev/nvme0n1p2 /

Or they may be like this, depending on whether you use extended partitions:

Device         Mount Point
/dev/nvme0n1p1 /boot/efi
/dev/nvme0n1p5 /

List The Partitions From Grub Prompt
One you boot and you see the grub prompt, enter the ls command.
The output will look something like this:

ls 
(proc) (memdisk) (hd0) (hd0,gpt1), (hd0,gpt5)

We are interested only in the hd0 device and its partitions, since it is the only storage device on the laptop, and the only bootable device.

Search For The Root File System
You need to search for the partition containing the root file systen, which has Linux on it.

Use TAB for autocomplete at the end of the line

ls (hd0,gpt5)/

If there is a boot directory, then list what is in it (use TAB again):

ls (hd0,gpt5)/boot/

You should see files starting with vmlinuz-* and initrd.img-*

Once you have confirmed that this partition is the one that contains Linux images and initrd images, set it as your root

Set Root Partition

set root=(hd0,5)

Set The Linux and Initrd Images
Then tell Grub where the kernel is, and the root partition, in Linux's notation
If you have a hard disk, or SSD, then this will be /dev/sdaX
But in this case it is an NVME.

linux /boot/vmlinuz-6.8.0-110-generic root=/dev/nvme0n1p5

Then tell grub where the initrd file is:

initrd /boot/initrd.img-6.8.0-110-generic

Boot Grub
Finally execute the boot command:

boot

If all works, you should be back in your Linux system.
And now you can proceed with restoring the /etc/default/grub file, and run update-grub.

Contents: 
Linux
Tags: 
Ubuntu
Grub2
  • Add comment

Current

Talks

  • Presentations and Talks

Search

Site map

Contents

  • Family
    • Khalid
    • Ancestry
    • Extended
  • Friends
  • Nokat نكت
  • Writings
    • Cooking
    • Culture
    • Science
    • History
    • Linguistics
    • Media
    • Literature
    • Politics
    • Humor
    • Terrorism
    • Business
    • Philosophy
    • Religion
    • Children
  • Technology
    • Linux
    • Arabization
    • Drupal
      • Association
    • Software
    • Internet
    • Technology in Society
    • Digital Archeology
    • NCR History
    • MidEast Internet
    • Programming
    • Saudi ISPs
    • Miscellaneous
  • Places
    • Canada
      • Weather
    • Egypt
      • Cuisine
      • Alexandria
      • E.G.C.
    • USA
    • Saudi Arabia
  • Interests
    • Astronomy
    • Fishing
    • Photography
    • Snorkeling
    • Nature
    • Photomicroscopy
  • Miscellany

In Depth

  • al-Hakim bi Amr Allah: Fatimid Caliph of Egypt الحاكم بأمر الله
  • Alexandria, Egypt
  • Arabic on the Internet
  • Articles on the history of Muslims and Arabs in the Iberian Peninsula تاريخ المسلمين و العرب في الأند
  • DIY GOTO Telescope Controller With Autoguiding and Periodic Error Correction
  • E.G.C. English Girls College in Alexandria, Egypt
  • Egyptian Cuisine, Food and Recipes مأكولات مصرية
  • George Saliba: Seeking the Origins of Modern Science?
  • Internet Scams and Fraud
  • Mistaken for an Arab or Muslim: Absurdities of being a victim in the War on Terror
  • Mistaken Identity: How some people confuse my site for others
  • One People's Terrorist Is Another People's Freedom Fighter
  • Overview of Google's Technologies
  • Photomicroscopy
  • Pseudoscience: Lots of it around ...
  • Resources for using Google Adsense with Drupal
  • Rockwood Conservation Area, Southern Ontario
  • Selected Symbolic Novels And Movies
  • Snorkeling the Red Sea near Jeddah
  • Updates and Thoughts on the Egyptian Revolution of 2011

Recent Content

Most recent articles on the site.

  • What To Do When Linux Boots To A Grub Prompt?
  • Presentations and Talks
  • How Needrestart on Ubuntu Helps With Security
  • How To Run A Script When Daylight Savings Change
  • Moon Sighting Is Obsolete: Lunar Month Starts Should Be By Astronomical Conjunction
more

Most Comments

Most commented on articles ...

  • Another scam via Craigslist: offering more than asking price
  • Warning to female tourists thinking of marrying Egyptians
  • Craigslist classified for used car: Cheque fraud scam
  • Winning the lottery scam email: World Cup South African lottery
  • Email Scam: BMW 5 Series car and lottery winning
more

About Khalid

Various little bits of information ...

  • Khalid Baheyeldin: brief biography
  • Presentations and Talks
  • Youtube Videos
  • GitHub Projects
  • Drupal.org Profile
  • Astrophotography @ Flickr

Sponsored Links

Your Link Ad Here

Tags

419 Android App Arabic backup Balkanization Comet Conspiracy Coronavirus COVID-19 CPU DIY Ericsson Firefox GSM Home Assistant Kubuntu Laptop Mobile OnStep OpenWRT Python Rogers Router Scam Sony Spectrum tablet Telescope Ubuntu
More

© Copyright 1999-2026 The Baheyeldin Dynasty. All rights reserved.
You can use our content under the Terms of Use.
Please read our privacy policy before you post any information on this site.
All posted articles and comments are copyright by their owner, and reflect their own views and opinions, which may not necessarily be consistent with the views and opinions of the owners of The Baheyeldin Dynasty.

Web site developed by 2bits.com Inc.