Thanks for the feedback, everyone.
You are absolutely correct! The new nvme had no effect
Memtest revealed a bad ram stick. Going to RMA that.
Thank you. Now I will try the imaging again after memtest passes a few times on the remaining RAM.
Thanks for the feedback, everyone.
You are absolutely correct! The new nvme had no effect
Memtest revealed a bad ram stick. Going to RMA that.
Thank you. Now I will try the imaging again after memtest passes a few times on the remaining RAM.
@pauleb Intriguing. So you didn’t need to create a EFI entry for the drive? I wonder if it was already there for that drive from the previous image or something.
I guess mine did not work because I first imaged my test machine with an MBR image, which made the EFI entry no longer show up.
Good luck, and thanks for the info.
@pauleb I recently went through this and used the script I posted in this thread to create the EFI entry for the windows boot.
The Image must be in GPT format, or at least I had no luck with MBR…
I never got to the Windows boot loader at all with CSM disabled until I used GPT and the script I posted at the link above. My machines would just hang at a black screen, and the drive was not seen in the EFI BIOS until I set the EFI entry as described using efibootmgr in that script. Though I have to say I am not sure I ever tried a GPT image without the script.
I made my image in VirtualBox set to EFI, though I had to turn off EFI to get Virtual Box to network boot and not fire up the golden image, ruining it due to it already being sysprepped, but that is a different story.
@george1421 Thanks for the reply. I had seen a lot of your (and others’) scripts. It does look like there are methods to do it from the script, no doubt.
It just seems like the scripts are generally either host or image specific, which is why I was thinking it would be good to link those in the DB for easy management. Perhaps they could be applied to groups or some other collection of hosts/images such that they could applied to many hundreds or thousands of hosts at once. I have not looked at groups; so I have no clue what functionality they offer at this point. I do understand it may be more trouble than it’s worth, since you can do it right now using the methods in the script.
As a side note, is there a way to drop into a shell in the OS some time between when the image is written and reboot? I guess the postdownload script could just invoke a shell? Would be useful for debugging without have to re-image repeatedly.
@Sebastian-Roth OK on the monolithic kernel vs. module loading. That explains the modprobe error I received (I had tried adding a manual call to modprobe in my script).
It turns out the issue must have been with that particular motherboard/BIOS. It is a much older machine (for anyone searching it was an ASUS Sabertooth X79 with BIOS version 3501). But there may have been other issues as well. I have yet to go back and try my now-seemingly-working script on that machine.
Below is my postdownload script I am now using to update the UEFI boot records for some newer machines (7950X on Gigabyte x670 boards). So far this is working well. I need to test it with an existing boot record with the same name (which is the default Windows name). I know efibootmgr will throw a warning in this case. It took me a bit to realize that I had my Windows image in MBR format, and needed to convert it to GPT (web search for mbr2gpt).
#!/bin/bash
#
# Note that the Windows disk needs to be in GPT format, not MBR or this
# will appear to succeed, but still not boot.
#
# Public Domain - Modify and use at will. No Warranty.
#
. /usr/share/fog/lib/funcs.sh
[[ -z $postdownpath ]] && postdownpath="/images/postdownloadscripts/"
case $osid in
5|6|7|9)
clear
echo "OS Type is Windows"
getHardDisk
if [[ -z $hd ]]; then
handleError "Could not find hdd to use for EFI Boot Entry"
fi
echo "Found Install Disk: $hd"
dots "Creating Win EFI Boot Entry for Disk: $hd Part: 1 using efibootmgr"
#Windows UEFI partition is usually partition 1
efibootmgr -c -L "Windows Boot Manager" -l "\\EFI\\Microsoft\\Boot\\bootmgfw.efi" -d $hd -p 1
if [[ ! $? -eq 0 ]]; then
echo "Failed. Error: $?"
# We opt not to fail here, as some machines may not support EFI Boot entries.
#debugPause
#handleError "Failed to Create Windows EFI Boot Entry. Error: $?"
echo " *** Failed to Create Windows EFI Boot Entry. Error: $? *** (pause 15sec)"
sleep 15
fi
echo "done"
echo ""
# Output the resulting boot records for reference/debug
efibootmgr -v
echo ""
debugPause
;;
*)
echo "Non-Windows Deployment"
debugPause
return
;;
esac
I do think that the postdownload scripts should be per host or per image. A global post download script means you then need to check the image or host in the script, which is not a clean way to do it. Better if this is moved into the UI so there is a way to set post download scripts for Images and for Hosts. This way you could run separate scripts for either or both.
@Sebastian-Roth When I try to run efibootmgr from the postdownload script I am getting modprobe telling me it can’t find the efivars kernel module. Any idea as to the best way to get that where it needs to be, and more importantly where does it need to be?
I am curious how @ClementK was able to run it.
Anyone?
Edit: Perhaps I don’t need to run modprobe, and the motherboard truly does not support efi vars, which is the error I am getting from efibootmgr without first calling modprobe.
Errno 2 “EFI variables are not supported on this system.”
@george1421 Thank you for the reply. I meant that I was using ipxe.efi (Not my mistyped ipxe.pxe above) for the newer machines. I selected that based on the info on this page, since I do not use the built in DHCP server:
https://docs.fogproject.org/en/latest/installation/network-setup/
Perhaps those docs are out of date?
So it sounds like I should configure the UEFI machines to use snp.efi/snponly.efi
(and fall back only if I have problems)
??
Thanks.
Is there some good documentation on which pxe file to use? I just realized from another post that there are some other vendor specific pxe files like intel.kpxe, and a realtek one, etc.
I have been trying to use ipxe.pxe, and when that fails (typically says out of memory on older mobos) the I use undionly.pxe . (The basic intro docs I found only listed those two.) However, honestly, I don’t fully understand the difference, or why I would want one over the other, or if I should be using an Intel pxe file with Intel NICs, etc.
My DHCP server let’s me set the pxe file for each MAC address individually if needed.
I am guessing this is really a case of if it works it’s fine, but I wondered if there was any reason to pick a particular pxe file, other than the fact that it boots OK and exits OK.
Also many motherboards seem to offer the UEFI option to net boot (Which usually works with the ipxe.pxe) as well as a older op ROM method, like with an Intel card. Any reason to use one over the other if they both work for a given setup? (I know some mobos only support the legacy ROM booting in CSM mode).
As an aside, but related note for anyone wishing to learn more I found this YouTube video very helpful in explaining UEFI for legacy ROM in sufficient detail to really know what was going on:
https://www.youtube.com/watch?v=G_qKrJPuAmg&t=503s
Thanks.
@Sebastian-Roth If I set that key correctly in the post install do you think the value will hold after a driver installation (via snapin)? I guess they only way to know is to test.
@Sebastian-Roth Thank you so much. I could not find that registry setting via searching. Maybe a DuckDuckGo thing, or perhaps user error. This is excellent! Thanks.