Can't capture image from Havoc PC
-
Hi first off I really like Fog project makes deploying images a lot easier for us, we have 3 schools that we us Fog to deploy our image over the network.
I’m trying to capture an image for our Havoc Lab computers but I’m running into an error,
Could not find partitions (/bin/fog.upload) we’ve pulled multiple images for all our labs and student computers but for this one no matter how we setup the capture command we get the same error, any help would be great. Thank
-
@chief-0 Make sure you are running the latest FOS Linux kernel. FOG WebUI -> FOG Configuration -> Kernel update. Make sure you are on 5.15.x.
If on the latest version make sure on the computer that the disk mode is configured for ahci and not raid-on if the computer has an intel rst disk adapter.
If the above doesn’t work then we can debug this a bit more. I’ll go into the steps once you’ve completed the items above.
-
Thanks for the information, everything is setup correctly Fog Kernel is 1.5.9, disk configuration is on AHCI, but still get the same error. We’ve tried capturing using single disk, Multiple Partition image -Single disk, Multiple Partition Image - All disks, and Raw Image but get the same error
-
@chief-0 OK lets debug this a bit more.
Schedule another deployment/capture task (doesn’t matter) before you hit the schedule task button tick the debug checkbox. Now pxe boot the target computer. After a few screens of text you need to clear with the enter key you will be dropped to the FOS Linux command prompt on the target computer.
At the command prompt key in the following commands.
lsblk
df -h
grep -i firmware /var/log/messages
Leave this computer in debug mode based on what we see above there may be additional commands we will run.
-
Here’s what those commands gave me.
-
@chief-0 We have to remember here, I’m old and have weak eyes.
It looks like from the picture the target computer appears to have 4 partitions. Is this the same hardware that’s giving you the couldn’t find partition command? From what I can make out that error should not have happened.
If you issued a debug capture job then lets proceed here. (If you scheduled a debug deploy task, lets kill it and start with a debug capture once again. This will drop you to the fos linux command prompt. Once again issue the
lsblk
command. Make sure it sees /dev/sda and its 4 partitions.)Lets start a single step image capture. The capture process will stop at each break point during capture. This might give you a chance to see any error messages. Issue the command
fog
from the FOS Linux command prompt. The capture process will stop at each break point, press enter to go to the next step. Lets see if there is a usable error message that is presented just before the could not find partition, message. -
@george1421 After running the lsblk command we saw the 4 partitions and a sda but I did not see a dev anywhere in the results. I continued with the fog command and pressed enter until I hit a reading partition tables failed error.
-
@chief-0 Do you have a clear screen shot of the error that shows what;s throwing the error? I’m suspecting that something structurally is wrong with the disk. But lets chase down the actual error meassage
-
-
@chief-0 ok on that screen press
CRLT-C
to exit out of the script.At the fos linux command prompt key in
fdisk -l /dev/sda
This should read the partition table. I’m going to have to look at the code to see what command actually throws that specific error message. -
Here’s the results of that command.
-
@chief-0 OK I found where that code is failing in the script.
Then it calls two functions
runPartprobe "$hd" getPartitions "$hd"
Ok for this next bit instead of using pictures lets setup a debugging session to the target computer so you can use the copy and paste function.
This is to be done on the target computer. Get the IP address of the computer with
ip a s
and then set root’s password to something simple like hello with the commandpasswd
don’t worry the next reboot will reset things in the fos linux system. Now that you have the ip address and root’s password you can login to the fos linux engine using putty or ssh from a windowed system. login as root and the password you set from before. You can do this from the same computer you are interacting with this post. Now you can use cut and paste the commands.Back on point lets see which one of these commands are failing us.
Lets rerun the
lsblk
command again so you can capture it with cut and paste.Now lets see which of these commands is stopping imaging.
This is from the partprobe code
umount /ntfs /bcdstore udevadm settle blockdev --rereadpt /dev/sda
This is from the getPartitions (where I expect it to fail)
(lsblk -I 3,8,9,179,202,253,259 -lpno KNAME,TYPE /dev/sda | awk '{if ($2 ~ /part/ || $2 ~ /md/) print $1}' | sort -V | uniq)
If that didn’t give you any results lets shorten it to the action part of the command.
lsblk -I 3,8,9,179,202,253,259 -lpno KNAME,TYPE /dev/sda
From that output lets see what’s up.
-
@george1421 ok here’s the results of that command
-
@chief-0 Well I kind of wanted you to use the putty copy and paste route to ensure everything was keyed in exactly as it appeared in the script. So please do so.
There are actually two sections of commands the one with the blockdev command and the other that is really long. At least from what you keyed in the long command should give a list of partitions /dev/sda1 to /dev/sda4. So basically you should not have this error (from what I can see here).
-
From putty I ran the command you expected to fail and received the following response.
/dev/sda1
/dev/sda2
/dev/sda3
/dev/sda4 -
@chief-0 I have to be missing something here. I’m just restating this to help me think out loud.
This is the section of code that is printing failed
dots "Reading Partition Tables" if [[ $imgType == "dd" ]]; then echo "Skipped" else runPartprobe "$hd" getPartitions "$hd" if [[ -z $parts ]]; then echo "Failed" debugPause handleError "Could not find partitions ($0)\n Args Passed: $*" fi echo "Done" fi
In the screen shot of the debug deployment we can see it printing “Reading Partition Tables…Failed” That is coming from
dots "Reading Partition Tables" ... echo "Failed"
It prints failed when $parts is empty.
if [[ -z $parts ]]; then
You just manually ran the command that fills the variable $parts
parts=$(lsblk -I 3,8,9,179,202,253,259 -lpno KNAME,TYPE $disk | awk '{if ($2 ~ /part/ || $2 ~ /md/) print $1}' | sort -V | uniq)
And it returned
/dev/sda1 /dev/sda2 /dev/sda3 /dev/sda4
Which is surely not empty. It should have not printed Failed.
This computer only has one hard drive, right?
In the host definition there is nothing entered into the Primary Disk field?As far as I can tell, it should be working.
-
No sir this machine has 2 separate hard drives according to disk management but there is nothing currently entered into the Host Primary Disk field.
-
@chief-0 said in Can't capture image from Havoc PC:
No sir this machine has 2 separate hard drives according to disk management
Oh wait, what do you mean it has two disks? Doesn’t the original tiny pict of the the lsblk command only show /dev/sda (as I said it is impossible to read it once you zoom in)? If not, that probably the root of the issue and could have saved us a bunch of extra work. Depending on the discovery order it may detect that other disk first.
Using putty what is the output of the lsblk command like I just recently asked for?
If there is a second disk with no partitions, then back in the web ui in the host definition for this computer, add in
/dev/sda
under the primary disk field save it and try the capture once again. -
Good morning, I apologize for just getting back our afternoon got crazy. Below I have listed the results of the lsblk command from putty.
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 1 931.5G 0 disk
|-sda1 8:1 1 499M 0 part
|-sda2 8:2 1 100M 0 part
|-sda3 8:3 1 16M 0 part
`-sda4 8:4 1 89.5G 0 part
nvme0n1 259:0 0 238.5G 0 diskI did add /dev/sda to the primary disk field and attempted a capture task. Spread out in seemingly random positioning was the following
Out of memory: Killed process 2885 (zstdmt) total-vm:13327152kB, anon-rss: 5775672kb, file-rss:0kb, shmem-rss:0kb, UID:0 pgtables:11444kB oom_score_adj:0
/usr/share/fog/lib/funcs.sh: lin3 2077: 2885 Killed
zstdnt --rsyncable --ultra $PIGZ_COMP < $rifo > ${file}.000
Init Version : 20200906
Failed to complete capture (savePartition)
Args Passed: /dev/sda4 1 /images/7085c2fe0feb all
CMD: partclone.ntfs -n “Storage Location “insert ip address”:/images/dev/, Image name Havoc” -cs -0 /tmp/pigz1 -Nf 1 -a0
Exit Code: 141
Thank you so much for your assistance in this matter our office is currently scratching our heads with this one.
-
@chief-0 said in Can't capture image from Havoc PC:
nvme0n1 259:0 0 238.5G 0 disk
Ok with that info the initial error is perfectly understandable. The nvme drive (which was selected by discovery order, was selected as the boot drive and it has no partitions.
Forcing the system to use /dev/sda then is the right answer. This second problem is a bit interesting in that I haven’t seen this before (or don’t recall seeing it). So this is just a guess. But in the FOG Web UI -> FOG Configuration -> FOG Settings hit the expand all button then search the page for KERNEL RAMDISK SIZE is it still set to 127000 or is it listed at 256000 or larger? This parameter set the FOS Linux’s virtual hard drive size, its possible with a 127MB VHD its too small to buffer that 90GB 4th partition. The default value was changed from 127000 to 256000 several versions back of FOG. If the value is current 256000, lets up it a little to 275000 and see if that’s better,
There is also another field that might need to be bumped up. Its something like capture percent size but a truncated name. Its default if 5 % free, bump that value up to 10% free space. This will leave 10% of the storage space free when shrinking the disk image before capture. That might solve this problem but it will address other issues.