Running TBWinRE/TBWinPE on UEFI without a Boot Disk

Discussion in 'backup, imaging & disk mgmt' started by Mr.X, Feb 15, 2016.

  1. Mr.X

    Mr.X Registered Member

    Joined:
    Aug 10, 2013
    Posts:
    4,796
    Location:
    .
    The TBWinRE partition is hidden. After I follow your steps above, I hide the partition. I don-t want anyone messing around there.

    Btw wouldn't be easier to use \Device\HarddiskVolume6 ? Where number 6 is the hidden partition, I don't want to use letter cause some machines have one optical drive or two and they already have assigned E: letter. Just saying.
     
  2. MudCrab

    MudCrab Imaging Specialist

    Joined:
    Nov 3, 2006
    Posts:
    6,483
    Location:
    California
    You can use that -- just need to know which it is and update accordingly.
     
  3. Mr.X

    Mr.X Registered Member

    Joined:
    Aug 10, 2013
    Posts:
    4,796
    Location:
    .
    Yes it's always going to be the same 6th volume on a GPT disk.

    So I think this is the only line I need to edit right?
    Code:
    :: vars
    set DrvLetter=\Device\HarddiskVolume6
     
  4. MudCrab

    MudCrab Imaging Specialist

    Joined:
    Nov 3, 2006
    Posts:
    6,483
    Location:
    California
    Yes, I think that's it.
     
  5. Mr.X

    Mr.X Registered Member

    Joined:
    Aug 10, 2013
    Posts:
    4,796
    Location:
    .
    On IFL (at least) there's a Process Priority setting which normally runs at Normal. Does it really has a positive impact on performance (speed) when set to "High"? If so what is the cmd line parameter to include? Couldn't find it on IFL manual PDF.
     
  6. TheRollbackFrog

    TheRollbackFrog Imaging Specialist

    Joined:
    Mar 1, 2011
    Posts:
    4,945
    Location:
    The Pond - USA
    Unless you're running a serious active multi-task environment along with IFL, you'll see no difference whatsoever.
     
  7. Mr.X

    Mr.X Registered Member

    Joined:
    Aug 10, 2013
    Posts:
    4,796
    Location:
    .
    OK, thanks.
     
  8. Mr.X

    Mr.X Registered Member

    Joined:
    Aug 10, 2013
    Posts:
    4,796
    Location:
    .
    So do you think this is the best way to do it? If so how to?
     
  9. MudCrab

    MudCrab Imaging Specialist

    Joined:
    Nov 3, 2006
    Posts:
    6,483
    Location:
    California
    I'll try to get something posted tomorrow.
     
  10. Mr.X

    Mr.X Registered Member

    Joined:
    Aug 10, 2013
    Posts:
    4,796
    Location:
    .
    There's no rush or anything MudCrab. I just asked in case you already have a solution already finished. However take your time. Thanks again for your attention.
     
  11. MudCrab

    MudCrab Imaging Specialist

    Joined:
    Nov 3, 2006
    Posts:
    6,483
    Location:
    California
    Here's the process to use the RunScript to allow different operations to be run depending on a "flag" file.
    1. Your existing configuration can be used -- no need to redo it or recreate the BCD entries, etc.
    2. Run TBWinPE Builder.
    3. Click Settings. Click the Scripts tab.
    4. Check the Include RunScript.cmd option and click the Edit link for it.
    5. This will prompt you to create it (if not created already). Once open, paste the following into Notepad (replace existing text). For the backup and restore commands I used what you had posted previously. If different just edit as necessary.
      Code:
      @echo off
      setlocal enableextensions enabledelayedexpansion
      cls
      
      :: Search for TBWinRE_Auto_* file and run command
      
      set IFWPath=X:\Program Files\Terabyte Unlimited\Image for Windows\V2\imagew.exe
      
      for %%A in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do (
       if exist %%A:\TBWinRE_Auto_Backup (del %%A:\TBWinRE_Auto_Backup) && goto :RunBackup
       if exist %%A:\TBWinRE_Auto_Restore (del %%A:\TBWinRE_Auto_Restore) && goto :RunRestore
      )
      goto :EOF
      
      :: Run Backup command
      :RunBackup
      echo.
      echo Running IFW backup operation...
      echo.
      "%IFWPath%" /b /uy /um /d:w0@0x4 /f:w0@0x6:"\win81x64" /v /comp:14 /log:0 /rb:4
      goto :EOF
      
      :: Run Restore command
      :RunRestore
      echo.
      echo Running IFW restore operation...
      echo.
      "%IFWPath%" /r /uy /um /d:w0 /f:w0@0x6:"\win81x64" /v /sp:0x1,0x2,0x3,0x4 /t /rft /log:0 /rb:4 /nvn:""
      goto :EOF
    6. Save the file and close Notepad.
    7. Click the TBLauncher tab. Change the Mode to WinPE. Since using the RunScript the IFW command you had here won't be used.
    8. Close Settings.
    9. Finish creating the build.
    10. Copy the new boot.wim file (iso\sources folder) to the \sources folder of the TBWinRE Recovery partition to update it (no need to copy anything else). Note that since you don't have the partition assigned a drive letter, you can copy using the volume guid instead of temporarily assigning a letter. What I did was just create an UpdateWIM.cmd script to run and copy the file.
      Code:
      tbutil -volguid \Device\HarddiskVolume6
      First, run tbutil to get the volume guid. Then create the update script (update the path as necessary):
      Code:
      @echo off
      copy c:\tbwinre\iso\sources\boot.wim \\?\Volume{94488e40-8195-420e-9440-138138156f3e}\sources
      
      You can then just run this when you want to update the WIM.
    11. Make a copy of the TBWinRE-Boot-BCD-Entry.cmd file. Name it to indicate the Backup. Add a line to create the flag file the RunScript will look for (second line here). Note that your BCD GUID will be a different value.
      Code:
      @echo off
      echo TBWinRE > C:\TBWinRE_Auto_Backup
      bcdedit /bootsequence {cf672f51-37ba-11e5-b62d-b5e1bcc07bda}
      shutdown -r -t 0
      
    12. Make another copy and indicate a Restore:
      Code:
      @echo off
      echo TBWinRE > C:\TBWinRE_Auto_Restore
      bcdedit /bootsequence {cf672f51-37ba-11e5-b62d-b5e1bcc07bda}
      shutdown -r -t 0
      
    13. Run the script for the desired operation.
    This type of setup is pretty flexible. You can easily add additional code to perform other operations if you want.
     
  12. Mr.X

    Mr.X Registered Member

    Joined:
    Aug 10, 2013
    Posts:
    4,796
    Location:
    .
    Amazing the above post of yours! Thank you very much!

    I guess the following corrected line is right ok?

    set IFWPath=X:\Program Files (x86)\Terabyte Unlimited\Image for Windows\V2\imagew.exe
     
  13. MudCrab

    MudCrab Imaging Specialist

    Joined:
    Nov 3, 2006
    Posts:
    6,483
    Location:
    California
    It's best to just use the default path for the build, which is X:\Program Files\....
     
  14. Mr.X

    Mr.X Registered Member

    Joined:
    Aug 10, 2013
    Posts:
    4,796
    Location:
    .
    I don't understand this MudCrab. Whenever install IFW (this package: Image for Windows V2.99-00 (GUI) with IFD-GUI, IFL-GUI, and IFU-CUI) on Windows x64 I get the mentioned "default" path: C:\Program Files (x86)\Terabyte Unlimited\Image for Windows\V2\*.*

    What do you mean by build? Am I doing something wrong? Tell me if I need to change IFW installation path manually or something, thanks.
     
  15. MudCrab

    MudCrab Imaging Specialist

    Joined:
    Nov 3, 2006
    Posts:
    6,483
    Location:
    California
    The RunScript is run after booting to TBWinRE. X: is assigned to the RAM drive. "X:\Program Files" is the default program files path. Has nothing to do with where it's installed in Windows. "Build" refers to the particular TBWinRE build.
     
  16. Mr.X

    Mr.X Registered Member

    Joined:
    Aug 10, 2013
    Posts:
    4,796
    Location:
    .
    Fine, I got it. Thanks.
     
  17. Mr.X

    Mr.X Registered Member

    Joined:
    Aug 10, 2013
    Posts:
    4,796
    Location:
    .
    I'm testing this build right now. Backup function is working flawlessly but restore won't. I'm trying to figure out what's the problem...
     
  18. Mr.X

    Mr.X Registered Member

    Joined:
    Aug 10, 2013
    Posts:
    4,796
    Location:
    .
    TBWinRE-Create-BCD-Entry.cmd created these two files:

    TBWinRE-Boot-BCD-Entry.cmd
    Code:
    @echo off
    bcdedit /bootsequence {a82edbb9-eaf6-11e5-8e32-ae0081b097e5}
    shutdown -r -t 0 
    and

    TBWinRE-Remove-BCD-Entry.cmd
    Code:
    @echo off
    bcdedit /delete {a82edbb9-eaf6-11e5-8e32-ae0081b097e5}
    bcdedit /delete {a82edbba-eaf6-11e5-8e32-ae0081b097e5} 
    Made two copies of TBWinRE-Boot-BCD-Entry.cmd, added the line and renamed them like this:

    Backup.cmd
    Code:
    @echo off
    echo TBWinRE > C:\TBWinRE_Auto_Backup
    bcdedit /bootsequence {a82edbb9-eaf6-11e5-8e32-ae0081b097e5}
    shutdown -r -t 0 
    Restore.cmd
    Code:
    @echo off
    echo TBWinRE > C:\TBWinRE_Auto_Restore
    bcdedit /bootsequence {a82edbb9-eaf6-11e5-8e32-ae0081b097e5}
    shutdown -r -t 0
    Can't pinpoint the wrong line or something.
     
  19. MudCrab

    MudCrab Imaging Specialist

    Joined:
    Nov 3, 2006
    Posts:
    6,483
    Location:
    California
    What's in RunScript.cmd? Any changes? Remove the "/rb:4" option from the restore command so it doesn't reboot and then you could look at the IFW.LOG file and see if any errors are shown. It could be running, but just failing.

    Unless you mean Windows never reboots when you run Restore.cmd....
     
  20. Mr.X

    Mr.X Registered Member

    Joined:
    Aug 10, 2013
    Posts:
    4,796
    Location:
    .
    Yes, it runs but fails. The computer reboots as normal then boots into TBWinPE and cmd prompt shows "Running IFW restore operation" for a few seconds then closes then IFL operations Windows appears instead of running the process.

    RunScript.cmd
    Code:
    @echo off
    setlocal enableextensions enabledelayedexpansion
    cls
    
    :: Search for TBWinRE_Auto_* file and run command
    
    set IFWPath=X:\Program Files\Terabyte Unlimited\Image for Windows\V2\imagew.exe
    
    for %%A in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do (
    if exist %%A:\TBWinRE_Auto_Backup (del %%A:\TBWinRE_Auto_Backup) && goto :RunBackup
    if exist %%A:\TBWinRE_Auto_Restore (del %%A:\TBWinRE_Auto_Restore) && goto :RunRestore
    )
    goto :EOF
    
    :: Run Backup command
    :RunBackup
    echo.
    echo Running IFW backup operation...
    echo.
    "%IFWPath%" /b /uy /um /d:w0@0x4 /f:w0@0x6:"\win81x64" /v /comp:14 /log:0 /rb:4
    goto :EOF
    
    :: Run Restore command
    :RunRestore
    echo.
    echo Running IFW restore operation...
    echo.
    "%IFWPath%" /r /uy /um /d:w0 /f:w0@0x6:"\win81x64" /v /sp:0x1,0x2,0x3,0x4 /t /rft /log:0 /rb:4 /nvn:""
    goto :EOF

    Where does IFW.LOG file is located?
     
  21. MudCrab

    MudCrab Imaging Specialist

    Joined:
    Nov 3, 2006
    Posts:
    6,483
    Location:
    California
    In the IFW folder. Normally, X:\Program Files\TeraByte Unlimited\Image for Windows\V2.
     
  22. Mr.X

    Mr.X Registered Member

    Joined:
    Aug 10, 2013
    Posts:
    4,796
    Location:
    .
    Then I need to run Restore.cmd again to find and look into IFW.LOG
     
  23. Mr.X

    Mr.X Registered Member

    Joined:
    Aug 10, 2013
    Posts:
    4,796
    Location:
    .
    Couldn't find it either. Perhaps I didn't setup IFW to log all events, dunno.
     
  24. MudCrab

    MudCrab Imaging Specialist

    Joined:
    Nov 3, 2006
    Posts:
    6,483
    Location:
    California
    Yes. If the reboot doesn't happen (due to the failure or by removing /rb) you should be able to figure out what the command should be (assuming changes are needed). Then you can make the necessary changes to the script after getting back into Windows.
     
  25. Mr.X

    Mr.X Registered Member

    Joined:
    Aug 10, 2013
    Posts:
    4,796
    Location:
    .
    Yes the reboot never happens but I didn't remove /rb parameter but either way I should find that log file, but I wasn't able to.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.