This repository has been archived by the owner on Sep 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 210
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #132 from parameshbabu/master
Recovery tools update
- Loading branch information
Showing
7 changed files
with
100 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
sel disk 0 | ||
|
||
sel vol 1 | ||
remove all dismount noerr | ||
assign letter=C noerr | ||
format fs=NTFS quick label="MainOS" override noerr | ||
|
||
sel vol 3 | ||
remove all dismount noerr | ||
assign letter=D noerr | ||
format fs=NTFS quick label="Data" override noerr | ||
|
||
lis vol | ||
exit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
REM startnet_recovery.cmd | ||
|
||
REM Format MainOS and Data partitions | ||
call diskpart /s diskpart_format.txt | ||
|
||
REM Define drive letters (assigned by diskpart script) | ||
set MAINOSDRIVE=C | ||
set EFIDRIVE=E | ||
set RECOVERYDRIVE=R | ||
set DATADRIVE=D | ||
set DPPDRIVE=P | ||
|
||
REM Apply EFIESP partition WIM file | ||
dism /apply-image /ImageFile:%RECOVERYDRIVE%:\efiesp.wim /index:1 /ApplyDir:%EFIDRIVE%:\ | ||
REM This will reset BCD to defaults, so immediately reset recovery parameter in case of power loss | ||
bcdedit /store %EFIDRIVE%:\EFI\microsoft\boot\bcd /set {bootmgr} bootsequence {a5935ff2-32ba-4617-bf36-5ac314b3f9bf} | ||
|
||
REM Apply the MainOS and Data partition WIM files. The order below is important - do not change | ||
dism /apply-image /ImageFile:%RECOVERYDRIVE%:\data.wim /index:1 /ApplyDir:%DATADRIVE%:\ /Compact | ||
dism /apply-image /ImageFile:%RECOVERYDRIVE%:\mainos.wim /index:1 /ApplyDir:%MAINOSDRIVE%:\ /Compact | ||
|
||
REM Restore Junctions for Data/DPP/MMOS partitions | ||
REM Only necessary when recovery WIMs not generated from same FFU | ||
mountvol %DATADRIVE%:\ /L > volumeguid_data | ||
set /p VOLUMEGUIDDATA=<volumeguid_data | ||
rmdir %MAINOSDRIVE%:\Data | ||
mklink /J %MAINOSDRIVE%:\Data %VOLUMEGUIDDATA% | ||
|
||
mountvol %DPPDRIVE%:\ /L > volumeguid_dpp | ||
set /p VOLUMEGUIDDPP=<volumeguid_dpp | ||
rmdir %MAINOSDRIVE%:\DPP | ||
mklink /J %MAINOSDRIVE%:\DPP %VOLUMEGUIDDPP% | ||
|
||
mountvol %RECOVERYDRIVE%:\ /L > volumeguid_recovery | ||
set /p VOLUMEGUIDRECOVERY=<volumeguid_recovery | ||
rmdir %MAINOSDRIVE%:\MMOS | ||
mklink /J %MAINOSDRIVE%:\MMOS %VOLUMEGUIDRECOVERY% | ||
|
||
REM Fix up MountedDevices registry to point to correct Data partition GUID | ||
set VOL=%VOLUMEGUIDDATA% | ||
set VOL=%VOL: =% | ||
set UDRIVEBINARYBLOB=444D494F3A49443A%vol:~17,2%%vol:~15,2%%vol:~13,2%%vol:~11,2%%vol:~22,2%%vol:~20,2%%vol:~27,2%%vol:~25,2%%vol:~30,4%%vol:~35,12% | ||
reg load "HKLM\RecoveryIoTSystem" %MAINOSDRIVE%:\windows\system32\config\system | ||
reg add "HKLM\RecoveryIoTSystem\MountedDevices" /v "\DosDevices\U:" /t REG_BINARY /f /d %UDRIVEBINARYBLOB% | ||
reg unload "HKLM\RecoveryIoTSystem" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters