Ghost Solution Suite

 View Only
Expand all | Collapse all

Ghosting locally via USB drive

  • 1.  Ghosting locally via USB drive

    Posted Apr 27, 2009 03:22 PM
    I want to use my 8GB usb drive to ghost locally. It looks like the Ghost Boot Wizard forces you to setup an IP or use DHCP. I went ahead and did all that and I am able to ghost locally but the boot to WinPE takes longer as I assume it is trying to acquire an IP address and all that. I want to boot into WinPE, launch Ghost and point it to my image file and thats it. In other words, remove the network aspects of the Ghost Boot Wizard.

    I also bundle a batch file I created that runs DeployAnywhere after I ghost to re-target the machine. Process cuts ghost time in half and it would be perfect if I can skip the nework part of the boot process. Let me know your thoughts and suggestions. Thanks


  • 2.  RE: Ghosting locally via USB drive

    Posted Apr 27, 2009 03:43 PM
    The long boot time of WinPE does not have anything to do with acquiring an ip address. The PreOS you are loading is pretty large, in fact it is a striped down version of Vista, so the load time on it will be considerably longer than DOS.


  • 3.  RE: Ghosting locally via USB drive

    Posted Apr 27, 2009 03:54 PM
    It usually stalls a bit when you see the command window up and while waiting for it to open the Ghost program. I just wanted to see if there was a way to fine tune it or speed it up. No biggie.


  • 4.  RE: Ghosting locally via USB drive

    Posted Apr 27, 2009 04:00 PM

    What PE does once it boots is in the unattend.xml file.  It runs a script called start.bat.  Change the xml file to what you want it to do or replace start.bat with what you want it to do.



  • 5.  RE: Ghosting locally via USB drive

    Posted Apr 27, 2009 06:11 PM
    If you didn't mind what does your batch file look like?  Is it fully automated with regards to the cloneing and then run DA in an automated manner?   I know that this could be done but I have only taken it as far as fully automating the ghost restore using the -clone command I wasn't sure how to call for the DA once ghost exited.

    I am sure this wouldn't be to hard to do I am just not searching correctly. 

    Thanks for your help.


  • 6.  RE: Ghosting locally via USB drive

    Posted Apr 27, 2009 08:18 PM
    Sorry, but my modifications to WinPE had to do with some additional commands I wanted it to perform before it connected the console on the network.  I don't actually have one like you want.  Sorry.


  • 7.  RE: Ghosting locally via USB drive

    Posted Apr 28, 2009 04:14 AM
    Hi Spuds,

    One option is editing the start.bat but if you are not familiar with the structure, it could be difficult. If you edit the files in the default location, it would be used for all the WinPE related operations and probably that's not what you would want.

    When you create the boot media from GBW, last screen (review screen) allows you to edit the startup commands and that only affects the current operation. For example, if you want to run a clone and then DA,

    remove the last line 'start Ghost32.exe', add a line to map a network drive if you are using a mapped network share. You can do this using the command,

                    net use z: \\server\share /user:server/username password

    This password is NOT encrypted so any one can see it. Depending on the security level you want, you can omit the password then it will prompt for it.

    Then add the command for Ghost clone, something like,

                   Ghost32 -clone,mode=restore,src=z:\images\myimage,dst=1 -batch -fx

    This is going to  restore the image to disk one without asking any questions. Having this kind of a media is not very safe, since it will re-image the machine without asking any question. You can remove the -batch command, so that it will allow you to select all the parameters using Ghost GUI. -fx switch ask Ghost to return to command prompt after the operation is completed rather than reboot the machine or waiting in Ghost screen.

    Then add the DA command. For DA to run, you have to provide it access to the driver database so that it can go through and find out correct drivers. In Ghost Console, driver database is  "\documents and settings\all users\application data\symantec\ghost\templates\Common\WinDrivers" folder. You can either share and map a drive or copy it to the server you use. For example, if you copy to the server you used for the image for the share named share,(since you already map a drive letter Z to it), you should be access it as "Z:\WinDrivers" from the client. DA command line is relatively easy so add the line,

                     ghdplyaw32.exe /target=1.1:\Windows /DDB=Z:\Windrivers  (assuming your Windows directory of the newly cloned image is \Windows folder in first partition)

    So, adding these lines satisfy the very basic requirement. Remember, this is just an exmple, but you need to add many other things to make sure it is easy and safe enough for others to use. One thing I'm worried about these automated boot media is if some one boot a machine with it by mistake, it is going to re-image it destroying all the data. Please be careful about that. You can add enough warning etc. in the batch file to make sure  someone is not going to go through it by mistake.

    Have a look at the chapter 27 of the reference guide, which gives more details about DA. 

    Hope this helps.

    Krish







                




  • 8.  RE: Ghosting locally via USB drive

    Posted Apr 28, 2009 09:00 AM
    If you are referring to my batch file, it basically just runs the re-target command and points the ddb to the drivers folder. Its better than typing it out after the ghost completes. So I basically run Ghost, clone it then exit Ghost and manually run that batch to re-target. Over the network, the ghost was taking 12-20min... doing everything from the USB, now the ghost clone process takes 5min.

    Only issue is WinPE takes longer than usual to load up...I have to walk away and come back. I'd say it takes a good 6-7 min for the ghost program to show up. It boots up, I see the winPE background and the command prompt window running "startnet.cmd" and it sits there doing its thing for over 5min. I removed the DNS client entries from the xml and start.bat but nothing. That takes longer than the actual clone process.


  • 9.  RE: Ghosting locally via USB drive

    Posted Apr 29, 2009 12:29 AM
    Idiaz I was doing DA like you,  but Krish thank you for takeing the time to explain how to add the next line to the start.bat.   I was sure it was easy but it had escaped me. 

    I will certainly get all of my environmentals resolved and then put this together.   Would it be to much to ask if there is the ability to in the same start.bat to then run ghost walker 32?

    Thank you again for this info Krish this will save a lot of time. 

    Idiaz  thank you for sharing this thread I didn't intend to hijack it with this quesiton.   It sounds like with Krish's suggestion we can fully automate this so that we can walk away and come back and it will be compleatly done so it won't matter (at least to me) that it takes the 5 + minutes to boot up.

    Cheers.


  • 10.  RE: Ghosting locally via USB drive

    Posted Apr 29, 2009 04:43 AM
    Hi Spuds,

    Adding Ghost walker is not a problem at all. All the Ghost tools are copied to the x:\ghost folder in boot media, so they are readyly available. You can add the command line

        Ghwalk32.exe -batch -sure

    after the GHost32 command line so that it will change the SID too. There are some additional commands you can give with Ghost walker (for example if you have multiple windows installations you can pass the partition from command line).  You can add any of those switches, have a look at chapter 22.

    One issue in these kind of simple scripts is there is no error checking. Even if any of these commands fail, it will just continue and the end results may not be the expected result. But you can add simple checks such as ERRORLEVEL check and look for  presence of error files. If you use Console, it will do all of those things for you :-)

    In the mean time Jackson was trying to develop a script to help running these tools , I will check with him to see if he can give some mroe tips.

    idiaz, taking 5-6 minutes for bootup is  certainly too long. I think you said most of the time it stays at the console window. One thing you can try is removing the line,

        Ghost32.exe /setosdrives .......

    This tries to check the drive letters assigned in Windows and use the same for WinPE, so that if your second partition is drive D: in Windows, it will be drive D: in WinPE too.  In case if your OS drive is corrupted or something, this might take longer to time out. But having it is really useful since you will have the same drive letters assigned.

    Other possibility for longer boot time is device driver issues. Do you see this in every machine or in some of the machines? What kind of machines are they?

    Krish 

     


  • 11.  RE: Ghosting locally via USB drive

    Posted Apr 29, 2009 03:22 PM
    I was actually going to ask about the drive letters. The boot drive is always X but my USB key seems to differ depending on the computer which makes sense as some have DVD drive, additional usb slots, etc. BUT since I have the images and the WINDRIVERS on that usb drive, if I have the batch set to "/ddb=d:\windrivers " it may not work on some machines since the D drive isnt the usb key. Get me?

    Right now I am testing on DELL Optiplex 760s.


  • 12.  RE: Ghosting locally via USB drive

    Posted Apr 29, 2009 04:28 PM

    Thanks Krish, we use the console also but the local option is often fater based on network geography. :)   Good folow up question Idiaz,  you got to it before I did.  :) 

    Cheers.



  • 13.  RE: Ghosting locally via USB drive

    Posted Apr 29, 2009 04:29 PM

    Krish... I edited the start.bat with the clone switches and the da command after and works great! No user interaction needed. It still takes a bit to boot up so I will try to remove the "setosdrives" line and see if that does anything. I will also test it on another machine. If nothing works, as stated above, it doesnt matter b/c i can just boot from usb and walk away. =)

    Thanks everyone for being so helpful.



  • 14.  RE: Ghosting locally via USB drive

    Posted Apr 29, 2009 11:41 PM
    ldiaz117,

    If you want to detect what drive yoru USB key is you can try a loop that goes through c-z and does an 

    DRIVE =c
    :keeplooking
    if exist %DRIVE%:\somefilethatisonusb.txt goto FOUND
    incriment variable DRIVE here, I don't have an example right now*
    goto keeplooking
    :found


    USB drive is set now in the variable DRIVE

    There is a for loop in DOS but I don't have an example at this moment, been a long time since DOS :D

    Just google loops in DOS and I am sure you will find it.


  • 15.  RE: Ghosting locally via USB drive

    Posted Apr 30, 2009 03:08 AM
    Hi,

    setlocaldrives command tries to map the same drive letters in WinPE but it may not succeed all the time. For example, USB drive could have being connected after booting to WInPE or there was no OS in the system. I think Davd's suggestion to look for a file in the system is a good idea. Since you use WinPE,  I think you can do it with the command,

    for %%f in (C D E F G H I J K) do if exist %%f:\Windrivers set DRIVE=%%f:

    This will check all the specified drive letters (you can go upto Z if you want :-) and set the drive letter to the one that has a WinDrivers folder in the root. Note the double % signs - if you type this command in CMD you need only one of them, but inside a batch file you need two. You can check for any file in any folder.

    If you want to find out if there is a drive letter, you can use the command 'if DEFINED DRIVE' to find out if DRIVE is being defined or not.

    Krish