Cool Solutions

ZENworks 11.1 imaging on a USB drive, with an additional partition for large image files

nop1983

By:

February 22, 2012 9:45 am

Reads: 7094

Comments:10

Score:0

Download usbdata.zip

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.

Inspiration

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.

Warning! Please 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 Linux laptop, in this guide, are located in /root/work/USBDATA/

Throughout this guide I’m at all times logged in as “root”.

Step one

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)

112

Otherwise use the files you downloaded to install them.

Step two

Format and make the USB drive bootable

  1. Connect the USB to your computer.If you like you can use fdisk -l (from a terminal) to see more on your device:11It 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:
    umount /dev/sdb1
  2. Start GParted and select your USB device from the dropdown box (right top)33Your USB pen drive is shown.My USB device already has a partition, this needs to be deleted.
  3. 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

    55

  4. Create the FAT32 (boot) partition by selecting the unallocated, right click and choose “New”.66Create the FAT32 with a disk size of 999MB and name it BOOT.

    77

    Click “Add”

  5. 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.88Click “Add”Booth partitions are now ready for creation.
  6. End the configuration by selecting “Apply All Operations”.99Gparted deletes and creates the new partitions.

    100

    The partitions are now created.

  7. Make the BOOT partition “bootable” by marking the BOOT partition, selecting “Partitions”, select “Manage Flags” and mark the “Boot” option in the top.110The device is now bootable and ready for use.

    111

    Close GParted

Step three

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)

  1. Open a terminal
  2. Run this command to install EXTLINUX/SYSLINUX
Extlinux --install /media/BOOT/

SYSLINUX is now installed.

Step four

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/

  1. Go to the home folder of root
  2. 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
  3. Put the files from this article into this folder (the full path should be /root/work/USBDATA/)
  4. 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.

Step Five

Copy image files to the extra EXT4 partition.

My device (the EXT4 partition) is mounted in /media/IMAGES/

  1. First copy your image files to the /USBDATA/IMAGES folder (the full path should be /root/work/USBDATA/IMAGES/)
  2. 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:

    22_1

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.

Additional settings

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

export IMGCMD="/bin/Prebootscript.s"

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.

Using UNetbootin

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.

Additional Info

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.

VN:F [1.9.22_1171]
Rating: 0.0/5 (0 votes cast)

Tags: ,
Categories: Technical, ZENworks

Disclaimer: This content is not supported by Novell. It was contributed by a community member and is published "as is." It seems to have worked for at least one person, and might work for you. But please be sure to test it thoroughly before using it in a production environment.

