Sep 7, 2009

Create a arestore disk and partition





Introduction
When you buy a new computer you will usually get some sort of restore/ recovery disc. This is used to restore your operating system and software back to factory condition so your PC will run as it did when you bought it. This is usually done by saving an image of the partition where the OS & installed programs are located. The image is saved to a single file or split into a spanned set of files if it's total size exceeds FAT32's 4GB file size limitation. This guide will explain various ways to make a restore disc that you can customize and tweak to your needs. Since it uses Symantec Norton Ghost it can be used on just about any computer including those that are custom built or running Linux. The two main methods of doing this is by either storing the image on the hard disk or on a recordable disc. The advantage of storing the image to hard disk is faster speed and the flexibility of overwriting images. Very useful if you make frequent changes to your images. Ghost has the option of burning images directly to CD or DVD. The downside is that it requires the user to use the bootable floppy along with those discs. This tutorial will take it one step further and eliminate the need for a bootable floppy.


Required tools & setup
The screenshots from this tutorial are from a Windows XP machine. The software used is Nero 6 Ultra Edition. If you are using a different Windows operating system or burning program the instructions will differ slightly, but the process is still the same.

1) Windows Millennium startup diskette ( http://www.bootdisk.com ) or Ghost boot disk
2) CD or DVD burning program capable of making a bootable disc. ( http://www.nero.com, http://www.roxio.com )
3) CD or DVD burner
4) BIOS capable of booting up from a CD or DVD ( El Torito format specification. )

Creating Ghost image
This part assumes you know how to use the home or business versions of Symantec Norton Ghost. Create your partition image (partition to image). Choose the partition that the operating system & programs are installed on. Ghost does not use alphabetical DOS drive assignment. Instead it uses numeric assignment in the form of Number1:Number2. the first number is the drive. The second number is the partition within that drive. If you have no clue what this means just pay attention to the size and volume label of the partition you are selecting. Make note of what it says on the very last menu screen. What you need to know is the source & destination locations. It also says this at the very bottom of the screen. 1:2\ghost\winxp.gho usually means the image will be written to a file called winxp.gho inside a folder called ghost on drive D: So 1:1 would usually be drive C: the typical source partition where the OS & programs are install to. When restoring 1:1 will be our destination so it is reversed.






Preparing files

The Windows Millennium startup diskette is going to provide the files used to make our restore disc bootable. The configuration files of the boot data cannot be changed after the disc is burned. There may be a lot of trial and error so using a re-writable CD will save you from burning tons of coasters. There are hidden & system files we need to edit inside the startup disk. You need to change folder options to see them by enabling "show hidden files" and disabling "hide OS files".



View the contents of the Windows Millennium startup diskette. We need to change only two files: autoexec.bat and config.sys. Open autoexec.bat with notepad or WordPad. We are going to tell ghost.exe where the image is stored and where to restore it to. Note if ghost.exe is in some other folder than you must specify the directory before you issue this command. After the Millennium diskette boots the computer it will start executing what we really need it to do. These are the Ghost command line switches.

IF "%config%"=="NOCD" GOTO QUIT
IF "%config%"=="HELP" GOTO HELP
LH %ramd%:\MSCDEX.EXE /D:mscd001 /L:%CDROM%
ghost.exe -clone,mode=pload,src=1:2\ghost\winxp.gho:1,dst=1:1
::If MSCDEX doesn't find a drive...
IF ERRORLEVEL 1 SET CDPROB=1
::
GOTO QUIT

In this example
src=1:2\ghost\winxp.gho:1 is the location of the image file (source) with :1designating the partition number within the image. If your image contains multiple partitions you can restore a specific partition by specifying the partition number inside the image. The comma is a separator so ,dst=1:1 (destination) means we are restoring this image to partition one on physical hard disk one (this is usually drive C:). You cannot restore an image to the same partition it is saved to. If it's a spanned image all files have to be located in the same folder. This example is for an image saved to hard disk. Using a CD or DVD burner is still very similar. You would replace the source with something like src=CDR0001\ghost\winxp.gho:1 or whichever your burner is assigned as in Ghost.

Click here for [more Ghost command line switches]


http://service1.symantec.com/SUPPORT/ghost.nsf/docid/1998082413392025?
Open&src=sg&docid=1998082612540625&nsf=ghost.nsf&view=40c79ec65
039a2b588256a0d004ca98e&dtype=&prod=&ver=&osv=&osv_lvl=


Config.sys

Open config.sys and edit the following to the very top of the configuration. We are reducing the DOS menu to only one choice which will execute in one second:

Original:

[menu]
menuitem=HELP, Help
menuitem=CD, Start computer with CD-ROM support.
menuitem=NOCD, Start computer without CD-ROM support.
menuitem=QUICK, Minimal Boot
menudefault=HELP,30
menucolor=7,0


Revised:

[menu]
menuitem=CD, Restore Ghost Image.
menudefault=CD,1

menucolor=7,0

Optional: If you want to show people what a Sci-Fi geek you are open setramd.bat and edit the echo messages like this. This step is not necessary and will be displayed while the computer is being booted up:

@echo off
set RAMD=
set CDROM=

