You are not logged in.

#1 2024-04-06 10:06:40

Martin
Member
From: Stockholm, Sweden
Registered: 2015-10-01
Posts: 799
Website

Linux does not boot, only get grub prompt

After all these years with Debian based distros and GRUB this is a new one.

This morning I did my usual news reading and browsing fora like this one. I checked for updates and found none. I may have run sudo apt autoremove but I am not sure.

Now, two hours later when I fire up the computer I get a grub prompt. Restarting does not help.

I think I need some advice before trying things. I don't want to bork this system (I was about to backup personal data).

HW is 6 months old. Single boot Linux.

TIA

/Martin


"Problems worthy of attack
prove their worth by hitting back."
Piet Hein

Offline

#2 2024-04-06 11:46:21

unklar
Back to the roots 1.9
From: #! BL
Registered: 2015-10-31
Posts: 2,640

Re: Linux does not boot, only get grub prompt

Usually

ls # alle Partitionen anzeigen lassen
grub rescue> set prefix=(hd0,msdos1)/boot/grub 
grub rescue> set root=(hd0,msdos1)
grub rescue> insmod normal
grub rescue> normal

afterwards

dpkg-reconfigure grub-pc
update-grub

Offline

#3 2024-04-06 11:47:28

altman
Member
From: Canada
Registered: 2015-10-24
Posts: 619

Re: Linux does not boot, only get grub prompt

Is that a fresh install @Martin !


My Linux installs are as in my music; it s on Metal

Offline

#4 2024-04-06 22:30:37

Martin
Member
From: Stockholm, Sweden
Registered: 2015-10-01
Posts: 799
Website

Re: Linux does not boot, only get grub prompt

unklar wrote:

Usually

ls # alle Partitionen anzeigen lassen
grub rescue> set prefix=(hd0,msdos1)/boot/grub 
grub rescue> set root=(hd0,msdos1)
grub rescue> insmod normal
grub rescue> normal

afterwards

dpkg-reconfigure grub-pc
update-grub

Just to make sure I understand:
* The first five commands at the grub command prompt (= "grub rescue>" in your code).
* The last two once Linux is up and running again.

Right?

@altman: Installed in November last year I think. Debian 12 stable and kept up-to-date.

/Martin


"Problems worthy of attack
prove their worth by hitting back."
Piet Hein

Offline

#5 2024-04-06 23:08:57

altman
Member
From: Canada
Registered: 2015-10-24
Posts: 619

Re: Linux does not boot, only get grub prompt

Oh, thx for this, @Martin, I wasn t sure, I tought that you reinstalled, well it s after the last update then, I check again . Hope we ll find something in order to fix your issues, @unlar has great tips in there.

Last edited by altman (2024-04-06 23:09:36)


My Linux installs are as in my music; it s on Metal

Offline

#6 2024-04-07 01:10:06

marens
Member
From: World without M$
Registered: 2023-02-02
Posts: 827

Re: Linux does not boot, only get grub prompt

@Martin

Very unusual.
Without an update/upgrade nothing like this should happen if you haven't changed any system files.

Anyway I would try this:
https://www.linkedin.com/pulse/how-repa … rachynskyi

Good luck and let's hope for the best!


If people would know how little brain is ruling the world, they would die of fear.

Offline

#7 2024-04-07 01:40:13

r.chaffee53
Member
Registered: 2023-08-02
Posts: 123

Re: Linux does not boot, only get grub prompt

Please try to boot with a thumb drive with rEFInd boot manager on it.

http://www.rodsbooks.com/refind/index.html
DL the iso, write it to a thumb drive and boot it.

It will see your Debian install and boot it, even if GRUB is broken.
Than you can rebuild GRUB from within your installed OS.
And or make backups.

Any questions ask.
Bob

Last edited by r.chaffee53 (2024-04-07 02:20:41)

Offline

#8 2024-04-07 08:21:54

