Absent Member.
Absent Member.
9904 views

Zen 11 USB Booting

Hello Everyone, we are trying to push imaging from CD's to USB Devices. In doing so we used unetbootin to create a working image on the usb drive. We are able to successfully boot into the USB device, but when it enters automatic mode, something odd happens.

Normally when we boot to a CD and enter automatic mode, it query's the zcm server, brings up a list of images, and we download and image onto the PC

Now when we try to boot into the USB version of the zcm imaging system, it querys the server to see if there is an image waiting for it. If there is no image, it reboots the computer.

What we want is the CD version of automatic mode to initiate. I feel as if this has to do with the boot loader. Here is the CFG file that we use in unetbootin. And we enter the linux option when trying to boot.

[HTML]default menu.c32
prompt 0
menu title UNetbootin
timeout 100

label unetbootindefault
menu label Default
kernel /ubnkern
append initrd=/ubninit ramdisk_size=67584 splash=silent mode=1 USDBOOT=YES showopts vga=0x0314 acpi=off nolapic install=hd:/dev/sdb1 root=/dev/sdb1

label ubnentry0
menu label linux
kernel /boot/i386/loader/linux
append initrd=/boot/i386/loader/initrd ramdisk_size=67584 splash=silent mode=2 USDBOOT=YES showopts vga=0x0314 acpi=off nolapic install=hd:/dev/sdb1

root=/dev/sdb1

label ubnentry1
menu label manual
kernel /boot/i386/loader/linux
append initrd=/boot/i386/loader/initrd ramdisk_size=67584 splash=silent mode=5 USDBOOT=YES showopts vga=0x0314 acpi=off nolapic install=hd:/dev/sdb1

root=/dev/sdb1

label ubnentry2
menu label config
kernel /boot/i386/loader/linux
append initrd=/boot/i386/loader/initrd ramdisk_size=67584 splash=silent mode=7 USDBOOT=YES showopts vga=0x0314 acpi=off nolapic install=hd:/dev/sdb1

root=/dev/sdb1

label ubnentry3
menu label install
kernel /boot/i386/loader/linux
append initrd=/boot/i386/loader/initrd ramdisk_size=67584 splash=silent mode=4 USDBOOT=YES showopts vga=0x0314 acpi=off nolapic install=hd:/dev/sdb1

root=/dev/sdb1

label ubnentry4
menu label lilo
kernel /boot/i386/loader/linux
append initrd=/boot/i386/loader/initrd ramdisk_size=67584 splash=silent mode=3 USDBOOT=YES showopts vga=0x0314 acpi=off nolapic install=hd:/dev/sdb1

root=/dev/sdb1

label ubnentry5
menu label disable
kernel /boot/i386/loader/linux
append initrd=/boot/i386/loader/initrd ramdisk_size=67584 splash=silent mode=3 DISABLEZEN=1 USDBOOT=YES showopts vga=0x0314 acpi=off nolapic

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

label ubnentry6
menu label enable
kernel /boot/i386/loader/linux
append initrd=/boot/i386/loader/initrd ramdisk_size=67584 splash=silent mode=3 ENABLEZEN=1 USDBOOT=YES showopts vga=0x0314 acpi=off nolapic

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

[/HTML]
Labels (2)
0 Likes
45 Replies
Highlighted
Knowledge Partner
Knowledge Partner

Re: Zen 11 USB Booting

Have not tried that before...

With what you are trying to do, a quick and dirty 'hack' could be to rename the auto cmd file on the disk to the manual version? In any case it seems to have to do with which configuration file is being called. I'd have to take a closer look at the boot configuration to be able to say more about it, as it has changed a bit since Zen 7 😛

-Willem
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Zen 11 USB Booting

Ok, I changed auto from

[HTML]label ubnentry0
menu label linux
kernel /boot/i386/loader/linux
append initrd=/boot/i386/loader/initrd ramdisk_size=67584 splash=silent mode=2 USDBOOT=YES showopts vga=0x0314 acpi=off nolapic install=hd:/dev/sdb1 root=/dev/sdb1[/HTML]

