Highlighted
Super Contributor.
Super Contributor.
911 views

Windows 10 2004 image problem

Jump to solution

Hi all

I seem to have another weird problem I recently created new Windows 10 (version 2004) image just like I have created all my images before the file seems to create properly the size of the file seems right but all I get when I try to restore the image to either a virtual of physical machine is.

Image restored: BaseWin10_9.zmg from IP ADDRESS
    Elapsed time: 00:03
    New image successful

We are currently on Zenworks 2020 (not updated to update 1 yet), I did find this https://www.novell.com/documentation/zenworks-2020-update-1/zen_whats_new/data/t416r6ssl9zxa.html

Does this mean that the image I created will not work until I update to update 1? The client seemed to install properly. All our old images work fine without any problems.

Not sure this will have any bearing on it but this is also the first image I have created since we upgraded to ZENworks 2020.

I have included some log files, these are the only ones that I could find any information that updated whilst I was trying the image.  I have also got some screenshot from within image explorer which show that the recovery partition seems to have moved could this be the problem?

Here is a the script we are useing for imaging.

zisedit computername=

img -pd all
img -pc1 -type=ntfs -size=450 -guid=WRE
img -pc2 -type=fat32 -size=100 -guid=ESP
img -pc3 -type=1 -size=16 -guid=MRP
img -pc4 -type=ntfs -guid=MBD
img -pa1
img -pa2
img -pa3
img rp $PROXYADDR $baseimage.zmg -ap=a1:p1 -ap=a2:p2 -ap=a3:p3 -ap=a4:p4
img rp $PROXYADDR $driverimage.zmg -ap=a1:p4
img rp $PROXYADDR FirstBoot2.zmg -ap=a1:p4
reboot -f

Thanks,

John

Labels (1)
0 Likes
21 Replies
Highlighted
Super Contributor.
Super Contributor.

Hi

To be honest I am not sure if it is possible I will have to check (I am out of the office for a few days so could be a while until I can test it).  Could that process be automated we are replacing around 150 laptops soon and it would be a bit of a pain if we have to mess with the partition settings on all of them.

Thanks,

John

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

I'm not sure what you mean by automated....or rather manual.

You have a script that does stuff with partitions.....But it does not align with what your partitions actually contain.  You need to match your script to what is actually in your image in regards to partitions.

--
Please give a hearty thumbs up to any post you find helpful!
To find articles by Craig Wilson simply follow the link: Craig Wilson's Tips!
0 Likes
Highlighted
Super Contributor.
Super Contributor.

Hi

Just trying to get my head around this can I tell it to specify the size of the 1st 2nd and 4th partitions and then tell it to use all the remaining space for partition 3? or am I trying to create the 4th partition within the 3rd partition somehow.

Should I be specifying the size of the 3rd (e.g windows) partition to do, or can you tell it to use all but 450mb of space.

Did this but honestly not sure what I am doing properly.

zisedit computername=

img -pd all

img -pc1 -type=fat32 -size=100 -guid=ESP
img -pc2 -type=1 -size=16 -guid=MRP
img -pc4 -type=ntfs -size=450 -guid=WRE
img -pc3 -type=ntfs -guid=MBD

img -pa1
img -pa2
img -pa4

img rp $PROXYADDR $baseimage.zmg -ap=a1:p1 -ap=a2:p2 -ap=a3:p3 -ap=a4:p4
img rp $PROXYADDR $driverimage.zmg -ap=a1:p3
reboot -f

Sorry for being a bit thick about this, just cannot seem to get it straight in my head.

Thanks,

John

0 Likes
Highlighted
Knowledge Partner
Knowledge Partner

This

 

  • size is a valid size for the partition type.

    You must specify the size in MB or as a percentage of the total capacity of the drive. If you give a percentage, include the % symbol; otherwise, the value is considered the size in MB.

    If you omit this parameter, the largest valid size for the partition type is used, given the available unpartitioned space on the drive.

is the key when creating partitions as per

https://www.novell.com/documentation/zenworks-2020/zen_cm_preboot_imaging/data/bvej8xr.html

