Hard drive imaging technology has become a valuable tool to any organization, from data centers to the individual user. Novell ZENworks has provided an imaging solution since April of 2000. ZENworks Imaging helps you image and deploy Linux in a preboot execution environment (PXE—pronounced pixie) to efficiently migrate computers to Linux and deploy new Linux computers. ZENworks 7 Linux Management has made some significant enhancements to its imaging component. Let's jump right in and discover some of the features that will interest you.
Customize the PXE Menu
ZENworks 7 replaced previous PXE services with a slightly modified version of the open source PXELINUX technology. This provides more freedom to customize your PXE environment. Let's take a look at a few ways to customize your PXE menu; however, keep in mind that you can do much more than just the few examples I'll show you. To learn more about PXELINUX, visit syslinux.zytor.com/pxe.php.
Create a PXE Menu from a Floppy Image
One great thing about the PXE server is that you can now turn any floppy diskette into a menu item on your PXE server; no need to carry around those DOS and Windows boot floppies anymore. The example below shows how to take a Dell BIOS upgrade diskette and turn it into a menu item on your PXE server:
- Download the BIOS upgrade diskette from the computer manufacturer. (In this example, I use the A9 BIOS upgrade for my Dell OptiPlex GX240, which I downloaded from the Dell Web site.)
- Follow the instructions to create the floppy disk.
- Insert the floppy diskette into your Linux machine and execute the following command:
dd if=/dev/fd0 of=/home/DellA9BIOS.img
- Copy the DellA9BIOS.img file into your /srv/tftp folder on your ZENworks 7 Linux server.
- Create a file called DellA9BIOS.cfg in the /srv/tftp folder and put the following lines in it:
- Edit the /srv/tftp/pxemenu.txt file and change the following lines to match these values:
MenuOptionCount = 6
option5 = Dell BIOS upgrade
option6 = Exit
CFG5 = DellA9BIOS.cfg
CFG6 = 0
Hint5 = Dell GX240 A9 BIOS upgrade diskette
Hint6 = Boot to Local Hard Drive
- Reboot a computer on the same subnet as your server. Make sure you enable PXE booting in the BIOS of that machine. You also need to verify that the "Show Preboot menu if CTRL+ALT pressed" option is selected in the Preboot Menu Options section of the Preboot Services page on the Configurations tab. While the machine is booting, make sure you hold down the Ctrl+Alt keys to bring up the PXE menu.
- Select the new menu option you just created. (See Figure 1.)
You should now see the Dell BIOS upgrade utility Launch and Run. You can follow this same process with any bootable floppy diskette.
Installing Linux from a PXE Menu
Now let's look at another useful PXE menu item you can add that will let you perform a network Linux install without using any boot media such as a CD or floppy disk. In this example, let's set up a menu item to install SUSE Linux 9.3 Professional.
The two prerequisites you need before you begin are a SUSE Linux 9.3 Professional boot CD (to get the kernel files), and a YaST Network Installation server set up with SUSE Linux 9.3 Professional. For information on how to create the network install server, see the online documentation.
Follow these steps to create the new menu item:
- Create a new directory called /srv/tftp/suse93, and copy the files "initrd" and "linux" from a SUSE Linux 9.3 Professional boot CD into this directory.
- Create a file called /srv/tftp/suse93.cfg and put the following lines in it. Make sure you substitute your NFS server for the one I have in this example. (The "\" characters at the end of a line denote the append statement continuing on the next line).
ramdisk_size=65536 vga=791 netdevice=eth0\
- Edit the /srv/tftp/pxemenu.txt file and change the following lines to match these values (assuming that you still have option 5 as your Dell BIOS upgrade).
MenuOptionCount = 7
option6 = SUSE Linux 9.3 Professional
option7 = Exit
CFG6 = suse93.cfg
CFG7 = 0
Hint6 = Install SUSE Linux 9.3 Professional
Hint7 = Boot to Local Hard Drive
That's it. Now just reboot a PXE-enabled machine while holding down the Ctrl+Alt keys and select this menu option.
One great thing about the PXE Server is that you can turn any floppy diskette into a menu item on your PXE Server; no need to carry around those DOS and Windows boot floppies anymore.
The ZENworks PXE menu has a limitation of nine menu items. If you need more menu items, you can get around this limitation by having one of the menu items point to a PXELINUX configuration file that, in turn, contains an unlimited number of options you can choose. For more information, see Undocumented Imaging Features in this article.
AutoYaST and Kickstart are tools used to automate the install of SUSE Linux and Red Hat Linux respectively using a response file. The response file contains the answers to all the questions that the installation asks during the install. Scripted OS installations are nothing new for system administrators; however, performing the install solely from a PXE environment may be new to some. Now let's see how to perform an AutoYaST installation from the Imaging PXE menu without using any boot media.
One prerequisite that you need to have in place for all this to work is a YaST Network Installation server. Setting this up is out of the scope of this article. If you need more information on this, see the online documentation.
- To create an AutoYaST control file (response file), run YaST and select Misc | Autoinstallation. Then customize the answers to the different components of the install. After configuring each section, save the configuration file as autoyast.xml to the folder /srv/tftp/autoyast on your server. (See Figure 2.)
- For the workstation computer to be able to boot up and start the AutoYaST install, you need to provide it with the kernal and ramdrive files from an actual SUSE Linux boot CD. Copy these two files from a SUSE Linux CD into the /srv/tftp/autoyast folder on your server. Your /srv/tftp/autoyast folder should now contain the files autoyast.xml, initrd, linux.
- Log in to the Control Center and create the AutoYaST bundle by clicking on the Bundles tab and selecting Bundle... from the New drop-down menu. Select Preboot Bundle, and click Next. Select the AutoYaST bundle type from the list and click Next. Proceed through the bundle creation wizard using the options as shown below. (See Figure 3.)
- Assign this bundle to the computer by going to the Bundles tab in the Control Center. Check the AutoYaST bundle you created in step three and choose Assign Bundle... from the Action drop-down menu. If you don't have the computer registered to your Control Center, you must install the ZENworks agent.
- The proxyDHCP server is not running by default. This service must be running for PXE to work. Run the following command on your server to start the service:
- Make sure that PXE booting is enabled in the workstation's BIOS settings, and reboot it. You should see the computer PXE boot and then the AutoYaST installation take place.
Autoyast is a very useful way of quickly provisioning new computers.
This is a very useful way of provisioning new computers quickly. You might want to create a collection of configuration files for each type of hardware you have in your organization. Then create a bundle for each configuration file you have.
Getting Kickstart to work is very similar to AutoYaST. One significant difference is that with Kickstart, you have to place the response file in a location accessible by either NFS or HTTP. We simplified this process with AutoYaST by simply putting the configuration file in the same location as the kernel files. AutoYaST then uses TFTP to get the response file. AutoYaST also supports FTP, HTTP and NFS.
If you want to use AutoYaST to install Open Enterprise Server, visit the following Novell Cool Solutions article online.
ZENworks control center is a new management console written from scratch specifically for ZENworks.
ZENworks Control Center
Here we don't cover any advanced tips or tricks, but this section couldn't be left out because the ZENworks Control Center is a brand new management console written from the ground up specif-ically for ZENworks. The browser-based Control Center replaces ConsoleOne, which was used in previous versions of ZENworks.
Most of the Imaging components in the Control Center are on the Bundles tab. To perform any Imaging operations on registered computers, create a bundle and assign it to the computer. (See Figure 4.)
To perform imaging operations on nonregistered computers (machines that do not have the agent installed), still create the bundle, but instead of assigning it to the computer, use it in a Preboot Work Assignment rule that is located in the Preboot Work Assignment snapshot of the Configurations | Preboot Services page. (See Figure 5.)
After you create and assign the bundle to the computer, you need to Apply that bundle, which makes it active so it will execute upon the next reboot. In summary, here are the three steps necessary to deploy a preboot bundle:
- Create the bundle
- Assign the bundle to the computer, group or folder
- Apply the preboot bundle
Intel Active Management Technology
The new Intel Active Management Technology (AMT) is worth making a special mention. AMT provides a set of useful features such as remote management of platforms regardless of the poweron/ off state or OS state. ZENworks Imaging takes advantage of this by storing its identity or Image Safe Data (ISD) in AMT nonvolatile memory. ISD is a collection of information about each computer that makes up its identity. It contains information such as computer name, IP address, networking information and its unique ID that ZENworks Control Center uses to keep track of the computer.
Intel Active Management Technology provides a set of useful features such as remote management of platforms, regardless of the power on/off state or OS state.
Suppose your computer's hard disk crashes. With the ISD stored in AMT memory on the motherboard, you can replace the hard disk and the computer's identity or ISD will remain so that after you rebuild the computer, it will boot back up with the same name, IP address and even the unique ID so the ZENworks Control Center won't lose track of it.
You can perform this simple test to verify that a computer has AMT and it is correctly provisioned: From another machine, point your browser to the AMT machine using port 16992 (i.e., http://10.0.0.1:16992). If you don't get prompted for a user name and password, then either that machine does not support AMT or it is not correctly provisioned. The neat thing about this quick test is that the machine doesn't need to be turned on.
If you don't have ZENworks Linux Management 7 imaging services available in your environment, you can use the imaging CD to do most imaging operations.
If your machine has not been provisioned, you can either use the Novell Provisioning Utility or any other third-party AMT provisioning tool. (See Figure 6.)
During the provisioning process, you will create one or more Enterprise names that are used to identify the computers in your network. The imaging service keeps track of these Enterprise names in the ZENworks Control Center on the Configurations | Preboot Services page. (See Figure 7.)
Intel recommends you use a single enterprise name for all the computers in a certain geographic area. For every unique enterprise name, you need to have an entry in the ZENworks Control Center on the Configurations page. When the imaging service attempts to authenticate to a machine, it will sequentially try each enterprise name in the list until it finds a match.
That's all there is to it. From now on, all your Intel AMT computers should never lose their identities (ISD).
Keep in mind that Intel AMT technology is new. At the time of this writing, few outlets were available to purchase AMT hardware. But in the future, AMT-supported hardware might become quite common.
For more information about Intel AMT technology, refer to the documentation that came with your computer. You can also visit the Intel Web site for more information on Intel AMT technology.
If you find yourself in an environment where you don't have the ZENworks Linux Management 7 Imaging services available, you can use the imaging CD to do most imaging operations. You can create the imaging CD by burning the bootcd.iso image located in /opt/novell/zenworks/zdm/imaging/winutils/ to a CD. Using this CD to boot the computer, you can mount a SAMBA or NFS location to save and restore your images and do just about any imaging operations you want at this point.
Now let's see how to take and restore images using just the CD and a SAMBA or NFS network share that we will automount using a script. You must already have your SAMBA or NFS location previously configured.
You can create this CD from any Linux machine, but these steps assume you are doing it on your server where ZENworks is installed. Type the following commands and then take the final steps to create the CD.
- cd /opt/novell/zenworks/zdm/imaging/winutils/
- mkdir iso
- mount -o loop bootcd.iso iso
- cp -r iso/ newiso/
- cp /srv/tftp/boot/settings.txt ./newiso
- Modify the settings.txt file to have the following entries:
- Create the file newiso/addfiles/take.sh to contain the following script. Make sure you substitute your user name, password and server IP address on the mount command. For example (The "\" characters at the end of a line denote the mount statement continuing on the next line):
/bin/mount -t smbfs -o username=root,password=novell //10.0.0.5/root /mnt/harddisk zisview -s | grep export > script.s
if [ "$ZISD_NETBIOS_NAME" = "" ];
img ml /mnt/harddisk/default.zmg
else img ml /mnt/harddisk/$ZISD_NETBIOS_NAME
- Create your new .iso image with the following command:
mkisofs -o new_bootcd.iso -b\ boot/loader/isolinux.bin -c boot.cat -no-emul-\ boot -boot-load-size 4
-boot-info-table -J -r\ ./newiso/
- Now burn the bootcd.iso file to a CD.
Any machine that boots up using this CD will automatically take an image of the hard disk and store it on the SAMBA/NFS share point. If the machine has Image Safe Data, then the image file will be named the same as the machine's host name. Otherwise, it will be called default.zmg and must be renamed before the CD is used again so the image you just created will not be overwritten. To create a CD that will restore the image you just made, follow the same steps as before except use the following script. Make sure you clearly label this CD.
Imaging operations are performed by booting into a small customized Linux distro via PXE, CDROM or ZENworks Partition.
Note: Be careful with this CD. It could potentially reimage any hard drive you boot with it. (The "\" characters at the end of a line denote the mount statement continuing on the next line).
/bin/mount -t smbfs -o username=root,password=novell //10.0.0.5/root /mnt/harddisk zisview -s | grep export > script.s
if [ "$ZISD_NETBIOS_NAME" = "" ];
echo "No Image Safe Data found"
img rl /mnt/harddisk/$ZISD_NETBIOS_NAME
If you want to use NFS rather than SAMBA in the above scripts, use one of the following ways. NFS uses the portmap service, which is not running by default, so you can either start portmap in the script or you can add the "-o nolock" switch to the mount command. For example:
/bin/mount -o nolock 10.0.0.5:/images /mnt/harddisk
If you have an image that you restore often, you can burn the image file onto the ZENworks imaging CD or DVD. This will allow you to restore that image straight from the CD or DVD without having a network connection.
Customizing the Imaging Distro
To perform imaging operations, the machine must boot into its own customized Linux OS distribution. Three ways to do this are PXE, ZEN Partition and CDROM. Once the machine has booted with the imaging OS, then the imaging operations can take place. You might find a time when you will want to modify the distro to load extra kernel modules or drivers for specific hardware. Or maybe you just want to include some files in the distro so they are available to you. Here are two ways you can customize the imaging distro.
Adding files to the distro "root" file
If you spend any time at the bash prompt of the ZENworks Linux Management 7 Imaging distro, you'll quickly find out that the vi editor is not there. Because of the size of vi, an alternate editor named "joe" was chosen. If you can't live without vi, then you'll be interested in the following steps that outline how to put vi into the Imaging distro.
On your server in the /srv/tftp/boot folder, there is a file called root, which is a Linux RAM Drive file that contains supporting executables and files necessary for the OS. It is downloaded to the machine and is used to boot with at PXE time. Enter the same commands I did in the following shell session to include vi into the distro:
/# cd /srv/tftp/boot/
/srv/tftp/boot# cp root root.backup
/srv/tftp/boot# mv root root.gz
/srv/tftp/boot# gzip -d root.gz
/srv/tftp/boot# mkdir temp
/srv/tftp/boot# mount -o loop root temp/
/srv/tftp/boot# cd temp/
/srv/tftp/boot/temp# cp /usr/bin/vi bin/
/srv/tftp/boot/temp# cd ..
/srv/tftp/boot# umount temp/
/srv/tftp/boot# gzip root
/srv/tftp/boot# mv root.gz root
Now boot up a machine that is PXE enabled. Hold down Ctrl+Alt while booting to display the PXE Menu. Select the second menu option, which is Start ZENworks Imaging Maintenance. You can now test your newly updated imaging distro by typing vi settings.txt when the bash prompt comes up.
Using the same steps as above, you can modify the RAM drive to add other files and programs that you might find useful. Be aware that this root file is treated like a partition and there is a limited amount of usable space. After you mount the RAM drive file, you can execute df -h to see how much space you have left. When I performed these steps I had less than 8MB of disk space free.
You can customize the imaging distro by using the SUSE driver update mechanism.
If you find yourself editing the root file often, you might want to just skip the last two commands that gzip the file. They are not necessary, but it will increase the download time of the root file significantly if you don't gzip it.
SUSE Linux Driver Updates
Another way to customize the imaging distro is to utilize the driver update mechanism that is built into SUSE Linux. This method is a little less intrusive than the first. You don't have to modify the original kernel files; you simply create an additional file that gets incorporated into the OS during boot time. Three types of driver update operations exist: First, install kernel modules or hardware drivers. Second, install files and execute a script. Third, simply place files into the OS. I'll show you how to do the second method. I'll take the program tree, which is not currently available in the imaging distro, and install it at boot time.
The Driver Update mechanism looks for a file called driverupdate located in the /srv/tftp/boot directory on your server. If the file is present, the OS will download that file during boot up and incorporate it into the OS dynamically each time the machine boots. This driverupdate file is a file system file that can be of any file system type, such as EXT3 or REISER. For simplicity, I like to use the CRAMFS file system. This file contains a directory structure that mimics the directory structure in the OS after a machine has booted with the ZENworks distro. To help you get started, download the driverupdate.tgz file from the Novell Connection Web site. This file contains the directory structure you will need to perform the following steps.
Follow these steps to put the tree program into the driverup date file.
- Download the driverupdate.tgz, and untar it:
wget http://www.novell.com/connectionmagazine/2005/11/download/driverupdate.tgz tar -xzvf driverupdate.tgz
- Copy the tree program into the bin folder of the directory structure:
cp /usr/bin/tree dirstruct/linux/suse/i386-\ 9.2/inst-sys/bin/
- Create the CRAMFS file with the following command:
mkfs.cramfs dirstruct/ driverupdate
- Copy the file to the /srv/tftp/boot folder. cp driverupdate /srv/tftp/boot
- Add the following lines to the end of the /srv/tftp/boot/settings. txt file. This causes the adddir.s script to run, which creates soft links to all the new files being copied down. nchor:
# SUSE driver update
for i in /update/[0?9]*/install/adddir.s ; do [ -x "$i" ] && "$i"
- Reboot a PXE-enabled machine and you should see the text ZENworks 7 Patch 1 at the bash prompt after the OS has booted up. Now you can execute the tree program.
Image-safe data is a collection of information about the computer that makes up its identity.
Notice all the files you put into the driverupdate file are actually located under the /update directory in the OS after booting up. Then the adddir.s script creates soft links under the root file system that point to the corresponding file under the /update directory structure. You can verify this by running the following commands:
/# which tree
/# ll /bin/tree
lrwxrwxrwx 1 root root 29 Aug 31 21:45
/bin/tree -> /update/000/inst-sys/bin/tree
If you want to include a new hardware driver or kernel module in the imagnig OS, this is a simple process. Just copy the .ko file into the ./dirstruct/linux/suse/i386-9.2/modules/ directory. That is all you have to do. The OS will automatically load any .ko files that are in this folder.
A more permanent way of including a new kernel module into the distro is to open up the initrd file and place the .ko file in the /lib/modules/2.6.5-override-default/initrd directory.
We've covered a few things to save time and make your job easier, while having a little fun at the same time. Imaging technology has become an indispensable tool. With the new imaging enhancements, ZENworks 7 Linux Management simplifies management and accelerates technology transformation by freeing IT staff from timeconsuming and repetitive maintenance tasks. The future of imaging technology will be exciting. Don't forget to visit theWeb site to view the flash animations and download the supporting files for this article.