GRUB Config Lost After Imaging
-
Recently when applying a master image to identical hardware, the destination system will boot to a GRUB> rescue prompt. I need to type the commands below to make the system boot reliably again. The image is Kali Linux. This has not been an issue in the past and I have not changed my process. Is it possible to ensure GRUB maintains its config after imaging? Any help is greatly appreciated.
AT THE GRUB PROMPT:
set root=(hd0,gpt2)
set prefix=(hd0,gpt2)/boot/grub
insmod normal
normal
ONCE THE OS BOOTS:
grub-install /dev/sda
update-initramfs -u
update-grub -
@bramen I can’t speak so much to the grub stuff.
What I can tell you is that FOG has the ability to run a bash script after the image has been pushed to the target computer and before the computer reboots after completing the deployment. You can use this feature to tweak settings on the target computer before the computer is first booted into the target OS. This is used commonly with the windows environment to place hardware specific drivers onto the target computer that is used during the OOBE/WinSetup phase of windows. In linux we’ve used these scripts to rename linux computer and do some post install activities.
The FOG imaging agent is Linux based so it can’t directly interact with ms windows, but it can leave bread crumbs behind for windows to act upon. For linux target computers it can do more things. I can’t say if it can run grub commands though.
The concept of the fog post install script is that the script will need to mount the target computer media/file system, do whatever is needed then disconnect from the target media.
For windows I have a tutorial here: https://forums.fogproject.org/topic/11126/using-fog-postinstall-scripts-for-windows-driver-injection-2017-ed While this is windows specific the setup program would be very similar for linux.