Issue

Zim fails to write information to ZISD.

The most common issue is that the hard disk does not have enough free space for ZISD to be written.

This can occur for several different reasons, the most common being;

  • A new hard disk has been installed (all sectors have been preformatted)
  • A hard disk has been erased/wiped (0/1 written to every sector of the disk multiple times)
NOTE: This TID is only valid when running Zim in the native ZENworks Imaging environment (linux).


Solution

Zim can run a command to make space for ZISD to be written.

NOTE: The latest release(s) of ZENworks Configuration Management consider sectors 34-63 as suitable for writing ZISD information. In the past sectors 6-63 were valid for ZISD. This change has been made because GPT disks use the space that was previously used for ZISD to store Boot Configuration Data (BCD). If this information is not set correctly then the machine will fail to boot.


WARNING! The following procedure will clear several sectors of the hard disk. Data on the hard disk may be lost. Do NOT perform this procedure in a production environment without first fully testing in a non-production test environment.



The standard zim.cfg file has a ZISD:Write function that contains an error check.

Zisd:Write
; Trap ZISD:Write errors
If:Var,_ERROR,NE,"0"
Dialog:Ask,"Error!","An error occurred writing information to ZISD!","_Ok",red
End:

If the variable _ERROR

  • is equal to "0" then the ZISD write was successful
  • is not equal to "0" then the ZISD write was not successful and Zim will display an error message.

It is possible to extend this error check to attempt to create space for ZISD to be written then retry the write before reporting a failure message as follows


  • Update the zim.cfg file ZISD:Write section: 
    ; Update the information in ZISD
    ZISD:Put,NetBiosName,"%COMPUTERNAME%"
    ZISD:Put,VendorDataENGL,"%VendorDataENGLSTRING%"
    ZISD:Write
    
    ; Trap ZISD:Write errors
    If:Var,_ERROR,NE,"0"
    Dialog:Ask,"Error!","An error occurred writing information to ZISD!","_Ok",Red
    End:
     with the entries shown in green 
    ; Update the information in ZISD
    ZISD:Put,NetBiosName,"%COMPUTERNAME%"
    ZISD:Put,VendorDataENGL,"%VendorDataENGLSTRING%"
    Set:ZISDUpdateCount,"1"
    Label:UpdateZISD
    ZISD:Write
    
    ; Trap ZISD:Write errors
    If:Var,_ERROR,NE,"0"
    If:Var,ZISDUpdateCount,LT,"3"
    Set:ZISDUpdateCount,math(+, 1)
    File:Run,"dd if=/dev/zero of=/dev/%HDTYPE% bs=512 seek=34 count=3",Silent
    Goto:UpdateZISD
    Else:
    Dialog:Ask,"Error!","An error occurred writing information to ZISD!","_Ok",red
    End:
    End:
  • Make a backup copy of current zim.cfg file on server.
  • Save the updated zim.cfg file to the server.


If a ZISD write error occurs Zim will make 3 attempts to clear space on the disk and check if the ZISD write is successful prior to displaying an error message


This is applicable to machines using either BIOS or EFI firmware.

If you have any problems or questions about the script or steps in this TID  please contact the ENGL support team