I am currently writing a script for work which commissions two partitions (the first is a recovery envrionment, the second being the main OS with propitiatory software installed) and I have come to the final process, GRUB2 installation.
I basically have it working but the tutorials I have found specify that I should mount /dev, /proc and /sys before running grub-install. I have tried it without and the boot menu is seemingly restored correctly.
I'd like to understand this process further. Would someone please explain why the three mount points above are required?