You are not logged in.

#1 2018-05-09 13:36:42

doomguy84
Member
Registered: 2018-05-09
Posts: 48

[SOLVED] Grub Rescue every boot

Hello everyone!!
I changed my SSD from an "old" 120GB Patriot to a brand new 250 GB Samsung 860 Evo.
What I did:

- with GParted used GPT partitioning and created 1 partition of 500MB for /boot (fat32, esp) and 1 partition of 120GB for root (btrfs), the remaining space is for Windows.
- then copied all of the files from the old SSD to the new.
- modified the UUID strings on grub.cfg and /etc/fstab files according to the new ones

the system boot regular, but every boot I need to manual insert these commands:

set prefix (hd0,gpt1)/grub
insmod normal
normal

then the Grub menu appear and I can start Arch.

what should I do??


SOLUTION:

the commands to solve:

sudo grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=arch_grub --recheck --debug
sudo grub-mkconfig -o /boot/grub/grub.cfg

Last edited by doomguy84 (2018-05-17 14:30:50)

Offline

#2 2018-05-10 05:45:22

IrvineHimself
Member
From: Scotland
Registered: 2016-08-21
Posts: 275

Re: [SOLVED] Grub Rescue every boot

Probably heresy around these parts, but I like the gui based Grub Customizer combined with os-prober. If you make a major screw-up, which I do regularly, you still have to re-configure grub manually from a chroot, but for problems like this, it works well.

Edit:
Did you remember to run grub-mkconfig after your edits?

Edit2:
see wiki.archlinux.org/index.php/GRUB

Last edited by IrvineHimself (2018-05-10 06:10:33)


Et voilà, elle arrive. La pièce, le sous, peut-être qu'il arrive avec vous!

Offline

#3 2018-05-10 06:17:36

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,680
Website

Re: [SOLVED] Grub Rescue every boot

doomguy84 wrote:

what should I do?

Make a new NVRAM boot entry that directs GRUB to the correct disk, use the `grub-install` command to do this.

IrvineHimself wrote:

I like the gui based Grub Customizer combined with os-prober [...] for problems like this, it works well.

Not really, the OP cannot see the GRUB menu initially so customising it won't help.

Offline

#4 2018-05-10 12:33:06

doomguy84
Member
Registered: 2018-05-09
Posts: 48

Re: [SOLVED] Grub Rescue every boot

IrvineHimself wrote:

Did you remember to run grub-mkconfig after your edits?

yes I did


Head_on_a_Stick wrote:

Make a new NVRAM boot entry that directs GRUB to the correct disk, use the `grub-install` command to do this.

I tried that command now, but i got an error: "/boot/grub/device.map" cannot be found

another thing, in the Grub Rescue, if I run "set" it shows me "prefix=(hd0,gpt2)/grub" but that is wrong.
the right one is (hd0,gpt1)/grub

so maybe that's why everytime it goes into Rescue mode instead of Menu

but why ??

Offline

#5 2018-05-10 15:06:42

IrvineHimself
Member
From: Scotland
Registered: 2016-08-21
Posts: 275

Re: [SOLVED] Grub Rescue every boot

Failing all else, while it's not as satisfying as tracking down the source of the problem, in the past, after a Defcon level 5 screw up, I have completely un-installed grub; removed any and all residual configuration files in /etc/default/grub and /etc/grub.d/; then, do a complete, fresh install and regeneration of grub.

Head_on_a_Stick wrote:

.... Not really, the OP cannot see the GRUB menu initially so customising it won't help.

Noting that, even after cleaning up several of my own messes, I  am not an expert on grub and I am quite prepared to defer to your expertise, I still have to ask if you are sure about that?

Refering to the wiki and considering what we know:

  1. Grub exists and is crashing because of corrupted menu entries.

  2. I checked, and these entries are all editable through the gui menu

  3. Failing all else, even if grubs' partition table data is wrong, os-prober, should still see the original os as a third installed Os, hence causing the App to create a third, correct, menu entry.

Like I say, I am not an expert, and, if I have this wrong, I appologise in advance.

Irvine


Et voilà, elle arrive. La pièce, le sous, peut-être qu'il arrive avec vous!

Offline

#6 2018-05-10 16:57:21

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,680
Website

Re: [SOLVED] Grub Rescue every boot

doomguy84 wrote:
Head_on_a_Stick wrote:

Make a new NVRAM boot entry that directs GRUB to the correct disk, use the `grub-install` command to do this.

I tried that command now, but i got an error: "/boot/grub/device.map" cannot be found

What was the *exact* command that you used?

Did you follow the instructions in the wiki?

IrvineHimself wrote:

are sure about that?

Actually, no, that may have been a hasty comment hmm

Let's disambiguate things a little: @OP, please post the full output of

# efibootmgr -v

Offline

#7 2018-05-17 14:28:14

doomguy84
Member
Registered: 2018-05-09
Posts: 48

Re: [SOLVED] Grub Rescue every boot

I tried to use rEFInd instead of GRUB2 but the configurazion seems (to me) more difficult.
So i tried again to fix my problem with GRUB2 and now it's all ok.

I used these commands

sudo grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=arch_grub --recheck --debug
sudo grub-mkconfig -o /boot/grub/grub.cfg

I think I will remove rEFInd now...

Thanks to all!!

Offline

Board footer

Powered by FluxBB