And you'll want to create them "in a row", so it'll be a little more tricky if the "variable" part is in between of fixed-size partitions. You could e.g. run something like

blockdev --getsize64 /dev/sda

and calculate the maximum size for P3 from it (devide it by 1024 and subtract 100, 16 and 450). The result (maybe subtract 10MB more for rounding issues) will be the parameter for creating P3 and will leave enough space for P4 afterwards. Don't know whether "blockdev" will be avail in the imaging environment, but if not you could do something like

cat /sys/block/sda/size

if you divide it by 2048 you should also get the device's size in MB.

 

 

 

 

If you like it: like it.
0 Likes
Highlighted
Super Contributor.
Super Contributor.

Hi all

Sorry for long reply time been on annual leave.  It looks like the percentages would be the easiest way but that would mean giving a lot of space over to the extra partitions, if only giving 1% to each one of the fixed sized drives on a standard 120gb ssd that is still over 1gb per partition which when one only needs 16mb is a bit overkill.  I think I know the answer to this already(No) can a mixture be used e.g. the first 2 partitions are done standardly as in specific size given but the second 2 are done with percentage?

Just trying to think of the easiest way of doing this

The blockdev command does seem to work well it gives a response anyway. I will look into this, I am not very good at scripting it might take me a while to figure out the commands needed to do it this way.

Thanks for the help

John

 

0 Likes
Highlighted
Knowledge Partner
Knowledge Partner

Maybe something like this (untested, no warranty)

...

x=`blockdev --getsize64 /dev/sda`
z=$((x / 1024))
let part3size=$z-100-16-500

img -pc1 -type=fat32 -size=100 -guid=ESP
img -pc2 -type=1 -size=16 -guid=MRP
img -pc3 -type=ntfs -size=$part3size -guid=MBD
img -pc4 -type=ntfs -size=450 -guid=WRE

If you like it: like it.

View solution in original post

Highlighted
Micro Focus Expert
Micro Focus Expert

Why not something simple

img rp $PROXYADDR $baseimage.zmg 
img rp drive_bundle

nothing else....no need to delete, create, or worry about what partitions are where.....

--
Please give a hearty thumbs up to any post you find helpful!
To find articles by Craig Wilson simply follow the link: Craig Wilson's Tips!
0 Likes
Highlighted
Super Contributor.
Super Contributor.

Hi All

So that sum was not quite right but I just tweaked it very slightly (I think dividing by 1024 made the number KB’s not MB’s so dividing again seemed to correct it) and it worked perfectly thank you so very much here is the full script which now seems to work great.

x=`blockdev --getsize64 /dev/sda`
z=$((x / 1024 / 1024))
let part3size=$z-100-16-600

img –pd all
img -pc1 -type=fat32 -size=100 -guid=ESP
img -pc2 -type=1 -size=16 -guid=MRP
img -pc3 -type=ntfs -size=$part3size -guid=MBD
img -pc4 -type=ntfs -guid=WRE
img rp $PROXYADDR $baseimage.zmg -ap=a1:p1 -ap=a2:p2 -ap=a3:p3 -ap=a4:p4
img rp $PROXYADDR $driverimage.zmg -ap=a1:p3

reboot –f

I did try the way you suggested Craig and I would love to do it that way to make things really simple however, when I put the image on a 240gb ssd instead of a 120gb one it left me with 111GB of un-partitioned space that cannot be added to the c: drive (see image). Is there a way around this?  We make our image with a 110gb drive so that we know it will fit on any of our SSD’s as they are all bigger than that.

Again Thanks for all the help

John

0 Likes
Highlighted
Knowledge Partner
Knowledge Partner

I'd guess as long long as the "variable" data partition is NOT the last one in the chain you'd have to use the current workaround.

 

If you like it: like it.
0 Likes
Highlighted
Super Contributor.
Super Contributor.

Yeah I will have to stick with the workaround for the moment but it is working perfectly at the moment so no complaints whatsoever, until I have to manually image a machine that is 😀

Thanks for all the help.

John

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.