@sebastian-roth I will have to wait until late next month to update. I have to image around 200 computers in the coming weeks so I’ll leave those laptops as the last devices to image in case something breaks with the update.
Thanks for all your help, I will reply to the thread after I update the server.
Posts
-
RE: Very slow boot.php and bzImage during pxe bootposted in FOG Problems
-
RE: Very slow boot.php and bzImage during pxe bootposted in FOG Problems
@sebastian-roth Okay so this is the whole output
>>>Start PXE over IPv4. Station IP address is 10.28.68.52 Server IP address is 10.27.70.100 NBP filename is ipxe.efi NBP filesize is 1060352 Bytes Downloading NBP file... Succeed to download NBP file. iPXE initializing devices...ok iPXE 1.21.1+ (gc64d) -- Open source Network Boot Firmware -- http://ipxe.org Features: DNS FTP HTTP HTTPS iSCSI NFS TFTP SRP VLAN AoE EFI Menu Configuring (net0 30:24:A9:...)..... ok Received DHCP answer on interface net0 tftp://10.27.70.100/default.ipxe... ok http://10.27.70.100/fog/service/ipxe/boot.php... ok Booting... (Press ESC to access the menu)The iPXE version is newer, because it used to be
1.20.1+before the change.I was the one that set up the DHCP setting for my colleague’s and my VLANs so they are both
ipxe.efi.
I checked to make sure that nothing is broken between VLANs and switches and that everything is Gigabit.
I also tried disabling theADVANCE MENU LOGIN&PXE MENU HIDDENjust to check and still same issue. I went into the FOG Configuration and updated the MAC addresses too but no luck. -
RE: Very slow boot.php and bzImage during pxe bootposted in FOG Problems
@sebastian-roth Okay so I did that and it’s still acting the same way.
I guess the next step would be to update to the dev-branch?
-
RE: Very slow boot.php and bzImage during pxe bootposted in FOG Problems
@sebastian-roth Thanks for the help. I prefer to swap out the iPXE binaries first and see if that helps.
Do I just copy those linked files into
/tftpbootthen change ownership tofogproject:rootandchmod 655the files, or is there something else I need to do? -
RE: Very slow boot.php and bzImage during pxe bootposted in FOG Problems
@sebastian-roth Hello and thank you for the reply. I tried multiple times on the other FOG server just to make sure with different “bad” laptops and they all worked.
The other FOG server is on 1.5.9.94.
I took a “bad” laptop to the server room and plugged it in to the same switch that my FOG server is connected to and I am still having the same issue.
I originally thought it could be the NIC on those “bad” laptops so ran speed tests using Windows and Linux(Ubuntu) and they are fine. Maybe it could be something with the MAC on the laptops and FOG not accepting it.
I tried using a USB-C to Ethernet adapter to test and it works perfectly with that.I could just use multiple of those adapters to image the computers but they hold the host data after I register the laptops.
EDIT:
I originally had the kernel version using 4.19.64. Updated it last week to 5.10.34. Just updated it to 5.10.50 today and still having the same issue. -
Very slow boot.php and bzImage during pxe bootposted in FOG Problems
FOG Version: 1.5.9
OS: Ubuntu 20.04 - up to dateHello, I am having a very strange issue. I have 30 new HP EliteBook 850 G6 laptops with sequential serial numbers. Some of the laptops are working perfectly when trying to register them as hosts. Others, are not booting to the host registration screen because the bzImage part takes around a minute to go up 1%.
When going into pxe boot, the laptop take a while to get to the iPXE menu items.http://10.27.70.100/fog/service/ipxe/boot.php... ok #This happens instantly http://10.27.70.100/fog/service/ipxe/boot.php................ ok # This takes around 10-15 seconds http://10.27.70.100/fog/service/ipxe/boot.php......... n% # This takes about 5-10 secondsOnce I press enter on the
Perform Full Host Registration and Inventorymenu option, I get:bzImage................................ n% # Takes around a minute to go up 1%At first I thought I may have a batch of laptops that are bad, so I looked through the serial numbers and noticed its all over the place.
I took a laptop that I know doesn’t work to a coworker’s area and used her FOG to see what would happen and there was no issue. This makes me think I screwed up on something with my FOG server.
Only changes I have done to the server recently are post download scripts and add new images/snapins.
Any ideas?
Thanks in advanced!
-
RE: FOS not mounting drive for post download scripts.posted in General
@george1421 @Sebastian-Roth So I modified my postdownload scripts to manually mount the correct drive if the code that was originally there didn’t do it. It is working for me so I am adding my post download scripts below in case anyone comes across this thread and finds it helpful for them. This works for me in my environment, but may not work for everyone.
I took inspiration from the
getHardDisk()function in https://github.com/FOGProject/fos/blob/master/Buildroot/board/FOG/FOS/rootfs_overlay/usr/share/fog/lib/funcs.shThe scripts are a bit of a mess but working
fog.postdownload
#!/bin/bash ## This file serves as a starting point to call your custom postimaging scripts. ## <SCRIPTNAME> should be changed to the script you're planning to use. ## Syntax of post download scripts are #. ${postdownpath}<SCRIPTNAME> clearScreen; dots "Running post download scripts." mkdir /ntfs &>/dev/null ntfs-3g -o force,rw $part /ntfs echo "Mounting Device"; if [ "$?" = 0 ]; then if [ ! -d "/ntfs/Windows" ]; then . ${postdownpath}mountLargestPartition fi echo "Done" debugPause . ${postdownpath}getMachineModel . ${postdownpath}getPlatformVersion . ${postdownpath}fog.drivers . ${postdownpath}fog.unattend if [ -z "$auditMode" ]; then . ${postdownpath}fog.bcu fi echo "Unmounting Device"; umount /ntfs; debugPause else echo "Failed to mount device"; sleep 30; debugPause fi
mountLargestPartition
#!/bin/bash dots "Running the manual mount script" drive=$(lsblk -dpno KNAME -I 3,8,9,179,202,253,259 | uniq | sort -V) driveCleaned=${drive//'/dev/'/} #Remove `/dev/` from variable partition="" partSize=0 # Get the largest partition while IFS= read -r line; do tempPartSize=$(blockdev --getsize64 /dev/$line) if [ $tempPartSize -gt $partSize ]; then partSize=$tempPartSize partition="/dev/$line" fi done < <(ls /dev | grep -E "${driveCleaned}[a-zA-Z0-9]+") umount /ntfs &> /dev/null ntfs-3g -o force,rw $partition /ntfs
getMachineModel
#!/bin/bash dots "Retrieving Machine Model" machine=$(dmidecode -s system-product-name) # Gets machine model machine="${machine// /_}" # Replace spaces with underscores echo "${machine}" debugPause
getPlatformVersion
#!/bin/bash dots "Retrieving Platform Version from Registry" # Create a registry file to be able to search the ReleaseId from # reged -x gives out an abort error message but from all my testing it still works. reged -x /ntfs/Windows/System32/config/SOFTWARE HKEY_LOCAL_MACHINE\\SOFTWARE \\ /out.reg &> /dev/null || true if [ -f /out.reg ] then PlatformVersion=$(cat /out.reg | grep 'ReleaseId') PlatformVersion=${PlatformVersion:13:4} # Grab only actual the ReleaseId. Full text looks like "ReleaseId"="1909" echo "${PlatformVersion}" else echo "No registry file found." debugPause dots "Retrieving Platform Version from PlatformVersion.rek file" if [ -f "/ntfs/Windows/PlatformVersion.rek" ] then PlatformVersion=$(<"/ntfs/Windows/PlatformVersion.rek") echo "${PlatformVersion}" debugPause else echo "No platform version file found." debugPause fi fi
fog.drivers
#!/bin/bash dots "Preparing Drivers" mkdir /ntfs/Drivers &>/dev/null; echo "In Progress" dots "Adding drivers to driver path" cp -ar "/images/drivers/${machine}/${PlatformVersion}/" /ntfs/Drivers if [ "$?" = 0 ]; then echo "Done" else echo "Failed!" fi debugPause regfile="/ntfs/Windows/System32/config/SOFTWARE" echo "regfile ${regfile}" key="\Microsoft\Windows\CurrentVersion\DevicePath" echo "key ${key}" devpath="%SystemRoot%\inf;%SystemDrive%\Drivers" echo "devpath ${devpath}" reged -e “$regfile” &>/dev/null <<EOFREG ed $key $devpath q y EOFREG echo “Drivers done.”
fog.unattend
#!/bin/bash dots "Searching for Platform Version" # If $PlatformVersion is not null/empty if [ -n "$PlatformVersion" ]; then echo "Found" debugPause dots "Removing old unattend file" rm -f /ntfs/Windows/Panther/*nattend.xml if [ "$?" = 0 ]; then echo "Done" else echo "Failed to remove file!" echo "Aborting fog.unattend" debugPause sleep 60 return fi debugPause dots "Checking image mode" if [ -n "$auditMode" ] && [ "$auditMode" -eq 1 ]; then echo "AUDIT" debugPause dots "Copying audit mode unattend file" cp "/images/unattends/UnattendAuditMode.xml" "/ntfs/Windows/Panther/Unattend.xml" if [ "$?" = 0 ]; then echo "Done" else echo "Failed!" fi debugPause else echo "OOBE" debugPause dots "Copying unattend file with driver path" cp "/images/unattends/UnattendWithDriverPath.xml" "/ntfs/Windows/Panther/Unattend.xml" if [ "$?" = 0 ]; then echo "Done" else echo "Failed!" fi debugPause fi else echo "No valid Platform Version." echo "Skipping unattend." debugPause fi
fog.bcu
#!/bin/bash dots "Copying BIOS change script" if [ -f "/images/drivers/CMSL-BIOS_Change.ps1" ] then cp "/images/drivers/CMSL-BIOS_Change.ps1" "/ntfs/Drivers" echo "Done" debugPause else echo " Failed! Could not find bios change script." debugPause sleep 60 fi echo "fog.bcu done." debugPause -
RE: FOS not mounting drive for post download scripts.posted in General
I did a few more tests and realized that the
$partvariable is also not set on the image that is working, so probably not that. The other thing I realized, my working image has the NTFS partition on /dev/sda4 but the “bad” image has it on /dev/sda3. Not sure why the new image is different.A bit more context, in case it could be the issue:
- The “good” image is Windows 10 Version 1909
- The “bad” image is Windows 10 Version 20H2
-
FOS not mounting drive for post download scripts.posted in General
Hello, I am having an issue when deploying one of my images. After Partclone is done, my post download scripts start, however it seems that the
$partvariable is not set correctly so the/ntfsdirectory only hasRecoveryandSystem Volume Informationand is not mounting my ntfs partition.I haven’t changed anything of the mounting part from
fog.postdownload.dots "Running post download scripts." mkdir /ntfs &>/dev/null ntfs-3g -o force,rw $part /ntfs echo "Mounting Device"; if [ "$?" = 0 ]; then echo "Done" debugPause . ${postdownpath}getMachineModel ... ...I’m pretty sure it’s something with the specific image I am using, since I tried a different image and I don’t have that problem. I don’t know how my new image could be affecting this, but I didn’t do anything different for the “bad” image.
I’m not sure what I should try to figure out what the issue is.
I was able to mount the /dev/sda3 partition manually usingntfs-3g -o force,rw /dev/sda3 /ntfs -
RE: Passing variable from ipxe menu to FOSposted in General
@george1421 Thanks so much! So what fixed it for me was just removing all the other iPXE commands. So now my parameters are:
login kernel bzImage loglevel=4 initrd=init.xz root=/dev/ram0 rw ramdisk_size=275000 web=http://10..../fog/ consoleblank=0 nvme_core.default_ps_max_latency_us=0 rootfstype=ext4 mac=${net0/mac} ftp=10.... storage=10....:/images/ storageip=10.... irqpoll chkdsk=0 capone=1 type=down img=1909GoldenImage imgType=n imgPartitionType=all imgid=43 osid=9 imgFormat=0 auditMode=1 imgfetch init.xz boot || menuThis works perfectly for what I need.
-
RE: Passing variable from ipxe menu to FOSposted in General
@george1421 I did make a selection but maybe I made I mistake on the kernel command?
Also where would I put the sanboot option? -
RE: Passing variable from ipxe menu to FOSposted in General
@george1421 Thanks for the response. I am not super familiar with all the ipxe menu stuff so I am doing something wrong.
My custom menu parameters are:
login params param mac0 ${net0/mac} param arch ${arch} param username ${username} param password ${password} isset ${net1/mac} && param mac1 ${net1/mac} || goto bootme isset ${net2/mac} && param mac2 ${net2/mac} || goto bootme kernel bzImage loglevel=4 initrd=init.xz root=/dev/ram0 rw ramdisk_size=275000 web=http://10..../fog/ consoleblank=0 nvme_core.default_ps_max_latency_us=0 rootfstype=ext4 mac= ftp=10.... storage=10....:/images/ storageip=10.... irqpoll chkdsk=0 capone=1 type=down img=1909GoldenImage imgType=n imgPartitionType=all imgid=43 osid=9 imgFormat=0 auditMode=1 isdebug=yes imgfetch init.xz bootI have the Menu Show with option set to
All HostsWhen I try to run it, I get this error:
http://10..../fog/service/ipxe/boot.php... ok Booting from SAN device 0x80 Boot from SAN device 0x80 failed: No such device (http://ipxe.org/2c222087) Could not boot: No such device (http://ipxe.org/2c222087) Could not boot: No such device (http://ipxe.org/2c222087) Chainloading failed, hit 's' for the iPXE shell: reboot in 10 seconds -
Passing variable from ipxe menu to FOSposted in General
Hello, I am wondering if there is any way to pass a variable from a custom ipxe menu item that can then be read and used by FOS?
I duplicated the fog.deployimage menu item and would want to pass a variable that would be used in my post download scripts.What I would want to do, is have my post download scripts only run some scripts depending if that variable is true/1 or false/0. So if I select that new menu item it would have the variable.
-
RE: HostnameChanger Issueposted in FOG Problems
@Sebastian-Roth I know this thread is a bit old, but my question is exactly this thread.
I am having the same issue as @jtappen. In my case, all of my hosts had the enforce checkbox selected on my prior FOG server. After I moved everything to a new server for some reason the checkboxes got unchecked.
I tested with a few computers by clicking the checkbox and it works perfectly fine. My problem is that I have over 200 hosts so I would like to “checking ALL the checkboxes” by updating the database.Would anything break if I run
UPDATE hosts SET hostEnforce='1';to update all hosts in one blow? -
RE: Post Download Scripts Included Variablesposted in General
@george1421 Thank you so much that helps a lot! I’ll have to modify a few things and test it out.
One question. What does the
dotscommand do? I’ve tried to search what that command does in bash but I can’t find anything about it.EDIT: Also does the file have to be a
.rekfiletype or can it just be a txt? -
RE: Post Download Scripts Included Variablesposted in General
@george1421 I didn’t think of having a text file on the image itself, that is so simple to implement.
I’ll try both things out next week when I am back at the office.Thank you so much!
-
Post Download Scripts Included Variablesposted in General
Hello, I am trying to create a post download script to add drivers to my image.
I have read many forum posts about this and have created my script. Most of those posts reference the$osidvariable that can be used in these scripts.I have different drivers for different versions of Windows 10 (1909, 2004, 20H2, …) but I don’t see a way of figuring out what version I am imaging on a computer.
So, I am thinking I could add the version number in the image name and add the logic to the script.
That being said, is there a variable for the image name?
I know that the images table in the database has andimageNamefield, but is there a variable for it that can be used in the post download scripts?Also, is there a link/file where I can see what other variables are available to the FOS at that moment?
Thanks for the help!
-
RE: FOG update broke rEFInd exitposted in FOG Problems
@Sebastian-Roth Thank you so much for telling me about the
Reset Encryption Data, that worked!If you could please let me know the way to do that for all the computers en mass, I would greatly appreciate it!
-
RE: FOG update broke rEFInd exitposted in FOG Problems
@Sebastian-Roth @george1421 Thank you for your reply. I did do that from the link provided before submitting my last reply.
This make me think that the issue I had with my old FOG server may have been a certificate issue.
Since I copied the ssl certificate from the old FOG server and this still doesn’t work, does this mean I just have to redeploy the fog client from the new server on all the computers?
If so, is there anything I must remove from the computer before doing that? (e.g. registry data)
Once again, thank you so much for all your help!