You are not logged in.

#1 2022-10-16 22:47:56

ralvez
Member
From: Canada
Registered: 2005-12-06
Posts: 1,694
Website

Messed up my grub [SOLVED]

I messed up my grub config by accident and now my system does not boot.
I then used an installation USB to repair it but it's not working and I'm sure I'm doing something wrong.

This is what I have done:
1. Boot with install USB.
2. Created a directory /mnt/restore.
3. Mount the old paritition where the grub.cfg  is into /mnt/restore
4. Edited the /mnt/restore/etc/default/grub file
5. Tried to execute grub-config but it is a no go.

What am I doing wrong? I'm know I'm doing something basically wrong but I cannot see it.

Thanks.

Last edited by ralvez (2022-10-17 01:34:17)

Offline

#2 2022-10-16 22:49:48

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,466

Re: Messed up my grub [SOLVED]

mount all of your partitions, arch-chroot, then regenerate the config.

Offline

#3 2022-10-16 22:55:02

ralvez
Member
From: Canada
Registered: 2005-12-06
Posts: 1,694
Website

Re: Messed up my grub [SOLVED]

Oh! I see.
I thought that if I placed all the parititions in one /mnt/restore I would have everything I needed.
So I have to mount them as if it is a new install. Correct?

Thanks.

Offline

#4 2022-10-16 23:05:57

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,131

Re: Messed up my grub [SOLVED]

ralvez wrote:

Oh! I see.
I thought that if I placed all the parititions in one /mnt/restore I would have everything I needed.
So I have to mount them as if it is a new install. Correct?

Yes. So if, say you normally have 2 partitions:

/
/boot/

you'd have

/mnt/restore/
/mnt/restore/boot/

and you'd do

arch-chroot /mnt/restore

before regenerating grub.cfg and reinstalling grub, if necessary.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#5 2022-10-16 23:14:24

ralvez
Member
From: Canada
Registered: 2005-12-06
Posts: 1,694
Website

Re: Messed up my grub [SOLVED]

OK. I did that but ...
The new grub.conf was successfully created, however, the system does not find the boot configuration and
after it display "Grub Welcome", or something like that it goes into the BIOS asking me to setup a boot sequence.

Ideas?

Offline

#6 2022-10-17 00:06:20

ralvez
Member
From: Canada
Registered: 2005-12-06
Posts: 1,694
Website

Re: Messed up my grub [SOLVED]

I've followed this sequence but I cannot get things to work.

1. Boot with install USB.
2. Mount /dev/nvme0n1p3 to /mnt
3. Mount /dev/nvme0n1p5 to /mnt/efi
4. Mount /dev/nvme0n1p3 to /mnt/home
5. arch-chroot /mnt
6. grub-install --target=i386-pc /dev/nvme0n1
7. grub-makecfg -o /boot/grub/grub.cfg

I get no errors but upon re-boot I get the "Welcome to GRUB" for 2 secs. and then it goes into BIOS configuration

Am I missing something?
This is getting stressful ... smile

Thanks.

Last edited by ralvez (2022-10-17 00:07:15)

Offline

#7 2022-10-17 01:30:34

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,131

Re: Messed up my grub [SOLVED]

That's not how you install grub if you're booting UEFI. See https://wiki.archlinux.org/title/GRUB#UEFI_systems.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#8 2022-10-17 01:33:36

ralvez
Member
From: Canada
Registered: 2005-12-06
Posts: 1,694
Website

Re: Messed up my grub [SOLVED]

@cfr,

Hi, I just realized my mistake.
grub-install --target=x86_64-efi --efi-directory=/efi --bootloader-id=GRUB fixed the problem.

Thank you all!

Offline

Board footer

Powered by FluxBB