Update-grub cant see manjaro installation

Was messing with partitions and other distros during last 3 days and grub got messed up with syntax errors. After failing to chroot and manjaro-chroot grub I did a system restore from 18/12 which worked great but now sudo update-grub cant see the manjaro install. It only sees a win7 install and some mem something.
Afraid to reboot :astonished:
Please dont link me to chroot pages.
Manjaro-chroot donā€™t work.

Reinstall Grub on your default /boot/efi partition or / (depending if your system is UEFI or Legacy) then run sudo update-grub


Or maybe here
https://wiki.manjaro.org/index.php/GRUB/Restore_the_GRUB_Bootloader
Also see some related comments here

No need to chroot as im still logged in. afraid to reboot but. :confused:
Im on legacy bios.

[kdf-pc@kdf-hp ~]$ ls -la /boot
total 89440
drwxr-xr-x 4 root root 4096 Nov 28 20:29 .
drwxr-xr-x 18 root root 4096 Nov 24 14:28 ā€¦
drwxr-xr-x 6 root root 4096 Dec 24 11:09 grub
-rw-rā€“r-- 1 root root 25181962 Dec 4 12:00 initramfs-4.9-x86_64-fallback.img
-rw-rā€“r-- 1 root root 9943294 Dec 4 12:00 initramfs-4.9-x86_64.img
-rw-rā€“r-- 1 root root 31178203 Dec 4 12:01 initramfs-5.4-x86_64-fallback.img
-rw-rā€“r-- 1 root root 10062515 Dec 4 12:00 initramfs-5.4-x86_64.img
-rw-rā€“r-- 1 root root 3621888 Nov 19 07:58 intel-ucode.img
-rw-rā€“r-- 1 root root 22 Nov 24 13:41 linux49-x86_64.kver
-rw-rā€“r-- 1 root root 21 Nov 28 09:57 linux54-x86_64.kver
drwxr-xr-x 2 root root 4096 Jun 4 2020 memtest86+
-rw-rā€“r-- 1 root root 5052160 Nov 27 12:58 vmlinuz-4.9-x86_64
-rw-rā€“r-- 1 root root 6502720 Nov 28 20:28 vmlinuz-5.4-x86_64

This is what you need, from wiki:

sudo grub-install --force --target=i386-pc --recheck --boot-directory=/boot /dev/sdy

Replace the sdy with your actual decive/disk number. Also make sure the grub configuration is up-to-date

sudo grub-mkconfig -o /boot/grub/grub.cfg

Can i do this from my install instead of usb ?

grubcust1

and

grubterm1

customizer sees manjaro and update in terminal doesnā€™t

Seems everything is o.k.
Terminal does not say ā€œManjaroā€, that is normal!
Consider ā€œBoot-Orderā€ in BIOS.
The Grub-Customizer ā€œmostlyā€ works correct.
Manjaro and safe-boot will NOT work!

what do you mean?

@GaVenga was referring to Secure Boot, but that does not apply to you as you are booting in legacy BIOS mode.

However, it must be noted once again that grub-customizer should not be used in Manjaro. Manjaro uses a customized version of GRUB, and grub-customizer cannot handle that.

Its worse than that.
grub-customizer assumes you are using ubuntu.
This is a problem in a lot of situationsā€¦
Also its logic and functions are both constructed by what can only be a silly person.
I am sure these things are exacerbated by our modified grub (and why it conflicts with grub in the repos - it will stop you from installing it) ā€¦ but its not the only reason.

1 Like

so will uninstalling customizer fix my grub update ?

Not necessarily. It depends on what a mess it managed to make out of the contents of /etc/grub.d.

Perhaps it would be best to not only uninstall grub-customizer, but to also wipe the contents of /etc/grub.d and then immediately reinstall grub from the repositories. :thinking:

how to do this step by step ?

First do thisā€¦ :arrow_down:

sudo pacman -R grub-customizer
sudo rm -f /etc/grub.d/*
sudo pacman -S grub os-prober

os-prober should normally be pulled in as a dependency of grub, but it never hurts to explicitly add it.

Now, an intermediary step may be needed for getting GRUB to display a menu on bootā€¦ :arrow_down:

sudo nano /etc/default/grub

If the file contains the lineā€¦ :arrow_down:

GRUB_TIMEOUT_STYLE=hidden

ā€¦ change that toā€¦ :arrow_down:

GRUB_TIMEOUT_STYLE=menu

Save the file with Ctrl+O followed by Enter, and exit nano with Ctrl+X.

Now proceedā€¦ :arrow_down:

sudo grub-install --force --recheck --no-rs-codes --modules="part_msdos part_gpt" --target="i386-pc"
sudo update-grub
1 Like

already some issues

[kdf-pc@kdf-hp ~]$ sudo pacman -R grub-customizer
[sudo] password for kdf-pc:
checking dependenciesā€¦

Packages (1) grub-customizer-5.1.0-2

Total Removed Size: 3.09 MiB

:: Do you want to remove these packages? [Y/n] y
:: Processing package changesā€¦
(1/1) removing grub-customizer [###############################] 100%
:: Running post-transaction hooksā€¦
(1/3) Arming ConditionNeedsUpdateā€¦
(2/3) Updating icon theme cachesā€¦
(3/3) Updating the desktop file MIME type cacheā€¦
[kdf-pc@kdf-hp ~]$ sudo rm -f /etc/grub.d/*
rm: cannot remove ā€˜/etc/grub.d/backupā€™: Is a directory
rm: cannot remove ā€˜/etc/grub.d/binā€™: Is a directory
rm: cannot remove ā€˜/etc/grub.d/proxifiedScriptsā€™: Is a directory
[kdf-pc@kdf-hp ~]$

Thatā€™s all crud that was added by grub-customizer. But okay, then use this command insteadā€¦ :arrow_down:

sudo rm -rf /etc/grub.d/*

more help pleaseā€¦

[kdf-pc@kdf-hp ~]$ sudo grub-install --force --recheck --no-rs-codes --modules=ā€œpart_msdos part_
gptā€ --target=ā€œ386-pcā€ --boot-directory="/boot"
grub-install: error: /usr/lib/grub/386-pc/modinfo.sh doesnā€™t exist. Please specify --target or -
-directory.

My apologies; there was a typo in my post, which Iā€™ve corrected now. The command isā€¦ :arrow_down:

sudo grub-install --force --recheck --no-rs-codes --modules="part_msdos part_gpt" --target="i386-pc"
sudo update-grub
1 Like

and now ?

[kdf-pc@kdf-hp ~]$ sudo grub-install --force --recheck --no-rs-codes --modules=ā€œpart_msdos part_gptā€ --target=ā€œi386-pcā€
[sudo] password for kdf-pc:
Installing for i386-pc platform.
grub-install: error: install device isnā€™t specified.

Add your boot device to the command. If your boot drive is /dev/sda, then simply add that to the command, like soā€¦ :arrow_down:

sudo grub-install --force --recheck --no-rs-codes --modules="part_msdos part_gpt" --target="i386-pc" /dev/sda
sudo update-grub