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.
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.
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
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)
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)
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.