By Rich Bryant
How to use a large external USB drive for ZENworks 7 Disconnected Imaging using EXT2 partitions
This is an expansion on the tip for disconnected imaging with a USB hard drive. I added in how to create an EXT2 partition on the USB drive so you can image to the USB drive, and not just from it. This tip can also be modified to create a hidden EXT2 partition on the local drive of the PC to store a local copy of an image if needed.
I have come up with steps to facilitate using a large external USB Hard drive for ZENworks 7 Disconnected Imaging. It utilizes the ZENworks CD software modified to run on USB storage devices and sets up a data volume formatted with EXT2 to allow imaging to and from the USB hard drive.
Requirements for the process:
Now, the fun stuff:
I can't guarantee this will work on every external USB hard drive, but should work on most. You may get the best results if you use a USB hard drive that doesn't require any drivers or software to access it.
WARNING: this process will wipe out any data you currently hold on your USB hard drive. You will be formatting drives which will erase all data on them, so if you don't want to lose it, back it up before proceeding or get another drive. Additionally, I take no responsibility if these directions are used on the wrong drive by mistake!
When imaging, if your USB hard drive is on anything other than sda1, you will need to modify the syslinux.cfg on your USB boot volume. Change the info in each section at install=hd:/dev/sda1 root=/dev/sda1 to reflect the location of your USB hard drive.
Also when you mount the EXT2 drive for imaging, you will need to modify the mount command at step 13 to reflect the device location. Quickest way to find out what device the USB is on is to boot with the CD to Manual, insert the USB storage device and at the bash# use the command IMG DUMP.
You can use this method as well to put on a EXT2 partition on the hard drive of the computer you are imaging, so you can store an image on the computer and access it for local imaging. If running Windows, the computer will never see the EXT2 partition. It will only be available when running the imaging process.
For this, we will set up a 50 MB FAT volume that will act as our boot volume, and a 20 GB EXT2 volume that will hold our images. I use FAT for the first volume so that we can use SYSLINUX to make the volume bootable to the ZENworks imaging environment. I use EXT2 for the DATA volume to support the large volume size as wall as imaging to the USB hard drive. After installing EXT2FSD, I can copy the images from the XP workstation to the USB hard drive, and the ZENworks imaging environment can read and write to EXT2 volumes so we can work with the images from there without being limited by size.
Here is the step by step:
- Plug in your external USB hard drive that you will use for the imaging process into a Windows XP computer that has the ZEN71USB tool loaded on it.
- Open up the Computer Management found in START/SETTINGS/CONTROL PANEL/ADMINISTRATIVE TOOLS, or Right click on My Computer and select MANAGE.
- Select the Disk Management under Computer Management (Local)/Storage
- Find the USB drive. Here it is listed as DISK 2.
(Click to enlarge)
- Right-click on the partition and select New Partition.
- Click Next at the wizard.
- Accept the default of Primary Partion, and click Next.
- Change the partition size to 50 MB.
- Assign a drive letter. For this example I will use U. Click Next.
- Format the partition as FAT, Default allocation unit size, and change the Volume Label to read ZENworks, click Next.
- Click Finish to create the volume.
- Leave the Computer Management console open for step 8.
- Sys the newly created drive with syslinux.
- Open a DOS Prompt
- Run the command to sys the drive U created in Step 5:
c:\ZEN71USB\UTILS\SYSLINUX.EXE ?f U:
NOTE: You may get an error when running the command. If so, click IGNORE and the command should complete successfully despite the error.
- Copy over the contents of the \ZEN71USB\DATA directory to the U: drive. Edit the Settings.txt as needed.
- Go back to the Computer Management Console and set the U: as Active
- Right click on the ZENworks U: partition and select Mark Partition as Active.
- Create the EXT2 data partition on your USB drive to hold your images.
- On a computer, attach and boot to the USB hard drive and select MANUAL.
- At the bash# run the command IMG DUMP and make note of the partitions. SDA1 may not be listed as it is the boot partition and may already be mounted. For this example the USB hard drive is at SDA and we will use the partition SDA2 at position 5 for our EXT2 partition.
- Exit out of the imaging screen.
- Create the 20 GB EXT2 partition from the bash#
# img pc5 ext2 20000
- Format the partition with EXT2
# mkfs ?t ext2 ?m 0 /dev/sda2
- The usb drive now has the EXT2 partition on it and you can image to and from it.
- Install EXT2FSD as per their instructions on your Windows PC to allow access to the EXT2 partition from a Windows PC. Make sure the EXT2FSD service is started.
- Attach the USB hard drive to the Windows PC and run EXT2MGR
- Right click on the EXT2 partition and select CHANGE Drive Letter and click ADD to assign a drive letter, I'll use T:
- You can now work with the images on the EXT2 partition from a Windows PC.
NOTE: if you were running Linux, you wouldn't have to go through this. Linux works with EXT2 volumes just fine with no additional software to install.
(Click to enlarge)
- Connect the USB drive to the machine that will be imaged and boot it.
NOTE: make sure that your computer supports booting to the USB device and is set to do so in the BIOS.
- At the boot menu, select MANUAL.
- At the BASH # type in:
mount /dev/sda2 ?t ext2 /mnt/harddisk
NOTE: the /dev/sda2 is your second EXT2 volume. If it's something other than sda2, you will need to change the command to reflect this.
IMPORTANT NOTE ABOUT IMAGING: Yes, this is important!
Because of the nature of the imaging process, if you use the command line incorrectly, the automatic process or through the GUI to do your imaging, it can wipe off the boot partition from the USB drive or other unmounted drives in this process. It will not touch the EXT2 volume because it is mounted at the time of imaging. If you image your computer and do not take the following steps, you will add more work for yourself. Worst case is you have to repeat steps 1-8 to get your boot partition back and or re-create any other partitions on other drives. Here are some tips that you can do to prevent this from happening:
- Write protect the USB hard drive when imaging from the USB hard drive. Un-protect the USB drive any time you want to make changes to the ZENworks partition or add/remove images from the EXT2 partition.
- If you can't write protect the drive because you will be imaging to the EXT2 partition, use the IMG command to select what partitions get wiped and imaged.
Ex: img rl /mnt/harddisk/myimage.zmg a1:p1
- If you need to be more thorough you can:
- Delete the first partition: Img pd1
- Create the first partition: Img pc1 NTFS
- Set the first partition active: Img pa1
- Put the image on the partition: Img rl /mnt/harddisk/myimage.zmg a1:p1
- To image your computer from the GUI, if your USB hard drive is write protected.
- Type in IMG at the bash# and hit enter.
- Select Imaging and Restore Image.
- Select local.
- Type in the path to your image. (ex: /mnt/harddisk/myimage.zmg)
NOTE: If you browse to the file, it may not be listed, so type in the path to the image.
- Begin imaging.
- Image to the USB hard disk
- Type in IMG at the bash# and hit enter.
- Select Imaging and Make Image
- Select local
- Type in the path to save your image. (ex: /mnt/harddisk/myimage.zmg)
You can also perform this at the command line:
Ex: img ml /mnt/harddisk/myimage.zmg x2
You can create a script to facilitate the mounting and automatically pushing out of the image (steps 13 & 14) if you so feel. You can put them in the /addfiles/bin folder and they're accessible to the imaging environment.
Disclaimer: As with everything else at Cool Solutions, this content is definitely not supported by Novell (so don't even think of calling Support if you try something and it blows up).
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, test, test before you do anything drastic with it.