Error on image upload

Anyone know what is happening here? Obviously something to do with partitions, but this just started happening out of the blue on an image I have uploaded many times successfully. It will still upload, but then a reimage with this image will result in an unbootable PC. I tried other previous good images and the same thing. I tried another device and the same thing, so I suspect something has happened to the server. I have already rebooted the server. Thanks for any help.! !

@Zourous Did you notice the fixed init files I posted yesterday? See below.

Yes, I’ve just tried them. On a debug test it still shows as before when you type in parted -l /dev/sda, but on the upload I can’t see any issues like in the original screenshot I posted. Thanks for all your efforts.

I noticed this and used a tool to take the extra USB partition away again from the image

I am not sure I get this. Which tool did you use to “take away” the USB partition? Do you mean you removed the partition from the USB key before actually uploading or after upload finished?

About the “doesn’t resize”… We need more information on this! Partition layout (d1.partitions from the image directory) and so on.

I just used a tool outside of Windows to remove the inserted USB partition that had made it’s way onto the main image. By doing this I assume it has messed something up and that the partitions are not recalculated when I try to upload the image again because it seems to not shrink the image to the size of the data before upload or then resize it after deployment. Here is the d1.partitions file

I noticed this and used a tool to take the extra USB partition away again from the image

I am not sure I get this. Which tool did you use to “take away” the USB partition? Do you mean you removed the partition from the USB key before actually uploading or after upload finished?

About the “doesn’t resize”… We need more information on this! Partition layout (d1.partitions from the image directory) and so on.

I just used a tool outside of Windows to remove the inserted USB partition that had made it’s way onto the main image. By doing this I assume it has messed something up and that the partitions are not recalculated when I try to upload the image again because it seems to not shrink the image to the size of the data before upload or then resize it after deployment. Here is the d1.partitions file

@Zourous I am fairly sure I found why you ran into this issue. I was absolutely sure I had seen something very similar some weeks ago but just have not had the time in the last days to sit down and play with this stuff to figure it out.

@Quazz You might remember this last fix. We had a very similar if not the same error message in situations with single drives that have the same flag set on different partitions. In both cases the problem is caused because a variable is being set with a multiline result and that causes the if clause to fail with syntax error.

The problem here is that parted -l /dev/sda does not return the information for sda only but sda and sdb as stated in the parted man page: “-l, --list lists partition layout on all block devices”.

Put those in /var/www/html/fog/service/ipxe/ - rename the original ones to have a backup copy of those. As well go to the FOG web UI -> FOG Configuration -> FOG Settings -> FTP Server and increase KERNEL RAMDISK SIZE from 127000 to 275000 if you haven’t done that already.

Also I have just noticed a new problem off the back of this problem. The USB stick got uploaded into the image at some point. I noticed this and used a tool to take the extra USB partition away again from the image, but after this the images uploads and shows the size as the full space of the fixed disk and also doesn’t resize to a bigger disk when it is deployed to a bigger disk. I’m not sure how I can correct this issue now.

@Zourous I am not exactly sure I understand this yet. My guess was that maybe the USB key turns up as sda. Maybe that happens randomly but it’s very unlikely (now that I think a bit more about it) as SCSI/ATA disk subsystem devices usually get enumerated before the USB stuff. But if you have a couple of minutes you could do the whole test for maybe 10 times (reboot into debug task again and run both parted commands to see if at some point the USB drive shows up as sda).

It looks like the USB stick was bootable at some point in a previous use (I didn’t realise this before) so maybe that it where the confusion is and Fog automatcially adds it to the image to upload?

If the image is set to “single disk…” then FOG simply grabs the first disk. So if it’s randomly changing (tests mentioned above) that might explain things. The boot flag shouldn’t play a role as far as I know.

Looking at the first picture you posted again I see that it tries sda1 and sda2 and so it’s very unlikely the USB key. But still we are very sure this was causing it. So possibly some command we use in the scripts is just being confused by the USB key.