echo.
echo
Retinal Scan Sequencing.....
echo
Optical Neural Net Database .....Searching....Verified
echo
Access Granted
echo.

--------------------------------------------------


a:\findramd

if "%RAMD%"=="C" goto c_drive

goto success

:c_drive
echo
Initializing Partition Load Sequence.
echo
System Sequence Initialized. Executing Primary Command.
echo
Please wait.......
echo.
goto success


Another method which I haven't tried is using a Ghost boot floppy. This floppy can be made with Ghost within windows. This method would replace the Millennium disk entirely. It would also provide DOS mouse, USB2.0, firewire, and network support with Ghost. You will still have to append the command line switches to an autoexec.bat file otherwise the user will have to choose the target and source manually which makes doing all of this pointless.


Burning Boot Disc
Open Nero and create a Boot CD or Boot DVD compilation. Don't use the expert settings unless you have a reason to. If you are restoring the image from hard disk than a recordable CD is good enough. If you want to save the image to disc you can either span the it over multiple CD's or DVD's. If you are spanning images you must enable spanning option within ghost before creating the image. You cannot split them after the image is made. You can also choose to password protect your image. When this disc is being made it will read the Millennium diskette we just edited. Make sure you do not finalize this compilation. Don't add any extra files to it yet.


After it is burnt put the recordable disc back in the drive and create a CD-ROM ISO continue with multisession. There is only session you can continue from so choose it. It will complain about the CD not created using the multisession option, just ignore than and accept. Here is where the files will be added. You can add whatever other files you want, but leave room for the images unless it is on hard disk. For the other spanned images just burn them to separate CD's. Ghost will prompt you to insert the next volume when it's done reading each spanned image. They must be read in consecutive order.






When you burn the second part of the boot disc the required file you need to add to the compilation is ghost.exe. You need at least Ghost version 2003 if you are restoring an image with an operating system using an NTFS filing system.

Notes
You can use Ghost Explorer to add and replace files within a Ghost image if it is saved to hard disk. This saves you the hassle of creating new images if you need to make only minor changes. Gdisk can create hidden hard disk partitions. Useful if you want to save images to a hidden partition for user protection. Compaq/ HP sometimes put the images to a hidden partition because people can't screw with it unless they know the partition is there. But than again some people will still delete these partitions with a partitioning utility like FDISK not knowing what it is or what it holds. After you make a partition hidden with GDISK you can still save images to it with Ghost. GDISK is also partitioning utility like FDISK. It can also be used to perform secure disk wiping to US Department of Defense standards. This insures no data can be recovered from the hard disk.

Here's an example from my own machine. Note the H indicating a hidden partition. It is where the Ghost image is stored

C:\Program Files\Symantec\Norton Ghost 2003>gdisk32.exe /? GDISK32 Fixed Disk Partitioning Utility  GDISK32 [disk] [/STATUS] [/RAW|/LBA] [/SER] [/X] [/I] [/S] [/Y] [/R] GDISK32 disk /[-]ACT /P:partn-no [/X] [/I] [/S] [/Y] [/R] GDISK32 disk /[-]HIDE /P:partn-no [/X] [/I] [/S] [/Y] [/R] GDISK32 /BOOTINI {/ADD|/REMOVE|/DEFAULT} [/D:disk-no] [/P:partn-no]         [/DESC:desc] [/ENTRY:no] [/TIMEOUT:sec] [/INIFILE:filename]         [/BSECTFILE:filename] [/WINNT [/SYSFOLDER:folder]] [/R] GDISK32 [disk] /BATCH[:filename] [switch[switch...]] GDISK32 /? [/STATUS|/[-]ACT|/[-]HIDE|/BOOTINI|/BATCH]  Copyright (C) 1998-2002 Symantec Corp. All rights reserved. 2003.775.  C:\Program Files\Symantec\Norton Ghost 2003>gdisk32.exe 1 /status Disk  Partitions  Cylinders  Heads  Sectors  Mbytes  Model   1        4        14593     255      63  114473.5  WDC WD1200JB-00CRA1  Partition  Status   Type     Volume Label   Mbytes   System   Usage  C:  1        A    PRIMARY                 20481.3  NTFS/HPFS  18%      2             EXTENDED                93989.7             82%      3             LOGICAL                 81925.2  UNKNOWN    72%      4        H    LOGICAL                 12064.4  NTFS/HPFS  11%
Usage
Set your CD-rom as the first boot device in your motherboard's BIOS. Pressing F8 or DELETE keys at computer bootup will usually get you into the CMOS configuration setup utility.

BIOS SETUP UTILITY
------BOOT-------
1st Boot Device [ATAPI CD-ROM]
2nd Boot Device [Floppy]
3rd Boot Device [Hard Disk]
Other Boot Device [Enabled]


Put the restore disc in your CD-rom drive and restart the computer. It will boot up and at the very end Ghost will prompt a message asking "Proceed with Partition Clone YES/NO?". It typically takes five minutes to restore the operating system & software back depending on the total size of the image. If you make changes to the image on hard disk you can still use the same restore disc to initiate the process as long as the image location and destination are still the same.











No comments:

Post a Comment