Page 1 of 2

restart computer, boot from CD, make image

Posted: Mon Jul 08, 2013 10:45 am
by TDC999
Hello,

i'm trying to write a script that does the following:

restarts the computer, boots from IFW CD, makes image of Systempartition C.

How can i accomplish this in lets say Batch or powershell?
I know how to restart computer from shell, i could make an iso of the boot CD but what then?

Background is the PHYLock never really finishes getting a lock and besides that i want the images more "exact state like".

Greetings to this cool forum here!

Re: restart computer, boot from CD, make image

Posted: Mon Jul 08, 2013 6:10 pm
by TeraByte Support(PP)
What version of Windows are you using? You could create a TBWinPE/RE CD that auto-runs the IFW backup. Also, you could look into using the "bootfile" method (e.g. http://www.terabyteunlimited.com/howto/ ... otfile.htm). This can be done with IFL and IFD by following the tutorials. You should also be able to use IFW (in TBWinPE/RE) by creating the file from a TBWinPE/RE UFD. There's more information in the bootfile.txt help file included with TBOSDT.

Re: restart computer, boot from CD, make image

Posted: Tue Jul 09, 2013 11:39 am
by TDC999
I'm using win7 and maybe planning to use win8 some day.

[Quote]You could create a TBWinPE/RE CD that auto-runs the IFW backup[/Quote]
How would i do this?

[Quote]You should also be able to use IFW (in TBWinPE/RE) by creating the file from a TBWinPE/RE UFD. There's more information in the bootfile.txt help file included with TBOSDT.[/Quote]

Could you give me a short summary how to do this? I completet the tuts for DOS. But honestly i just did it without really understanding what i was doing. Also In the bootfile.txt i didn't find a section about WinPe

Also i saw that you can run IFW from Comandline. I wrote a little script in powershell restart Computer and then ran imagex.......... Would this be good to create an image? Or is this not a good idea since some windows files are beeing used then (commandline, IFW itself is running then i suppose)?

Greetings!

Re: restart computer, boot from CD, make image

Posted: Wed Jul 10, 2013 9:05 pm
by TeraByte Support(PP)
There are two ways to create a TBWinPE/RE build that auto-runs IFW. One way is to edit the "TBLauncher.ini" file and set the options:
Mode=IFW
IFWModeParameters=[IFW parameters here]

For example:
IFWModeParameters=/b /v /uy /d:w0 /f:"e:\backups\win7.tbi" /desc:"Windows 7 Drive" /rb:4

When booted, IFW will run the command and then reboot.

The other way is to use "startnet.cmd" instead. This is a standard CMD (batch) file. It's necessary to enable this in the TBWinPE/RE script first (set usestartnetcmd=1). Then you can edit the startnet.cmd file and add the IFW command at the end.

For example:
"x:\program files\terabyte unlimited\image for windows\v2\imagew" /b /v /uy /d:w0 /f:"e:\backups\win7.tbi" /desc:"Windows 7 Drive" /rb:4

---

Using bootfile with TBWinPE/RE is a little more complicated since you have to create the raw image file and tweak the build. The basic steps would be:

1. Adjust the TBWinPE/RE build to run "bootfile /restore" upon booting. These steps vary depending on the build method used. Would be in "winpeshl.ini" for a standard build or in "startnet.cmd" if using it instead. For ease, copying bootfile.exe (or bootfile64.exe for x64 builds) into the \Windows\System32 folder of the build is recommended. For example, if using the winpeshl.ini file, you would add the following line after [LaunchApps]:
%%SystemDrive%%\Windows\System32\bootfile64.exe, /restore

These steps can be accomplished by editing the script or by pausing the build and modifying the relevant files in the ISO folder.

IMPORTANT NOTE: If you do not configure the build to run "bootfile /restore" automatically on startup, you MUST run the command manually from the Command Prompt. Just go to the folder with the program and run the command. For example:
cd "\program files\terabyte unlimited\terabyte osd tool suite pro\win"
bootfile64 /restore

2. Create the TBWinPE/RE build normally using the options needed to have IFW run the desired procedure. Save the build to a UFD (smaller is better and make sure to select the "Partition - MBR FAT/FAT32 Partition" option).

3. Use TBOSDT to copy the UFD to a file. This creates the BIN file bootfile needs. For example, if the UFD was Disk 3 and you wanted to save it to the ufd256.bin file on drive E: you would run:
copy partition 3 0x1 e:\ufd256.bin /b

4. Make sure the BIN file is located on the booting drive. Then use bootfile to boot it. For example:
bootfile c:\bootfiles\ufd256.bin

Once you have done this once, it's not necessary to recreate the BIN file -- you can reuse it by copying the updated boot.wim file into it. For example, using TBOSDT:
open fs 0: c:\bootfiles\ufd256.bin
copy e:\tbwinre\iso\sources\boot.wim 0:\sources
exit

---

If PowerShell is just restarting Windows I wouldn't think it would be any different since Windows is still running.

Re: restart computer, boot from CD, make image

Posted: Thu Jul 11, 2013 4:43 pm
by TDC999
Thanks Paul for all this Info! Today i bought the bundle!

So i will test this out and come back to you.

Have a nice day!

Re: restart computer, boot from CD, make image

Posted: Thu Jul 11, 2013 5:05 pm
by TDC999
For the start i chose the way over the Autorun-CD. I took the path over the startnet.cmd.
The end of the startnet.cmd looks now like this:

:: Run TBLauncher
start tblauncher
"x:\Program Files (x86)\TeraByte Unlimited\Image for Windows\V2\imagew.exe" /b /d:w0@0x1 /f:"Z:\TestIFW\C_Full-$~YYYY$-$~MM$-$~DD$-$~HHMM$" /rb:8

But i do get the errormessage: path not found. when i boot from this cd.

is the X in the beginning of the path right? The Commandprompt tells me i'm at ..windows\system32

What is wrong?

And another thing: your wrote: "If PowerShell is just restarting Windows I wouldn't think it would be any different since Windows is still running."

If i use now The IFW CD does this mean in order to get a clean image the pc has to be really shut down, if i click on Restart in Win7 and have the CD in the drive it not the same then?

Re: restart computer, boot from CD, make image

Posted: Thu Jul 11, 2013 5:45 pm
by TeraByte Support(PP)
Most likely, Z: is not available. Keep in mind that the drive letters may not be the same as in Windows and that they are assigned starting with C:. In order for Z: to be automatically assigned you would have to have partitions to letter from C: to Z:. If Z: is the letter usually used in Windows you'll need to find out what its letter is in WinPE. You can use TBLauncher for this (press F4) or look in IFW. Then use that letter in the IFW parameters.

X: is the correct drive letter for the WinPE RAM drive.

Using IFW from WinPE is not the same as using it from a booted/running Windows. WinPE runs in RAM. The Windows on the main drive is not in use. There is not problem imaging from WinPE booted from a CD, UFD, bootfile, Recovery Environment, etc. -- WinPE is then running on the system, not the installed Windows. It's just the same as if you booted to IFL or IFD to create the backup -- the installed Windows isn't running.

Re: restart computer, boot from CD, make image

Posted: Thu Jul 11, 2013 6:11 pm
by TDC999
Hi Paul,

Ah the drive letter - i have actually seen this quite often. i'll test that with the drive letter. I gave the drive a name to prevent things like this in other circumstances a while ago. is it possible to change command that its looking for the name instead of Letter?

I know that when i use WinPE installed windows is dormant. What i meant is this: if windows is running And i put in the boot CD and THEN click in Windows on "Start new" (I have german version so forgive my bad translation) that's O.K. or? Or do i reallly have shut down pc and power of then power on and boot?

Re: restart computer, boot from CD, make image

Posted: Thu Jul 11, 2013 7:29 pm
by TeraByte Support(PP)
You can specify the Disk Signature of the drive instead of the letter. The signature won't change and will remain the same in Windows and WinPE. You can find out the correct value by highlighting the partition in IFW (when selecting for backup) and clicking the "Information" button. The "Device ID" is the signature. For example, your command parameters might be:
/b /d:#0xFD2C4742@0x1 /f:#0x22E5A9B7@0x1:"\TestIFW\C_Full-$~YYYY$-$~MM$-$~DD$-$~HHMM$" /rb:8

Rebooting to the CD from the Windows "Restart" option is perfectly fine. There is no need to shut down or power off first.

Re: restart computer, boot from CD, make image

Posted: Fri Jul 12, 2013 5:22 pm
by TDC999
Hi Paul,

i did as you said, the end of startnet now looks like:
"x:\Program Files (x86)\TeraByte Unlimited\Image for Windows\V2\imagew.exe" /b /d:w0@0x1 /f:#0xA1F950CD@0x1:"\TestIFW\C_Full-$~YYYY$-$~MM$-$~DD$-$~HHMM$" /rb:8

i get 2 errors: [ZoneTransfer] command not found and ZoneID=3 command not found

What i don't understand about your codeexample is:

1......./f:=xA1F9....:"\TestIFW.... I can see that there is the disksignature, but how does iFW know which Partition - since i have 2 Partition on Targetdrive...

2. what dows this part with "d:w0@0x1" mean this should be partition C on my drive

Greetings!