to

[HTML]label ubnentry0
menu label linux
kernel /boot/i386/loader/linux
append initrd=/boot/i386/loader/initrd ramdisk_size=67584 splash=silent mode=5 USDBOOT=YES showopts vga=0x0314 acpi=off nolapic install=hd:/dev/sdb1 root=/dev/sdb1[/HTML]

The system booted right into manual mode. I have a sneaking suspicion that this isn't what you want me to do. I'll be happy to give you any data you need in regards to getting the USB devices to work exactly like the CD devices. Here is the isolinux.cfg from our current CD, which works fine.

[HTML]default linux

label linux
kernel linux
append initrd=initrd ramdisk_size=67584 splash=silent mode=2 CDBOOT=YES showopts vga=0x0314

label manual
kernel linux
append initrd=initrd ramdisk_size=67584 splash=silent mode=5 CDBOOT=YES showopts vga=0x0314

label config
kernel linux
append initrd=initrd ramdisk_size=67584 splash=silent mode=7 CDBOOT=YES showopts vga=0x0314

label install
kernel linux
append initrd=initrd ramdisk_size=67584 splash=silent mode=4 CDBOOT=YES showopts vga=0x0314

label lilo
kernel linux
append initrd=initrd ramdisk_size=67584 splash=silent mode=3 CDBOOT=YES showopts vga=0x0314

label disable
kernel linux
append initrd=initrd ramdisk_size=67584 splash=silent mode=3 DISABLEZEN=1 CDBOOT=YES showopts vga=0x0314

label enable
kernel linux
append initrd=initrd ramdisk_size=67584 splash=silent mode=3 ENABLEZEN=1 CDBOOT=YES showopts vga=0x0314

implicit 1
gfxboot bootlogo
display message
prompt 1
timeout 200[/HTML]

The commands acpi=off nolapic were added to get the USBs to allow our Dell Optiplex 320's to reboot properly.
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Zen 11 USB Booting

Ok, just a quick update. I was playing around with a few old boot loaders, and I found this old site.

Cool Solutions: ZENworks 7 Imaging from USB drives using EXT2 partitions

Now, reporposing this to work with zen 11 was not easy, as its still not working 100% but I thing i'm off to a good start. After downloading this:

Cool Solutions: ZENworks 7 SP1 Imaging on USB

I opened up the folder and saw all the old files nestled within. the data folder looked like a ZEN iso, and there was a separate folder for all the changes. the nice and simple exe on the root of the extracted folder did not work at all. It would try to re-image the disk, fail, and then yell at me for nothing. I think it might be because it's 8 Gig, but no one sells anything less!

Anyway, after using the commands on the cool solutions page, up to step 7, I have a somewhat working USB boot disk. I turn it on, and 'ta-da!' i have a owrking USB disk. kinda. The proxy server needs to be set up, and the system has no drives for any of our systems. I copied over our current cD, which overlapped everything except the sysconfig, linux, and init.d files on the root of the thumbdrive. I go to boot again, and instead of using the files I updated, it called to 2007 linux and initd files. Using some problem solving, I took the linux and initd files from the boot folder and copied them over the ones on the root. excellent, it now boots into the modern zenworks release.

Everything appears to work fine, until I reach a nice big red error. 'Could not find the Zenworks Repository.' This is where I am stuck.
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Zen 11 USB Booting

Ok, I have continued my progress a bit more with this thing.

the zenworks repository issue came from a bit of an odd error actually. Some fiddling around fixed it. Anyway, so now that I have the USB able to boot, it enters the query version of automatic mode. Here is where my boss tells me a bit of important information; We are using a script.

Ok, so the script isn't coming up when its in the /addfiles/bin/ folder. I entered manual mode, cd-ed into bin, ls showed nothing at all. Apparently the disk isn't taking the files from the folder and adding them into the ramdisk. To get around this, i figured it might be best to add the files to the initrd file. the problem is initrd appears to be a tar ball wrapped in a gzip. I un-gziped the file, un-tared it, and added my file into bin. I wrapped it back up, removed the extension, wrapped that up, and removed the extension as well. Now the initrd file won't load properly.

