Novell Home

Restoring an Image from Multiple CDs

Novell Cool Solutions: Tip
By Brent Schmidt

Digg This - Slashdot This

Posted: 27 Jul 2005
 

Restoring an image from multiple CDs was a need a customer placed on me. However, there is nothing built into ZENworks for Desktops image engine to ask for a second or third or 20th CD in an image set. The solutions I was finding were not very pleasing, so I had to come up with something new.

I found a pretty good script in TID 10080005 and used it to base the following script on. Not being very savvy with Linux proved to make this a bit difficult to write, but it works flawlessly for my customer. Using this script, they will be able to make any changes to their image, or even expand their image, without having to edit the script. They just burn CDs and go.

This script does not take image-safe data into account and the original script should be referenced if isd functions are needed.

Example

cdrom.s
hdparm -d1 -W1 /dev/hda
/bin/echo "\n\n\n\nCompany - Imaging Boot-CD"
while [ "$ValidOption" = "" ]
do
	/bin/echo "\n\nYou have the following options for imaging the server...\n"
	/bin/echo "n - New nstallation"
	/bin/echo "r - Replace the current installation"
	/bin/echo "c - Cancel and exit"
	read userChoice
	case $userChoice in
		n | N )
			img rl /mnt/cdrom/images/*.zmg
			umount /mnt/cdrom
			while [ "$ChangeMedia" = "" ]
			do
				/bin/echo "\n\nInsert next CD to continue or exit imaging\n"
				/bin/echo "c - continue"
				/bin/echo "d - done"
				read userChoice
				case $userChoice in
					c | C )
						cdrom.s
						img rl /mnt/cdrom/images/*.zmg
						umount /mnt/cdrom
						;;
					d | D )
						ChangeMedia=1
						;;
				esac
			done
			ValidOption=1
			;;
		r | R )
			img pd1
			img pc1 ntfs
			img rl /mnt/cdrom/images/*.zmg a1:p1
			umount /mnt/cdrom
			while [ "$ChangeMedia" = "" ]
			do
				/bin/echo "\n\nInsert next CD to continue or exit imaging\n"
				/bin/echo "c - continue"
				/bin/echo "d - done"
				read userChoice
				case $userChoice in
					c | C )
						cdrom.s
						img rl /mnt/cdrom/images/*.zmg
						umount /mnt/cdrom
						;;
					d | D )
						ChangeMedia=1
						;;
				esac
			done
			img pa1
			ValidOption=1
			;;
		c | C )
			/bin/echo "\nProcess cancelled\n\n"
			ValidOption=1
			;;
	esac
done
umount mnt/cdrom

If you have any questions you may contact Brent at provogeek@myrealbox.com


Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions. www.webwiseone.com

© 2014 Novell