Disk Preparation
Overcoming Ghost
Automation Problems

Andy finds The Ghost in the Machine..
Disk PreparationNorton GhostThe Ghost in the Machine..?

I was building a PC for a client recently. I always create a dual partition configuration as a matter of course these days, with documents and emails stored on D: and the operating system and programs on the C: drive. This facilitates easy reimaging of the C: drive from an image stored on D: and the user's documents remain untouched.

In this particular case reimaging was going to take place rather regularly as the user wished to er, back up her CD collection. One of the problems with doing this on recent CDs is the controversial copy protection system will put files on your hard disk preventing subsequent copying. With so many different copy protection systems it's hard to keep track of where these files have been secretly stashed, so the easiest way to overcome this annoying problem is to reimage the drive.

Now to the average user all this is stratospherically complicated and fits into the 'too much knowledge' basket, so it's unreasonable to expect a normal user to be able to use an imaging application like Norton Ghost. Most are not even interested enough to learn, they just want to use their computer. Hence Norton Ghost's fine collection of automated switches, just right for putting into a batch file. See Automate Ghost with Switches.

So after setting up the machine and taking it to the client's place, we sat down and finished off the setup, installing the printer, internet connection, copying documents over from the old PC, updated antivirus signatures, etc. Once the Windows, applications and configuration were just right, I imaged the C: drive. From now on, reimaging would take the system back to this point. I made Ghost split the image into 700MB chunks (ghost.exe -split=700), so I could burn a backup copy to CD, just in case the D: drive took a walk.

Next came the configuration of a Win98SE boot disk, containing Norton Ghost 2003 and the CD-ROM drivers, for imaging from CDs. I configured autoexec.bat to run Ghost with the following switches..

ghost -clone,mode=pload,src=D:\Ghost\BurnXP01.GHO:1,dst=1:1 -sure -fx

Thus ghost is invoked in the clone mode of a partition load, the source image file being on the D: drive in a directory called Ghost, with a source partition number of 1 and a destination drive of drive 1 and a destination partition of 1, no operation confirmations and exit from the program at the end.

However on booting to the floppy, Ghost kept insisting it couldn't open the image file, chucking a 10014 error. Looking up this error code confirms that Ghost can't find the path or file name. The C: drive was XP2 NTFS and D: was FAT32, so no problems reading the second partition. Even so, Ghost 2003 has NTFS drivers (hence the larger size over previous versions) and is able to read NTFS partitions for creating and dumping images.

To cut a long story short, I fiddled and farted around for over an hour but nothing I could do would make Ghost see the image file. It could image from the CDs with a forced CD-ROM drive letter of R:, so I knew the image was fine. Of course it doesn't look great in front of a client when it looks like you don't know what you're doing. Fortunately I choose my clients carefully and they always have confidence in my abilities; well, that's what they tell me anyway..

It's at times like this that I quote my regular IT mantras, established through long experience..
"The job always takes (at least) twice as long as you expect.."
"Because, no matter how familiar you are with the task, there will always be something new to confound you."
"Always practise stuff at home first and not in front of the client (or students)."
"As a professional with a reputation to maintina, the buck stops with you ..", etc, etc.
Thinking back I must admit I couldn't remember the last time I'd run this particular action from a batch file, always using the Ghost console interface and doing it manually. Buggerit.

I left my client with the CD-ROM imaging option and dashed home to try and figure out what was wrong, away from any expectant and slightly glazed expressions.. A good scan of the internet showed nothing was admitted on the part of Symantec that I could find (surprise, surprise) and less expectedly, no solutions on the internet from helpful types. A few people had had similar problems, but no solutions were forthcoming. Buggerit some more.

I had been perusing a DOS manual over Christmas, as you do, and had been reminded of a lesser known command called subst.exe. This command can be used to create a drive letter which represents a directory path on the local disk. Thus:

subst  W:  C:\Windows

This will create a drive called W: which refers to the Windows directory. It's a bit like mapping a drive to a local folder instead of a network share. Maybe this could be the answer. There's obviously a bug in Ghost.exe preventing it from seeing an image on the same disk (but different partition) as the drive being imaged. Maybe I could fool it with subst.

A quick perusal of the internet located it in one of the Windows 98 .cab files and at 17KB, subst.exe just fitted onto the floppy. Autoexec.bat was modified thus:

subst  X:  D:\ghost
ghost -clone,mode=pload,src=X:\IMAGE.GHO:1,dst=1:1 -sure -fx
echo Please remove floppy disk and restart computer..

And it worked! So there you go. Another great moment in IT. I retired to bed to 1.00am on a bit of a high, knowing that the solution had been found. The only proviso here is that the partition containing the images must be FAT32, so that the boot disk can read it and subst the drive to the folder. But that's no sweat, just stick an extra partition on at the end. It doesn't even have to have a drive letter under XP, thus making it totally invisible to the OS but visible from a boot disk.

Incidentally, subst can be used in a similar way to image a whole hard disk, when there's no other drive to put the image onto. Simply run subst.exe first, mapped to a folder somewhere, and Ghost will image the disk to that drive. Weird eh!?
- A.

Put 11.01.2005 | | Refresh Page |