I have seen that grub2 configuration files exist in so many different locations.
Can anyone tell me the purpose of each directory/file?
/etc/default/grub is where you can set simple options for many GRUB settings. It is parsed as a shell script.
/etc/grub.d contains shell scripts which generate GRUB configuration (based on settings on
grub-mkconfig) runs these scripts to generate actual GRUB configuration.
/boot/grub2/grub.cfg is where the generated configuration is saved for GRUB to use.
Ordinarily, for setting GRUB options, you edit
/etc/default/grub. If you need to generate additional GRUB entries or alter the entries generated, then add or change scripts in
/etc/grub.d. Don't manually edit