How to start the ZENworks 11.1 imaging from a USB drive instead of using PXE or the boot CD

0 Likes
Download zcm111usbboot.zip

This is my guide to create a ZENworks 11.1 imaging boot USB Pen Drive. Not a lot of things are needed before you can use a USB Pen Drive instead of the original boot CD. You can then image as you normally do, run a script from the USB Pen Drive or even pull down an image from it.

If you need to be able to use large images, try this solution:
ZENworks 11.1 imaging on a USB drive, with an additional partition for large image files

Inspiration



To get where I ended, I went through this great solution and made my own modifications: ZENworks 7 SP1 Imaging on USB

The items needed from this tool are the files located in the "Data" folder, I'll show this later.



And the ZENworks 7/11.1 docs.



Now let's get started.



What is needed?



First of all, this is what you need to get the job done:







  • A PC installed with Windows XP /7.

    And/or

    A Linux machine

    (In my example I'm using laptops with Windows 7 and OpenSUSE 12.1.)



Got all the files? Then we're ready.



Warning, I can't guarantee this works on all USB pen drives. And do remember that under this process the drive will be cleaned, so backup any data you may have on it before starting.



All the files (on the Windows laptop) in this guide, are located in C:\USBIMAGE\



If you don't want to make it all by yourself, you can use the files attached:
You still need to go through Step One, and then copy the files to your USB Pen Drive.



Step one



Format and make the USB pen drive bootable.




  1. Connect the USB to your computer

  • Open a command prompt and execute:

    C:\USBIMAGE\zen71usb\utils\HPUSBF.exe

    13510-1

    Your USB pen drive is shown, note the ID's.



  • On the command prompt run this:

    C:\USBIMAGE\zen71usb\utils\HPUSBF.exe HD2 -FS:FAT -Q

    13510-2

    Now your USB pen drive is ready



    Note: If you want to put large image files on your USB Pen Drive and restore it, you should format it with FAT32. If you don't want to use the HPUSBF.exe utility, you can also right click the USB Pen Drive and select "Format" and choose FAT32.



  • On the command prompt run this:

    C:\USBIMAGE\zen71usb\utils\syslinux.exe F:

    13510-3

    If you check the pen drive there should be a file called ldlinux.sys (you need to be able to see hidden files)


    Your USB pen drive is now ready and bootable.





Step two



Copy the needed files to the USB pen drive.




  1. First I've copied the bootcd.iso (from the driver update or my own PXE server) and extracted the files to C:\USBIMAGE\bootcd (using winrar)

  • Now, create a new folder on the US pen drive, named ZDM7

  • Copy the file, initrd, from C:\USBIMAGE\zen71usb\data\ to the new folder (ZDM7)

  • Copy all the files from C:\USBIMAGE\zen71usb\data\ to the root of your USB pen drive.

    13510-4

    This is now the content of your USB drive



  • Copy the files, root and root.fonts from C:\USBIMAGE\bootcd\boot\i386 to F:\boot\i386

  • Copy the files, initrd and Linux from C:\USBIMAGE\bootcd\boot\i386\loader to the root of the USB pen drive. Overwrite the two existing files.

  • OPTIONAL, edit the syslinux.cfg (I use winvi). In some cases it's needed to change the syslinux.cfg file, so the USB pen drive is found during boot. I've used this at the end of every menu option:

    install=hd:/dev/sdb1 root=/dev/sdb1




Step three



Copy the needed files on to the Linux machine for further editing.



Switch to your Linux machine.




  1. Log in as root

  • Go to the Home folder of root

  • Create a folder named "Work"

  • In the Work folder create 2 folders, one called ZDM7 and one called ZCM11

    If you'll like you can use these commands to create the folders:

    cd /root/ (make sure you're in the home folder of root)

    mkdir work

    cd /root/work/

    mkdir ZDM7

    mkdir ZCM11

  • In each of the two folders create a folder named "temp", just as shown above

  • Copy the file, initrd, from the USB pen drive you just created, to the ZCM11 folder

  • Copy the file, initrd (the original), from the ZDM7 folder on the USB pen drive, to the ZDM7 folder

    The files you need are now on the Linux machine.





Step four


Extract the original initrd file, from ZDM7.

We need the USBMOUNT.s file from this.



The other configuration changes I've copied from these files: zenworks.s and linuxrc.config.




  1. Open a terminal

  • Make sure you are in the /root/work/ZDM7/ folder

    cd /root/work/ZDM7/



  • Rename initrd to initrd.gz

    mv initrd initrd.gz



  • Unzip the initrd.gz file

    gunzip initrd.gz



  • Extract the files inside initrd to the temp folder

    cd /root/work/ZDM7/temp/



    cpio –idumv < /root/work/ZDM7/initrd >/dev/null 2>%1


    Now do the same with the new initrd file, from the ZCM11 folder.


    The files are now extracted and we can make the needed changes in the files.





Step Five



Now we copy the USBMOUNT.s file and edit the Zenworks.s and linuxrc.config.




  1. From the /root/work/ZDM7/temp/bin folder, copy the usbmount.s file and place it in the /ZCM11/temp/bin/ folder


    If you want to use the terminal:

    cp –r /root/work/ZDM7/temp/bin/usbmount.s /root/work/ZCM11/bin



  • Edit the zenworks.s file, so it has the usb boot settings. Open this file from both the ZDM7/bin/ and ZCM11/bin/ folders

    gedit /root/work/(ZDM7/ZCM11)/bin/zenworks.s



    From the ZDM7/bin/zenworks.s files copy all from

    "if [ $USBBOOT"a" = "YESa" ] ; then"

    To

    "#run before settings.txt" (this line shall not be included)



    Insert the text in the ZCM11/bin/zenworks.s file, and replace from

    "if [ $CDBOOT"cd" = "YEScd" ] ; then"

    To

    "#run before settings.txt" (this line shall not be replaced)



    Close and save the file



  • Edit the linuxrc.config file from /root/work/ZCM11/temp/

    gedit /root/work/ZCM11/temp/linuxrc.config



    Edit it so these lines are as listed here:



    NetSetup=dhcp,all

    ScsiBeforeUsb=0

    insecure=1



    Close and save the file

    Now all the files are edited and added.



Step six


Re-pack, zip and recreate the initrd file



  1. Open a terminal

  • Go to the /root/work/ZCM11/temp folder

    cd /root/work/ZCM11/temp/



  • Re-pack the file

    find . | cpio –quiet –o –H newc > /root/work/ZCM11/initrd



  • Zip the new initrd file

    gzip –v9c initrd > initrd.gz



  • Rename the file

    mv initrd.gz initrd



  • Copy the new initrd file to the root of your USB Pen drive. (replace the old one)
  • Delete the ZDM7 folder on the USB pen drive

    All you need to do now is to check if it boots as wanted.


    You can then edit the settings.txt as wanted, just as if it was a boot from the CD.






Enjoy.



Additional settings



Changes I've made to the settings.txt file, that allows me to get a image from the USB Pen Drive.

First I've created a folder in the root of the USB Pen Drive, called "IMG".

Then I copied the image file to this folder. Here it's the file named "IMG-WIN7-D.zmg".

Open the settings.txt file from the USB Pen Drive and put this command to the end of the file.

export IMGCMD="img -restorel /mnt/usbhd/img/IMG-WIN7-D.zmg"

This will put the image on your device.

If you want to use a script, place your script in the "/addfiles/bin/" folder on the USB Pen Drive. My script is called "Prebootscript.s".

Open the settings.txt file from the USB Pen Drive and put this command to the end of the file.

export IMGCMD="/bin/Prebootscript.s"

This will start your preboot script.

Tags:

Labels:

How To-Best Practice
Comment List
  • a two step process instead is to download unetbootin and boot cd iso. I'll make a couple screenshots later. only one file to change while in windows.
  • If you want to use the terminal:

    cp –r /root/work/ZDM7/temp/bin/usbmount.s /root/work/ZCM11/bin
    Edit the zenworks.s file, so it has the usb boot settings. Open this file from both the ZDM7/bin/ and ZCM11/bin/ folders

    gedit /root/work/(ZDM7/ZCM11)/bin/zenworks.s

    Was the /temp/ left out of these paths on purpose? Just wondering because something is missing then.....
  • in reply to MigrationDeletedUser
  • in reply to MigrationDeletedUser
    ...if you run into any problems :)

    Thanks, I'm also looking forward, to see if it's useable to some :)
  • in reply to MigrationDeletedUser
    Hi marcelvandenberg

    Thanks for all the informations you provide, I've noted them all and I'll try to see if I can create these issues myself. The devices I used use power from the USB bus, but if I can find one with it's own power supply I'll test at once.
    I have 16 different machines to test the boot on, so in that part I should be covered ;)

    I'm also going to look further into the problem with writing to the Image Safe Data.

    I'll of course keep you posted, on how it goes.

    Glad to hear, I hope the new article can be usefull.
  • in reply to MigrationDeletedUser
    kool -i'm still going through your zenworks usb article steps and looking forward to your newest art.
  • in reply to MigrationDeletedUser
    A quick note to inform you guys. I tried it on a Freecom buspowered 80 GB USB external drive (a bit older drive, but the only one i have available at this moment), I managed to get it bootable with one 80 GB FAT32 partition with a few problems though.

    Booting from a HP 5850 SFF workstation the drive boots the complete kernel but stops at the very end when attempting to mount it to /mnt/usdhd. A quick check with ctrl-alt-F4 shows the following message appearing every 2 seconds or so:
    "usb 6-1 reset full speed USB device using obci_hcd and address2".
    I tried booting it on another type HP workstaton (HP6005 SFF) and had the same problem. The error this time was:
    "usb 6-1 reset full speed USB device using ebci_hcd and address2".

    I suppose i could use modprobe -r ohci_hcd or modprobe -r ehci_hcd in settings.txt, but then i think i would lose the USB 2.0 performance and imaging would be really slow. So i tried it again with this time "modprobe -r ehci_hcd" in settings.txt and then it boots fine. The disk does however does not get mounted at /mnt/usbhd.
    fdisk -l shows that the workstation see this drive as /dev/sdc1 instead of the /dev/sdb1 entry i had with the 8 GB USB stick. And as i expected. mounting it manually and then starting imaging is really, really, really slow.

    I have no other USB external disk to try so my personal view is that you should be able to get this to work, but definitely not with all hardware. I think that you need the right combination of a specific workstation(s) and externa USB drive, so in the end it looks like a case of try and error.

    This more or less is confirmed by the last post of nop1983, with the exception that he has it working and i still have some problems. I remember reading in the past something about a difference between a bus powered USB drive and a self powered USB drive (with its own power adapter). Perhaps that this might also be an issue? Anyway, i am looking forward to nop1983's new article :-). Hope you can use this information. Kind regards.
  • in reply to MigrationDeletedUser
    Hi macelvandenberg

    Yes, I do believe it's an hardware issue... I did though try another version of syslinux on a USB drive that would not boot and it fixed it. So perhaps there could be a difference or maby I was just lucky :)
    So I now have this up and running on a 250gb USB Hard drive with a boot partition and a image partition. I'll upload a new article that shows how it's done, hopefully this can be usefull to some.
  • in reply to MigrationDeletedUser
    Hi lilodessa

    I just got this working on a external USB Hard Drive (250GB). I've been told to create a new article on the use of the extra partition and in there I'll inform on the large disks also, hope this will help you to get what you want? :)
  • in reply to MigrationDeletedUser
    if i can find the time (some issues with Windows 7/ZCM 10.34 at the moment) i will try to test the same for you what we have achieved on the 8 GB USB stick on a larger 80 GB external USB drive. Just to see if it is possible at all. As mentioned before, it does not work on all USB sticks, so your problem might just be hardware related.
    Using one large FAT32 partition on the USB drive ii see no direct reason (other then specific hardware issues) why this should not work. I will post my results after trying.
Related
Recommended