My new question is, is there any way to add files to the initrd file, or force zen to see the addfiles and add them. i need that script working on the USB to get the functionality I desire.
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Zen 11 USB Booting

Here is a bit of advice for all you aspriring sysadmion and anyone who finds this thread in the archive. NEVER TRY TO EDIT THE RAMDISK FILE. I pulled way to much of my hair out over trying to find the format it was wrapped in (CPIO, with GZip on top). Finally editing it brought horrific results. Think of 1.5 gig ramdisk files, scrambling a USB disk over a mistype, and summoning demons from the utter depths of heck. Anyway, I scrapped all of that and said 'The heck with it.' but with a more vulgar tone.

Here is what you do if you want a script to run inside of your USB disk zen image.

1. Edit the settings.txt file
2. Add a line between the script you wanna run and the line above it.
3. add this

[HTML]mkdir usb
mount /dev/sdb1 /usb
cp /usb/addfiles/bin/your-script-here.s /bin[/HTML]

4. Save it, back up it, mark it with a B, put it in the computer slot labeled USB.
5. Boot to it, and ta-da! Working script.

I still have to run tests on this, but I did boot, and it did image. So I'm confident this is the solution.
0 Likes
Highlighted
Knowledge Partner
Knowledge Partner

Re: Zen 11 USB Booting

J3bshjr;2162623 wrote:
Here is a bit of advice for all you aspriring sysadmion and anyone who finds this thread in the archive. NEVER TRY TO EDIT THE RAMDISK FILE. I pulled way to much of my hair out over trying to find the format it was wrapped in (CPIO, with GZip on top). Finally editing it brought horrific results. Think of 1.5 gig ramdisk files, scrambling a USB disk over a mistype, and summoning demons from the utter depths of heck. Anyway, I scrapped all of that and said 'The heck with it.' but with a more vulgar tone.

Here is what you do if you want a script to run inside of your USB disk zen image.

1. Edit the settings.txt file
2. Add a line between the script you wanna run and the line above it.
3. add this

[HTML]mkdir usb
mount /dev/sdb1 /usb
cp /usb/addfiles/bin/your-script-here.s /bin[/HTML]

4. Save it, back up it, mark it with a B, put it in the computer slot labeled USB.
5. Boot to it, and ta-da! Working script.

I still have to run tests on this, but I did boot, and it did image. So I'm confident this is the solution.


Thanks for posting back... Cool & great work! I would had you some hair glue, but ran out a couple of months ago.

I am curious how you came to this simple solution... Also not seeing how it fits in with the issue u had with unetbootin :)~

-Willem
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Zen 11 USB Booting

Well the reason I posted what happened after I got the USB stick to work, is because I want to display all the work I did. I'm trying to prevent that moment, where your looking up something you have an issue with, the person replies that they resolved it, but they never tell how.
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Zen 11 USB Booting

J3bshjr;2162623 wrote:
Here is a bit of advice for all you aspriring sysadmion and anyone who finds this thread in the archive. NEVER TRY TO EDIT THE RAMDISK FILE. I pulled way to much of my hair out over trying to find the format it was wrapped in (CPIO, with GZip on top). Finally editing it brought horrific results. Think of 1.5 gig ramdisk files, scrambling a USB disk over a mistype, and summoning demons from the utter depths of heck. Anyway, I scrapped all of that and said 'The heck with it.' but with a more vulgar tone.

Here is what you do if you want a script to run inside of your USB disk zen image.

1. Edit the settings.txt file
2. Add a line between the script you wanna run and the line above it.
3. add this

[HTML]mkdir usb
mount /dev/sdb1 /usb
cp /usb/addfiles/bin/your-script-here.s /bin[/HTML]

4. Save it, back up it, mark it with a B, put it in the computer slot labeled USB.
5. Boot to it, and ta-da! Working script.

I still have to run tests on this, but I did boot, and it did image. So I'm confident this is the solution.


I was wondering if you would happen to have a copy of the script that you use that scans the image repository?

