I recently did re-install my Windows on another disk (dual boot machine) and tried to update grub to correctly boot up Windows as well. But the grub2-mkconfig -o /etc/default/grub
and also grub2-install commands fail:
insmod: ERROR: could not load module part_gpt: No such file or directory
insmod: ERROR: could not load module btrfs: No such file or directory
/etc/default/grub: line 67: search: command not found
/etc/default/grub: line 71: loadfont: command not found
/etc/default/grub: line 79: terminal_output: command not found
insmod: ERROR: could not load module part_gpt: No such file or directory
insmod: ERROR: could not load module ext2: No such file or directory
I tried with several installed kernels, no luck.
I still can boot the system but I fear with the next kernel update things might get messy.
This is a totally f***ed up command and may have destroyed the ability of grub to function for updates..
No where have I ever seen that output file suggested or used. /etc/default/grub is a configuration file that is read by grub2-mkconfig to properly set options in the output.
The proper command would be sudo grub2-mkconfig -o /boot/grub2/grub.cfg
Check the content of the file /etc/default/grub and if it does not look similar to the below then the file must be repaired before any updates can be performed.