Issue
Dell configure a utility partition on all machines they sell. An IT department may decide that this partition is not required on built machines.
This partition may also cause issues with Windows deployments where the boot loader is no longer able to find the Windows installation on the first partition.
The Dell utility partition is not visible from img
within the ZENworks imaging environment and cannot be removed using the img
partitioning actions
Requirements
- Imaging Toolkit 10.x
- ZCM Environment with imaging configured to use Zim
- Dell machine configured with a utility partition
Solution
Use the zimget.s
script to check if a Dell Utility partition is configured.
If the partition is detected it will be removed (using the fdisk
utility) along with all other partitions prior to images being restored on the machine.
NOTE: | The example given below is based on a standard zim.cfg file. It is straightforward to incorporate this function into more advanced zim.cfg files. If assistance is required contact ENGL |
|
Procedure
WARNING! | The scripts included below will remove ALL partitions (including the Dell Utility partition) from the disk using fdisk prior to restoring appropriate ZENworks images. |
|
Update zimget.s
script file
- Open the
zimget.s
file with a text editor
- Edit the
zimget.s
file to add the changes shown in green
#!/bin/ash
# Created: August 18, 2017
ZIMDIR=/zimbin
export ZIMDIR
# Determining drive type...
if cat /proc/partitions | grep hda > /dev/null; then export HDTYPE=hda; fi
# Identify local fixed disk(Non-USB)
FIXED_DRIVE=""
for _device in /sys/block/sd*/removable; do
if echo $(readlink -f $_device)|egrep -v -q "usb"; then
_disk=`echo $_device | cut -f4 -d/`
# first fixed disk to be identified will be used.
FIXED_DRIVE="$_disk"
break
fi
done
export HDTYPE=$FIXED_DRIVE
# Determine if there is a Dell partition configured
if fdisk -l | grep Dell > /dev/null; then export DELLPART=True; else export DELLPART=False; fi
echo Downloading ENGL Zim files...
tftp $PROXYADDR /dev/null
verbose on
bin
get zimfiles/ldapsdk.tar $ZIMDIR/ldapsdk.tar
get zimfiles/zim.tgz /zimbin/zim.tgz
get zimfiles/engl.lic $ZIMDIR/engl.lic
get zimfiles/zim.cfg $ZIMDIR/zim.cfg
get zimfiles/images.ini $ZIMDIR/images.ini
get zimfiles/projects.ini $ZIMDIR/projects.ini
get zimfiles/zimrun.s $ZIMDIR/zimrun.s
quit
_END_
echo Unpacking Zim libraries...
tar xf $ZIMDIR/ldapsdk.tar -C / > /dev/null
/bin/rm -f $ZIMDIR/ldapsdk.tar
tar zxf $ZIMDIR/zim.tgz -C $ZIMDIR > /dev/null
/bin/rm -f $ZIMDIR/zim.tgz
crlf.s $ZIMDIR/zimrun.s > /dev/null 2>&1
chmod +x $ZIMDIR/zim
- Save changes to
zimget.s
and update file on the server.
Modify zim.cfg file
- Open the
zim.cfg
file with a text editor - Update the
zim.cfg
file with the following information:
- Check if DELLPART variable has been set
Search the zim.cfg
file for the appropriate section and add the changes shown in green
Dialog:Ask,"", "Warning! All hard disk data on this machine will be erased.\n \nContinue?","_YesNo",red
If:Var,_ask,eq,"_No"
Menu:Return
End:
; Remove Dell utility partition (if it exists)
if:var,DELLPART,eq,"True"
gosub:remove_dell_partition
end:
Dialog:Popup,"Restoring ENGL Smart Windows build process, please wait...",green
Pause:3
File:Run,"img %imgrestorecmd%%project_image_path%/%base_image%",verbose
- Configure
remove_dell_partition
function to remove the partition
Search the zim.cfg
file for the appropriate section and add the changes shown in green
Label:Error_255
Dialog:Banner,"User aborted multicast session",2,Red
Return:
; ------------------------------------------------------
; Remove Dell Partition (function)
; ------------------------------------------------------
label:remove_dell_partition
Dialog:Popup,"Removing DELL Partition, please wait...",green
File:Run,"rm /zimbin/dellpart.del"
File:Append,"/zimbin/dellpart.del","d"
File:Append,"/zimbin/dellpart.del","4"
File:Append,"/zimbin/dellpart.del","d"
File:Append,"/zimbin/dellpart.del","3"
File:Append,"/zimbin/dellpart.del","d"
File:Append,"/zimbin/dellpart.del","2"
File:Append,"/zimbin/dellpart.del","d"
File:Append,"/zimbin/dellpart.del","1"
File:Append,"/zimbin/dellpart.del","w"
; Run dellpart.del script
File:Run,"fdisk /dev/%HDTYPE% < /zimbin/dellpart.del > /dev/null",silent
Set:dellpart,"false"
Dialog:Popupclose
Return:
; ------------------------------------------------------
; Logout
; ------------------------------------------------------
- Save changes to
zim.cfg
and update file on the server.
Test
- PXE boot a machine to ZENworks imaging/ZIM environment that has a Dell utility partition
- Select Restore Menu - select and restore a project
- Prior to the image files being restored - a popup will display indicating "Removing DELL Partition, please wait..." The image files then restore as normal
- Review the partition table - the Dell partition will have been removed
Additional information
If you wish to test the deletion of a Dell utility partition it helps if there is an appropriate partition available to be deleted
To create a basic partition (one that does not contain any utilities):