This is my guide to create a ZENworks 11.1 imaging boot USB Pen Drive with an additional Linux partition. It’s a continuation of my last post; How to start the ZENworks 11.1 imaging from a USB drive instead of using PXE or the boot CD.
It’s very easy to create your own bootable USB Pen Drive with two partitions; one bootable FAT32 partition which holds the ZENworks imaging engine and a EXT4 partition for large image files.
The use of large image files is the main reason why this guide is created. FAT32 has a max file size of “4″ GB, so if your image files are larger than that the EXT4 partition is usable, it can hold files with a size up to 16 TiB (should last a while)
If you want, you can combine this and the first post; use this guide to partition your USB Pen drive and jump to the other post and continue from Part 4 in Step one.
Or you can do it the fast (lazy) way and use the files attached to this article. Files from the “USBdata” folder can be copied to the root of the USB Pen Drive and you’re good to go.
Remember to make the needed changes in settings.txt (and if you use scripted imaging, the image script) I’ve added examples that apply an image from the EXT4 partition.
This guide is tested with a 16GB USB Pen Drive and with 250GB/500GB external USB Hard drives, but can’t guarantee it will work on all kind of drives.
Found my inspiration from these sites:
What is needed?
First of all, this is what you need to get the job done:
GParted – Find the latest release here: http://sourceforge.net/projects/gparted/files/gparted-live-stable/ (however no need to download and compile manually)
You could also use the GParted Live USB and boot from a Windows machine, the things you do with the USB Pen Drive are the same.
Extlinux / Syslinux – Free from: http://www.kernel.org/pub/linux/utils/boot/syslinux/ (however no need to download manually)
Files attached to this article. The files in this article are updated files from the first article.
Else you could still use:
Files from my first post: How to start the ZENworks 11.1 imaging from a USB drive instead of using PXE or the boot CD You could use the files attached or the ones you created yourself.
A third option is to use the files from a UNetbootin USB device, see more under additional settings last in this guide.
ZENworks preboot files from your own environment or get the latest Imaging Driver Update from http://download.novell.com (only if you want to create the files yourself)
A Linux machine, in my example I’m using a laptop with OpenSUSE 12.1. (KDE)
Got all the files? Then we’re ready.
All the files, on the Linux laptop, in this guide, are located in /root/work/USBDATA/
Throughout this guide I’m at all times logged in as “root”.
Download and install GParted and Syslinux on the machine.
The easiest way to do this is to search for “syslinux” and “gparted” in YAST2 Software Management and install them both. (if using OpenSUSE)
Otherwise use the files you downloaded to install them.
Format and make the USB drive bootable
- Connect the USB to your computer.If you like you can use fdisk -l (from a terminal) to see more on your device:It shows the partitions and if it’s bootable (marked with a * ).Before you can work with it in GParted you need to unmount it.Open a terminal and run this command:
- Start GParted and select your USB device from the dropdown box (right top)Your USB pen drive is shown.My USB device already has a partition, this needs to be deleted.
- Delete the partition(s) by selecting the partition and hit the red X. All partitions have to be removed.Your USB pen drive are now clean
- Create the FAT32 (boot) partition by selecting the unallocated, right click and choose “New”.Create the FAT32 with a disk size of 999MB and name it BOOT.
- Create the EXT4 (images) partition by selecting the unallocated, right click and choose “New”.Create the EXT so it uses the rest of the space and name it IMAGES.Click “Add”Booth partitions are now ready for creation.
- End the configuration by selecting “Apply All Operations”.Gparted deletes and creates the new partitions.
The partitions are now created.
- Make the BOOT partition “bootable” by marking the BOOT partition, selecting “Partitions”, select “Manage Flags” and mark the “Boot” option in the top.The device is now bootable and ready for use.
Install EXTLINUX/SYSLINUX on the USB device.
You need to know where the device is mounted, in this case it’s mounted in /media/BOOT/ (this is the FAT32 partition)
- Open a terminal
- Run this command to install EXTLINUX/SYSLINUX
Extlinux --install /media/BOOT/
SYSLINUX is now installed.
Copy the needed files to the USB device (Note: this could also be done from a Windows machine)
My device (the FAT32 partition) is still mounted in /media/BOOT/
- Go to the home folder of root
- Create a folder named “Work” (the full path should be /root/work/)If you like you can use these commands to create the folders:
cd /root/ (make sure you're in the home folder of root) mkdir work
- Put the files from this article into this folder (the full path should be /root/work/USBDATA/)
- Copy the files from /USBDATA/BOOT/ to the root of the USB device.
Cp -r /root/work/USBDATA/BOOT/* /media/BOOT/
The files you need are now on the USB device.
Copy image files to the extra EXT4 partition.
My device (the EXT4 partition) is mounted in /media/IMAGES/
- First copy your image files to the /USBDATA/IMAGES folder (the full path should be /root/work/USBDATA/IMAGES/)
- Copy the files from USBDATA/IMAGES/ to the root of the USB device
Cp /root/work/USBDATA/IMAGES/* /media/IMAGES/
The image files are now on the USB device.
To ease the work; these are the commands I use:
This completes step three, four and five.
The USB device are now final and ready to use. Just unmount the device (both partitions) and try booting it.
Note: if you use an USB Hard Drive it could need some time to load before you hit the boot from USB button.
I’ve changed the settings.txt file, which allows me to get an image from the USB device with two partitions. The setting.txt file attached to this article mounts the two partitions and if you choose, it activates one of the two scripts also attached.
Short brief of the files attached:
/USBDATA/BOOT/addfiles/bin/PrebootscriptPROXY.s – pulls an image from the PROXY server
/USBDATA/BOOT/addfiles/bin/PrebootscriptUSB.s – pulls an image from the EXT4 partition
/USBDATA/BOOT/settings.txt – configured to activate the USB device
- choose one of scripts to use or use this command:
export IMGCMD="img -restorel /mnt/usbhd2/IMG-WIN7.zmg"
- by default it does nothing
If you want to use your own script, place your script in the “/USBDATA/BOOT/addfiles/bin/” folder. My script is called “Prebootscriptxxxx.s”.
Open the settings.txt file from the USB Pen Drive and put this command to the end of the file
This will start your preboot script.
Using UNetbootin files
These files are found on a device create using this cool solution tool:
Auto Install ZENworks Image Engine on USB using UNetbootin
Use the files from the root of the device.
UNetbootin Device – it contains all the files needed to create the USB device boot using the UNetbootin engine
After step three just copy all the files from the UNetbootin device to the root of the BOOT partition on the new USB device.
This has also been tested to work with the use of UNetbootin to place your bootcd iso file onto the BOOT partition.
I’ve made a modified iso file which contains the original files from the bootcd and files edited to work with USB device. This is easy to do, but if some would like the iso, or like to know what’s changed just leave a note and I’ll provide it for you. I would have added it to this article, but can only upload 100MB
After the first three steps I just run UNetbootin, choose my modified ISO and select the BOOT partition (/dev/sdb1) -> Done.
Note: This can also be done from a Windows machine, if it’s easier to you.
During my tests I saw issues regarding types of hardware (USB Devices), so don’t give up if one fails.
Give your workstation time to find and activate the USB Device during boot (mostly the large Hard Drives)
Both FAT16 and FAT32 should work as the first partition (BOOT) file system.
All of the EXT2, EXT3 and EXT4 should work as the second Linux partition file system.