10 Comments

  1. By:marcelvandenberg

    Super! I am not at work next week, but when i return the week after ii will try to find the time to test this manual and post my results. Thanks in advance for all your work and kind regards.

    Marcel

    VN:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
  2. By:nop1983

    Looking forward to your review Marcel.
    I’ve also got some good news regarding the abillity to write to the Zisd ;-)
    I’ll post this when I’m done testing.

    VN:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    • By:marcelvandenberg

      I was finally able to try this new manual with the exact same hardware i previously used testing the article “How to start the ZENworks 11.1 imaging from a USB drive instead of using PXE or the boot CD”.

      For this test i used a Freecom buspowered 80 GB USB external USB drive in combination with two of our production desktops: the HP Desktops HP5850 SFF and HP6005 SFF.
      I used the same ZCM 10.3.4. files i created during testing of the earlier article so i could easily spot and note any differences between both methods.
      I also decided to upgrade my openSUSE-KDE VM (currently running on VMware workstation 8.02) from 11.2 to 12.1, so i could test using the same OS as the author. This upgrade was also the main reason for the delay of this test, since i had to spend some time getting VMware Shared folders and Zypper working properly again. All is well now ;-).

      After installing GParted and Syslinux i attached the Freecom Drive and followed all the mentioned steps. This went exactly as described and i after this i had no problems copying the needed ZCM and Image files to the Freecom partitions. No problems so far.
      The Freecom showed to be bootable after this and after booting it on the HP 5850 SFF Desktop i found i was experiencing the same problem i had before. The drive boots fine, but the bootprocess stops at the very end when attempting to mount it to /mnt/usdhd. A quick check with showed the same 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 the 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″.

      After placing “modprobe -r ehci_hcd” and “modprobe -r ehci_hcd” in settings.txt the bootprocess continues but fails to mount the disk at /mnt/usbhd. Fdisk -l shows that the HP Desktops see the Freecom partitions as /dev/sdc1 and /dev/sdc2 instead of /dev/sdb1 and /dev/sdb2. Mounting both partions manually using the following commands of the article was no problem:
      mkdir /usbhd
      mount /dev/sdc1 /usbhd
      mkdir /usbhd2
      mount /dev/sdc2 /usbhd2

      After this i tried to manually start imaging using the Image files on /usbhd2 and this works. Really, really slow of course because of the earlier “modprobe -r” addition.

      So, based on this test, my conclusion is that this prcocedure will basically work and that the main problem lies in finding the right combination of hardware. I will (in the next week or so) try to get my hands on another external USB drive to see if i can get rid of the problems i had with the Freecom drive and can test a complete Imaging procedure with our current production .ZMG images. I will keep you posted on this.

      ps.
      We still have the earlier mentioned ZISWIN problem with this. When booting from USB, ZISWIN.EXE is trying to write to the USB device and fails. If the USB device is removed, ZISWIN.EXE works as expected. So we still have to use the following workaround in the script:
      “Prompting to remove the USB Device, cheking if this is indeed removed and then running ZISWIN.

      I hope this test will help others as well and of course again many thanks to the author for all his hard work.

      Kind regards,

      Marcel

      VN:F [1.9.22_1171]
      Rating: 0.0/5 (0 votes cast)
      • By:nop1983

        I am impressed with your work. Sorry I’ve not had the time to reply until now. After ZCM Sp2 came, it has been a little busy ;-)

        Glad you’ve got a working solution in place now…

        I did find a way to auto detache the USB drive after load of the kernel, making it possible to write to ZISD. But have not found a way to get it attached again, so that you can download images from the the USB drive. (have to attach it manually again)

        So there’s your solution really good :)

        VN:F [1.9.22_1171]
        Rating: 0.0/5 (0 votes cast)
  3. By:lilodessa

    I was able to create a image environment with my external usb drive following your instructions -unfortunately I recently wiped out my fat32 boot partition somehow after restoring a image to a PC. We have a few computers that aren’t usb bootable so I booted using one of our zenworks CD. I’m still wet behind the ears when it comes to linux-mounting etc…. so I mounted the image extended partition and browsed to the image I wanted. Everything worked but as soon as it was complete I realized I wiped the boot partition. Is there anything I should watch out for or a way to protect that boot partition so I don’t do this again?

    VN:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
  4. By:marcelvandenberg

    I managed to borrow from our serviceteam a Western Digital 1 Terrabyte buspowered USB Disk and made the exact same test again.
    This time all worked flawlessly! Both partitions are being recognized as /sdb1 and /sdb2 and are mounted without problems and imaging works completely from the USB disk. I tested this with and without a network cable attached to the desktops.

    So, using this method it’s no problem to image a desktop completely offline from USB, move the desktop to another location, attach the network cable and
    let sysprep do its work and have a complete desktop ready for use afterwards.
    The key to success (not forgetting this manual of course) lies for a great part in the right combination of hardware components and this is a case of try and error. Great stuff!

    As for the question of lilodessa:
    To avoid wiping an unwanted partion you could perhaps try to script the actions you want to perform and only use the script to do the imaging?
    Perhaps scripting something like this:

    harddisk=`fdisk -l | grep “^/dev” | grep -v sda | awk ‘{print $1}’`
    case `basename ${harddisk}` in
    hda1)
    img pd1
    img pc1 NTFS
    img pa1
    img restorel /mnt/harddisk/idcsp3-ie8.zmg a1:p1
    ;;
    *)
    Another action or quit or something like that?
    ;;
    esac
    exit 0

    I am sure you can find better examples than this on the Internet.

    Thanks again and kind regards,

    Marcel

    VN:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
  5. By:tbowman1724

    1) Can you post simple steps on how to update the Zen imaging to 11.2?

    2) Before I waste a bunch of time testing and fiddling with things, is there any reason the 2nd partition can’t be NTFS so it can be read from both Windows and Linux?

    3) When I was working with this, I was logged in as a root equivalent and not actually root. Gparted didn’t give me all the options necessary until I logged in as root. Just an FYI to others that ‘root’ is really the way to go here.

    4) THANKS!

    Todd B.

    VN:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
  6. By:eroemer

    I use the previous method (http://www.novell.com/communities/node/13523/install-zenworks-image-engine-usb-using-unetbootin) to auto create the bootable USB flash drive using UNetbootin, then I use a free Windows utility called “MiniTool Partition Wizard Home Edition” (http://www.partitionwizard.com/free-partition-manager.html) to resize the FAT32 bootable ZEN partition down to about 1GB, then create an EXT4 partition with the remaining drive space. I get a bootable ZEN USB drive with an EXT4 partition for images in about 3 minutes.

    I could never get a working boot drive when I created the two partitions (FAT32 and EXT4) first.

    I use 32GB USB flash drives.

    VN:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
  7. By:PruittJ

    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 :-)

    I would be interesting in getting the modified ISO.

    I got a bit lost in your instructions since I am not a Linux admin. Do you happen to have a windows procedure for this?

    I have to ISO modifed with our settins.txt and tried just copying those to the usb stick but it will not boot from it. The computer will boot from a usb stick as I do it with other things but again I use Windows to format the usb stick which does nothing to the usb stick mbr for booting that I can see, but as I understand it, the files are all that is important to get it to boot. What am I missing?

    Thank you.

    VN:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)

Comment

RSS