unklar
Back to the roots 1.9
From: #! BL
Registered: 2015-10-31
Posts: 2,640

Re: Linux does not boot, only get grub prompt

Martin wrote:
unklar wrote:

Usually

ls # alle Partitionen anzeigen lassen
grub rescue> set prefix=(hd0,msdos1)/boot/grub 
grub rescue> set root=(hd0,msdos1)
grub rescue> insmod normal
grub rescue> normal

afterwards

dpkg-reconfigure grub-pc
update-grub

Just to make sure I understand:
* The first five commands at the grub command prompt (= "grub rescue>" in your code).
* The last two once Linux is up and running again.

Right?

@altman: Installed in November last year I think. Debian 12 stable and kept up-to-date.

/Martin


There are basically two repair methods:

-the first one you see in front of you (grub-prompt/shell/rescure). It is the simplest, but has a limited command set and the user should know where the configuration files are located. Or, the user can 'move' to these configuration files with the TAB key, because Grub can show him this.

-The second method is the chroot method, where you chroot into the affected system from a live ISO and then perform the repair. All terminal commands are available as if you were directly in this system.


Nobody here knows what the best method is in your case.
a) because the mishap happened without your intervention
b) because nobody knows the system except you.

so, you would have to communicate that.  wink

Last edited by unklar (2024-04-07 08:50:56)

Offline

#9 2024-04-07 10:41:29

altman
Member
From: Canada
Registered: 2015-10-24
Posts: 619

Re: Linux does not boot, only get grub prompt

Wonder if Recatux cd iso would help on that also.


My Linux installs are as in my music; it s on Metal

Offline

#10 2024-04-07 11:46:19

Martin
Member
From: Stockholm, Sweden
Registered: 2015-10-01
Posts: 799
Website

Re: Linux does not boot, only get grub prompt

Being cautious I started by backing up my data to an external drive. Since I used a Spiral Linux live ISO for this purpose I continued with the process outlined here: https://www.linkedin.com/pulse/how-repa … rachynskyi

Step 1:

sudo fdisk -l

yields

/dev/nvme01p1 is a 300M EFI System
/dev/nvme01p2 is a 931.2G Linux filesystem

Step 2:

sudo mount /dev/nvme01p2 /mnt

Step 3:

sudo mount /dev/nvme01p2 /mnt/boot/efi

yields

mount: /mnt/boot/efi does not exist.

Hmpf!

The instructions for Step 3 actually says:

sudo mount /dev/sda1 /mnt/boot/efi sudo grub-install --boot-directory=/mnt/boot --efi-directory=/mnt/boot/efi --removable /dev/sda1

and there is a comment afterwards: "Note: Here, /dev/sdX is the entire disk and NOT a specific partition."

So where did I go wrong? Should I have used something else than "nvme01p2" in Step 3 or the lack of /mnt/boot/efi the root of my problem?

This system creates snapshots and looking there I find /boot/efi and /boot/grub folders. I should be able to boot a snapshot using Grub but since Grub is out of order...

I am lost for now and rely on my secondary computer for this communication.

/Martin

PS Just found a slightly different description here: https://github.com/orgs/SpiralLinux/discussions/303


"Problems worthy of attack
prove their worth by hitting back."
Piet Hein

Offline

#11 2024-04-07 13:12:05

PackRat
jgmenu user Numero Uno
Registered: 2015-10-02
Posts: 2,611

Re: Linux does not boot, only get grub prompt

mount: /mnt/boot/efi does not exist.

That might be the problem.

Is this a BunsenLabs or Spiral Linux install?

Debian Wiki GrubEFIReinstall - https://wiki.debian.org/GrubEFIReinstall


You must unlearn what you have learned.
    -- yoda

Offline

#12 2024-04-07 13:13:39

Martin
Member
From: Stockholm, Sweden
Registered: 2015-10-01
Posts: 799
Website

Re: Linux does not boot, only get grub prompt

Spiral Linux

/Martin


