Manjaro: Unable to restore Grub

as I mentioned in post no. 17. there are 3 problems.
Actually, everytime I fix something, I move forward and new problem appears.
Grub menu is showed now (cool) but is missing Windows in the menu. I followed the official instruction multiple times - no luck.

So focus this threat on grub and how to add windows there.
I am going to open new thread for failed boot.

Quesion: How to add Windows to grub menu ?

Does your Linux bootup properly yet using Grub or not?
AFTER that works you can ask for assistance for integrating Micro$@$ in the menu.

To add Windows to grub menu just run sudo update-grub once you have booted your Manjaro. For some reason it doesn’t work when booted from the liveUSB.

Can you change to console login with CTRL+ALT+F2 or ALT+F2?

This thread can be closed, it is being continued here:

Summary
Dual boot, two disks. By mistake I did format sda (efi boot and windows partitions). I have not touched sdb (manjaro)

testdisk was able to restore partitions with original data, however I was unable to boot and unable to restore grub.

What helped me
Steps 1&2 I performed from live-usb.

  1. Verify the partition type and flags
sudo parted -l
Model: ATA TOSHIBA MQ02ABF0 (scsi)
Disk /dev/sda: 500GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos
Disk Flags: 

Number  Start   End    Size   Type     File system  Flags
 1      1049kB  316MB  315MB  primary  ntfs         boot
 2      316MB   420MB  105MB  primary  fat32
 3      555MB   500GB  500GB  primary  ntfs

Problems are here:

  • fdisk -l as well as parted -l showed that the disk sda was msdos. However in my case I did remember, it should be GPT
  • boot flag wrongly on 315MB partition. For UEFI, it should be the 100MB, fat32
  • 105MB fat32 missing boot and esp flags

I had to convert /dev/sda (the whole disk) to GPT by issuing command: sudo gdisk /dev/sda
Afterwards, I opened gparted and assigned ESP, BOOT for the 105 MB partition. I removed BOOT flag from the 315 MB partition
This is correct:

[manjaro@manjaro ~]$ sudo parted -l
Model: ATA TOSHIBA MQ02ABF0 (scsi)
Disk /dev/sda: 500GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start   End    Size   File system  Name                  Flags
 1      1049kB  316MB  315MB  ntfs         Microsoft basic data  msftdata
 2      316MB   420MB  105MB  fat32        Microsoft basic data  boot, esp
 3      555MB   500GB  500GB  ntfs         Microsoft basic data  msftdata
  1. Re-install grub
    I followed instructions uefi instructions in my case.
    However after reboot there was no GRUB menu.
    I booted live-usb again and opened grub file: nano /etc/default/grub
    I found GRUB_TIMEOUT_STYLE and instead of hidden I entered menu.
    So correct is: GRUB_TIMEOUT_STYLE=menu
    Then I updated grub: sudo update-grub
    After restart, I can see GRUB menu, however there is only Manjaro, (Windows is missing from the menu)
  1. Add Windows to Grub menu
    It seems, the repair from live-usb does not work for 100%. Somehow, Windows is not detected from live usb, os-prober does show anything.
    So I did boot Manjaro from grub menu and performed following (this time I dont use live usb):
  • pacman -Syu grub - this time it didnt report any error (in previous posts you can see errors returned in chroot/live usb)
  • os-prober this time detects Windows
  • grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=manjaro --recheck
  • grub-mkconfig -o /boot/grub/grub.cfg - this time without errors, whilst before (live usb, chroot, see above posts), there were errors

After reboot, I can see GRUB menu with options to select either Manjaro or Windows.

To repair Windows boot, I followed instructions from [fixer1234] (https://superuser.com/users/364367/fixer1234) here

Notice:
If you see error grub-install: error: cannot open /boot/efi/EFI/manjaro/grubx64.efi’: Input/output error.` it means the folder is somehow broken. You must boot Windows CMD and either use mountvol or diskpart to access efi partition and either rename or delete ‘manjaro’ folder.
Then, from manjaro, you can recreate the grub.

2 Likes

Thank you all for you help :heart:

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