Hello guys,
I have got a problem to restore GRUB.
UEFI, GPT dual boot with windows 8.1 and Manjaro
I had Windows and Manjaro on the same disk. I had to reinstal Windows. So now, I am trying to restore GRUB and configure dual boot as before. I am following these steps from live USB:wiki.manjaro.org/index.php/GRUB/Restore_the_GRUB_Bootloader
However I am getting following error:
[manjaro-gnome /]# grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=manjaro --recheck
Installing for x86_64-efi platform.
grub-install: error: cannot open `/boot/efi/EFI/manjaro/grubx64.efiâ: Input/output error.
In /etc/fstab I found wrong UUID, so I edited the file with correct UUID but still getting the same error.
Bash output here:pastebin.com/JS7mEqWF
Please advise.
Thank you.
Correcting the UUID is only half of the story. You also have to mount the correct EFI system partition to /boot/efi. However, my guess is that your Windows installation has nuked your original EFI partition and created a new one.
Yes, secure boot is disabled in UEFI. I checked that before.
In regards your second question, not sure where to look for. In chroot ?
This output outside chroot:
[manjaro-gnome manjaro]# mount /dev/sda5 /mnt
[manjaro-gnome manjaro]# mount /dev/sda2 /mnt/boot/efi
[manjaro-gnome manjaro]# ls -l /boot/
total 11704
-rw-r--r-- 1 root root 40960 May 11 17:12 amd-ucode.img
drwxr-xr-x 2 root root 30 May 19 13:52 grub
-rw-r--r-- 1 root root 3624960 Feb 17 08:15 intel-ucode.img
-rw-r--r-- 1 root root 22 May 11 19:38 linux510-x86_64.kver
drwxr-xr-x 2 root root 34 May 19 13:52 memtest86+
-rw-r--r-- 1 root root 8318336 May 19 13:52 vmlinuz-5.10-x86_64
[manjaro-gnome manjaro]# ls -l /mnt/boot/efi/EFI/manjaro/
**ls: cannot access '/mnt/boot/efi/EFI/manjaro/': Input/output error**
[manjaro-gnome manjaro]# ls -l /mnt/boot/efi/EFI/
ls: cannot access '/mnt/boot/efi/EFI/manjaro': Input/output error
total 2
drwxr-xr-x 2 root root 1024 May 24 15:15 Boot
drwxr-xr-x 3 root root 1024 May 24 15:09 Microsoft
**d????????? ? ? ? ? ? manjaro**
Hint: put three backticks above and below the terminal output â it makes everything more readable.
Thatâs not looking good. The EFI system partition has a FAT32 filesystem, and therefore its permissions are virtual. This means that ls should be seeing those permissions just as well as for the two other directories in there, and yet it cannot read those permissions.
The only thing I can think of, off the top of my head, would be that your reinstallation of Windows has truncated your EFI partition, and thus, that the filesystem is damaged.
ok, dont kill me if I did it wrongly,
butâŚ
when I reinstalled Windows from live usb, I deleted efi, backup and windows partitions and started from scratch (let windows to recreate the partitions on its own)
Windows installed successfully.
Then I tried to restore GRUB as both (root and home) partitions were still there.
If my logic was wrong, please explain.
hmm, but it is written in this guide:wiki.manjaro.org/index.php/GRUB/Restore_the_GRUB_Bootloader
btw I tried your advice and it fails:
[manjaro-gnome manjaro]# umount /dev/sda2 /mnt/boot/efi
umount: /mnt/boot/efi: not mounted.
[manjaro-gnome manjaro]# umount /dev/sda5 /mnt
umount: /mnt: not mounted.
[manjaro-gnome manjaro]# manjaro-chroot /mnt /bin/bash
mount: /mnt/proc: mount point does not exist.
==> ERROR: failed to setup API filesystems in chroot /mnt
[manjaro-gnome manjaro]# manjaro-chroot
==> ERROR: Canât create chroot on non-directory
[manjaro-gnome manjaro]# manjaro-chroot /mnt /bin/bash
mount: /mnt/proc: mount point does not exist.
==> ERROR: failed to setup API filesystems in chroot /mnt
Wrong question. Check the S.M.A.R.T. status of your drive first. If the drive is okay, then you can try running a fsck.vfat on it â important note: the filesystem may not be mounted or otherwise in use when running fsck.vfat!
Probably, I need your advice what repair option to select:
[manjaro-gnome manjaro]# fsck.vfat -n /dev/sda2
fsck.fat 4.2 (2021-01-31)
There are differences between boot sector and its backup.
This is mostly harmless. Differences: (offset:original/backup)
65:01/00
Not automatically fixing this.
/EFI/manjaro
Contains a free cluster (1781). Assuming EOF.
/EFI/Microsoft/Boot/BCD.LOG
Contains a free cluster (1781). Assuming EOF.
/EFI/Microsoft/Boot/BCD.LOG
File size is 32768 bytes, cluster chain length is 29696 bytes.
Truncating file to 29696 bytes.
Reclaimed 138 unused clusters (141312 bytes).
Dirty bit is set. Fs was not properly unmounted and some data may be corrupt.
Automatically removing dirty bit.
Free cluster summary wrong (72213 vs. really 72354)
Auto-correcting.
Leaving filesystem unchanged.
/dev/sda2: 168 files, 25950/98304 clusters
[manjaro-gnome manjaro]# fsck.vfat /dev/sda2
fsck.fat 4.2 (2021-01-31)
There are differences between boot sector and its backup.
This is mostly harmless. Differences: (offset:original/backup)
65:01/00
1) Copy original to backup
2) Copy backup to original
3) No action
[123?q]?