Restore grub

I have dual boot, Manjaro xfce and Windows 10. Windows asked for a major update, I clicked yes, and when it was time for rebooting I received the message that I have no operating system installed. I god mad with Windows because it ruined the grub, so I deleted the partition on which it was installed. Now I am trying (without success until now) to restore the grub for Manjaro. I can boot into Manjaro with live cd and grub prompt, and write these 2 lines:
grub> search -f /boot/intel-ucode.img --set=root
grub> configfile /boot/grub/grub.cfg
After I write them, the system boots, and I can use it normally until the first restart. I tried to install chroot, but I receive the message: No linux system found !

I tried to follow this tutorial https://wiki.manjaro.org/index.php/Restore_the_GRUB_Bootloader , but without success. Here is the output of some commands in the terminal: https://pastebin.com/XkRjjS9T

LE: I forgot to mention, before being able to boot into Manjaro, I receive the next message:
error: file /boot/grub/grubenv’ not found.
Loading Linux 4.14.3-1-MANJARO x64 …
Loading initial ramdisk …

Press any key to continue…

And when I press any key, it boots

I think you forgot after booting to Manjaro (using configfile) to do

sudo grub-install
sudo update-grub

As for “error: file /boot/grub/grubenv’ not found.”, do

sudo rm /boot/grub/grubenv
sudo grub-editenv /boot/grub/grubenv create

ps; if msdos/bios-legacy, it is “sudo grub-install /dev/sda”

I have done this, but without changes: https://pastebin.com/8Wwg87bN . If I use chroot, it still says that “No linux system found”

Oh… you use chroot. and then configfile? Or configfile and then chroot? Wont’ work.
Where’s the link you use that suggest you use configfile? Something’s missing.
I thought you use this or this.. No chroot. But configfile is best if used correctly.

ps: don’t forget to grub-install and update-grub after you boot up installed OS.

After that you don’t need chroot, just reboot.
Did you reboot?
What do you mean with “without changes”?

I have used exactly the 2 links that you posted. I tried with chroot after configfile, but just for curiosity, to see if it detects the operating system or not. I found the links in another topic (Restore GRUB after Windoows 10 reinstall) about restoring grub in which you posted the solution, and I tried that before opening this one, but unfortunately it didn’t work.

Aditionally, I tried also what wrote here: https://wiki.manjaro.org/index.php/Restore_the_GRUB_Bootloader , but still without success

With “without changes”, I meant that still I was not able to boot into Manjaro without the live cd, and the 2 commands in grub prompt

Does anyone think this is something

Installing for i386-pc platform.

No, do not chroot after configfile.
No chroot.

What else can I try?

I ran these commands in console (from installed Manjaro, not live cd), but still it doesn’t boot after reboot:
[radu@radu-pc ~]$ sudo mount /dev/sda /mnt
[sudo] password for radu:
mount: /mnt: /dev/sda already mounted or mount point busy.
[radu@radu-pc ~]$ sudo grub-install --boot-directory=/mnt/boot /dev/sda
Installing for i386-pc platform.
Installation finished. No error reported.
[radu@radu-pc ~]$ sudo grub-install /dev/sda
Installing for i386-pc platform.
Installation finished. No error reported.
[radu@radu-pc ~]$ sudo update-grub
Generating grub configuration file …
Found background: /usr/share/grub/background.png
Found Intel Microcode image
Found linux image: /boot/vmlinuz-4.14-x86_64
Found initrd image: /boot/initramfs-4.14-x86_64.img
Found initrd fallback image: /boot/initramfs-4.14-x86_64-fallback.img
Found linux image: /boot/vmlinuz-4.9-x86_64
Found initrd image: /boot/initramfs-4.9-x86_64.img
Found initrd fallback image: /boot/initramfs-4.9-x86_64-fallback.img
Found Windows 7 on /dev/sda1
Found memtest86+ image: /boot/memtest86+/memtest.bin
done

So, do it once more. Then you 'll be an expert.
Boot in your system, or maybe you are already in Manjaro.

Try in terminal
lsblk

Do you happen to have another disk as well?
Do you have a USB drive attached?

The method configfile (no chroot) will work whether it is bios-legacy or uefi.
Just that for bios-legacy, grub-install command will be

And this command (with /dev/sda) will also work in uefi (though unnecessary (with /dev/sda)).

You mounted the device (sda).
You should mount partition (sdax)
And from the installed OS, there is no need to even mount /mnt.
Just ‘grub-install /dev/sda’ and ‘update-grub’

Just to repeat again (bad english, but so what)

After booted up to installed OS,

sudo grub-install /dev/sda
sudo update-grub

Do not mount anything. not to /mnt or /dev/sda or /dev/sdax or anything else

And if error message, provide what the error message is.

lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 167,7G 0 disk
├─sda1 8:1 0 68,4G 0 part
└─sda2 8:2 0 83,6G 0 part /
sr0 11:0 1 1024M 0 rom

I have only one disk. Now I don’t have any usb introduced. But I need to put it in when I use grub prompt. After I remove it.

I’ve done this again:

sudo grub-install /dev/sda
[sudo] password for radu:
Installing for i386-pc platform.
Installation finished. No error reported.
[radu@radu-pc ~]$ sudo update-grub
Generating grub configuration file …
Found background: /usr/share/grub/background.png
Found Intel Microcode image
Found linux image: /boot/vmlinuz-4.14-x86_64
Found initrd image: /boot/initramfs-4.14-x86_64.img
Found initrd fallback image: /boot/initramfs-4.14-x86_64-fallback.img
Found linux image: /boot/vmlinuz-4.9-x86_64
Found initrd image: /boot/initramfs-4.9-x86_64.img
Found initrd fallback image: /boot/initramfs-4.9-x86_64-fallback.img
Found Windows 7 on /dev/sda1
Found memtest86+ image: /boot/memtest86+/memtest.bin
done

Now I am able to boot Manjaro normally. Thanks a lot to everybody for the help

Try
fdisk -l
please.

It looks weird, man. Is it alien?

Your manjaro is listed above.
Are you saying it won’t show in the grub menu when you reboot?

Oh your new edit. to your post.

You’re welcome.

It was exactly the same as your previous post of the grub install???
Anyway good job guys. :grin:

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.