I have long had a working ZCM11 USB boot disk that works flawlessly for imaging (I manually edited the ZCM11 files into the formatter that makes the ZfD7 USB disk). However, we do manual every time, so every time I boot to it, I have to do "img restorep <server> <image>"
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Zen 11 USB Booting

Here is the script we have on the USB device that calls to the server.

[HTML]#!/bin/bash

#This script is a first stage script for imaging

mkdir /mnt/scripts
mount -o nolock zcm.DOMAINHERE:/var/opt/novell/zenworks/content-repo/scripts /mnt/scripts

source /mnt/scripts/script.s[/HTML]


And here is the script on the server.


[HTML]#======== Start of Script ========
# Modified by : IMC 6/2010
# Version VX1


cd /bin
clear


echo "





This CD(Version: VX1.0) Is used for imaging.
NOTE: This imaging session works
on the new Zenworks server:
zcm.DOMAINHERE



"
echo " WARNING!!

This CD could remove ALL DATA from the drive
"

read -p " Continue Y/N -> " AGREE

if [ "$AGREE" != "Y" ] && [ "$AGREE" != "y" ] ; then
reboot -f
fi

clear

#ask for multicast or single imaging
echo "
Please select image session type

1 Single image FROM server
2 Multicast
3 Single image TO server
"

ROOTMENU=0
while true ; do
read -p "Enter your choice: " ROOTMENU

case $ROOTMENU in
"1")

clear
mkdir /mnt/images
mount -o nolock zcm.DOMAINHERE:/var/opt/novell/zenworks/content-repo/images /mnt/images
IFS=!
filelisting=(`find /mnt/images/*.zmg -printf %f!`)

for fl in ${filelisting
  • }; do
    echo "$fl"
    done

    imageFileSelection=0
    echo "

    "
    read -p "Type in the name of the file to image the machine with: " imageFileSelection

    echo "This process will download an image from the server to the PC."
    echo "THIS WILL ERASE THE HARD DRIVE OF THE COMPUTER!"
    read -p "Are you positive you want to do this? (y/n): " confirmImage
    while true ; do
    case $confirmImage in
    "y")
    #Set the command line to run from the proxy server
    img -restorep $imageFileSelection
    echo "








    "

    echo -n "Remove the imaging CD and hit enter to reboot -> "
    read WSNAME
    reboot -f
    break
    ;;
    "n")
    echo "k thnx bye"
    break
    ;;
    esac
    done

    clear

    break
    ;;
    #ROOTMENU Single Image case break


    #ROOTMENU Multicast case
    "2")
    read -p "Please enter the multicast session name: " sessionName
    echo "Joining session $sessionName..."
    img session $sessionName
    break
    ;;
    #ROOTMENU Multicast case break

    #ROOTMENU Single Image TO case
    "3")
    echo "This process will upload an image from the PC to the server."
    read -p "Are you positive you want to do this?" CONFIRMUPLOAD
    while true ; do
    case $CONFIRMUPLOAD in
    "y")
    read -p "Please enter a name for the image: " IMAGEFILE
    echo "Image file is $IMAGEFILE."
    img -makep $IMAGEFILE -comp=6
    break
    ;;
    "n")
    echo "k thnx bye"
    break
    ;;
    esac
    done

    break
    ;;

    #ROOTMENU Single Image TO case break

    *)
    echo "$ROOTMENU is not valid choice."
    break
    ;;
    esac
    done

    #======== End of Script =========
    [/HTML]


    The script refense a little script that clears the screen called 'Clear'. It isn't in cleartext so I can't post it, but all it does it clear the screen after each prompt.
  • 0 Likes
    Highlighted
    Absent Member.
    Absent Member.

    Re: Zen 11 USB Booting

    wow...thanks! I'm going to try this...

    Just to clarify, the server-side script goes in the following location: /var/opt/novell/zenworks/content-repo/scripts

    correct?
    0 Likes
    Highlighted
    Absent Member.
    Absent Member.

    Re: Zen 11 USB Booting

    Yes, that is where it should be.
    0 Likes
    The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.