"Problems worthy of attack
prove their worth by hitting back."
Piet Hein

Offline

#13 2024-04-07 13:30:29

r.chaffee53
Member
Registered: 2023-08-02
Posts: 123

Re: Linux does not boot, only get grub prompt

If the problem is a broken GRUB loader, rEFInd boot manager will boot your installed OS.
Then you can do a simple(er) reinstall grub.

Good luck.
Bob

Offline

#14 2024-04-07 13:45:43

sleekmason
zoom
Registered: 2018-05-22
Posts: 1,103
Website

Re: Linux does not boot, only get grub prompt

Another option that should work, and I'm testing now to make sure, is to just reinstall with spiral, making sure to keep your partitions and NOT reformat.  Use the same username and password, make sure to use add the efi partition and grub should be installed as well.  This, for both Calamares and the debian installer. 

It will be a half hour or so before I can run through it myself to double check.

Offline

#15 2024-04-07 14:47:32

sleekmason
zoom
Registered: 2018-05-22
Posts: 1,103
Website

Re: Linux does not boot, only get grub prompt

^ Neither method had any difficulties.  Calamares worked beautifully for this, doing manual partitioning and making sure to select /boot/efi as well as the partitions you want to keep, and not reformatting.

The debian installer gives a warning about installing to an unclean setup, but had zero issues as well. I didn't bother with the expert installer. The regular installer worked fine.  Only caveat here is if using osprober, you may need to reactivate it.  If your system still doesn't work, you could always reinstall / leaving /home (if used) unformatted.  Anyway, just another option if you don't get it fixed. Good luck!

Offline

#16 2024-04-07 16:08:10

Martin
Member
From: Stockholm, Sweden
Registered: 2015-10-01
Posts: 799
Website

Re: Linux does not boot, only get grub prompt

Interesting use of installer I had not thought of.

/Martin


"Problems worthy of attack
prove their worth by hitting back."
Piet Hein

Offline

#17 2024-04-07 17:30:24

unklar
Back to the roots 1.9
From: #! BL
Registered: 2015-10-31
Posts: 2,640

Re: Linux does not boot, only get grub prompt

Martin wrote:

Step 1:

sudo fdisk -l

yields

/dev/nvme01p1 is a 300M EFI System
/dev/nvme01p2 is a 931.2G Linux filesystem

That's strange, the fdisk output looks different for me...

Step 2:

sudo mount /dev/nvme01p2 /mnt

Step 3:

sudo mount /dev/nvme01p2 /mnt/boot/efi

That is wrong. Your efi is called nvme01p1.

I'm not sure, could it be that the partitioning of the nwme was done with M$-WIN and this is the reason for the changed behavior of Grub?

Offline

#18 2024-04-07 17:32:34

el_koraco
Member
Registered: 2016-02-08
Posts: 307

Re: Linux does not boot, only get grub prompt

Martin wrote:

Step 3:

sudo mount /dev/nvme01p2 /mnt/boot/efi

yields

mount: /mnt/boot/efi does not exist.

You have to create the directory that you want to mount to.
Just boot an arch linux live cd, do this:

mkdir -p /mnt/boot/efi
mount /dev/nvme01p1 /mnt
mount /dev/nvme01p2 /mnt/boot/efi
arch-chroot /mnt
grub-install
exit

Last edited by el_koraco (2024-04-07 17:32:46)

Offline

#19 2024-04-07 17:41:51

Martin
Member
From: Stockholm, Sweden
Registered: 2015-10-01
Posts: 799
Website

Re: Linux does not boot, only get grub prompt

Martin wrote:

Interesting use of installer I had not thought of.

/Martin

But it did not work. The installation script gave me an error message related to btrfs. I tried twice with the same outcome.

I have now installed from scratch. I am restoring data from my backup as we speak.

/Martin


"Problems worthy of attack
prove their worth by hitting back."
Piet Hein

Offline

Board footer

Powered by FluxBB