Video Screencast Help
Search Video Help Close Back
to help
Not able to make it to Vision this year? Get a sampling in the Best of Vision on Demand group.

ImageX Windows 7 and Altiris

Created: 11 Aug 2011 | 3 comments
Airtrade's picture
0 0 Votes
Login to vote

Dear all,

I've read up on a Windows 7, the hidden boot partition and ImageX.
But I cannot get it to work.

I am running Win 2008R2 server + SQL Server 2008 with Altiris Deployment Server 6.9 SP5.
And using Deployment with WinPE because DOS is not working in this setup.

So now I prepared an image and captured it with the following parameter, when using ImageX as a tool.
/capture D: S:\Images\Windows\W7Pro64bClean.wim

Used sysprep with generalize as some stated that was the problem.

The S: is the mapping location of eXpress.
This way I get an image with the actual Windows 7 data instead of the boot partition.

But now comes the difficult part, restoring the image.
I know the problem has got to do with the partition not being set right, but the question is how to fix this.

Tried making a job using BCDEdit to set the device and partition device to another partition, but that does not run with WinPE.

Can anyone tell me what could be a way to fix this ?

Saw that people deleted the hidden partition when preparing the W7 installation, but there has got to be a better way.

Kind regards,

M Homberg

Comments

DaveJ's picture
11
Aug
2011
0 Votes 0
Login to vote

For our Win7 images we just

For our Win7 images we just deleted the boot partition, but despite that I've still had occasional boot issues with 64bit images.  You can run BCDEdit in WinPE, however if you're deploying a 64bit image you'll want to run it from the drive WinPE loads itself to (in our case this is X:).  If you try to run BCDEdit from the drive you deployed your image to it will fail because your image is 64bit, but you're booted into 32bit WinPE.

As far as I know I haven't seen any issues running 32bit BCDEdit against a 64bit image.

MurrayW's picture
11
Aug
2011
0 Votes 0
Login to vote

Not sure I agree...

Stick with me, I have some advice, but my setup is a little different. We wanted a three partition install; System Partition, OS Partition, Data Partition, so we decided to use the IMG format instead (which also allows us to skip the DISKPART steps for ImageX deployments, and get multicasting without a SVR2008R2 box). As such, we deploy WITH a working system partition on the disk, but with the BCD information not matching the volume GUID and needing tweaking.

So here's the deal, we Deploy our W7x64 image, using WinPEv2.1 (32-Bit), and immediately follow it with something like this:

 

@ECHO OFF
ECHO Configuring Boot Information...
ECHO   * Detecting Drive Volumes...
SET ___Drive.SR=
SET ___Drive.OS=
FOR %%V in (C D E G H I J K L M N P Q T U V W Y Z) DO (
  ::: Check for the bootmgr to designate this volume as the "System Reserved"...
  IF EXIST "%%V:\bootmgr" (
    ECHO     * System Reserved Volume Found at %%V:
    set ___Drive.SR=%%V:
  )
  ::: Check for the "Explorer.exe" to designate this volume as the "System"...
  IF EXIST "%%V:\Windows\Explorer.exe" (
    ECHO     * OS Volume Found at %%V:
    set ___Drive.OS=%%V:
  )
)
ECHO.
ECHO   * Configuring Boot Manager...
ECHO     * Setting default partition to %___Drive.OS%...
%SYSTEMROOT%/system32/Bcdedit.exe /set {default} device partition=%___Drive.OS% >NUL
ECHO     * Setting boot OS partition to %___Drive.OS%...
%SYSTEMROOT%/system32/Bcdedit.exe /set {default} osdevice partition=%___Drive.OS% >NUL
ECHO     * Setting Boot Manager partition to %___Drive.SR%...
%SYSTEMROOT%/system32/Bcdedit.exe /set {bootmgr} device partition=%___Drive.SR% >NUL
ECHO.
ECHO Operations completed successfully.
REM ### Finish the script and clear the variables...
SET ___Drive.SR=
SET ___Drive.OS=
ping -n 5 127.0.0.1 > nul
 
Which is just a fancy way for us to work out which partition contains Windows, and which contains the BootMGR folder. I then simply use these volume letters in basic BCEDIT commands. NOTE: These commands, as written, use the 32-Bit WinPE environment to do their magic. It doesn't matter whether you use 32-Bit or 64-Bit WinPE for this step (unlike what was described in the previous comment).
 
The important thing to note is this: If you use ImageX, you're probably scripting the partitions in the unattend/WinPE section, or scripting DiskPart. If you play with partitions AFTER WinPE has loaded, it doesn't re-enumerate volume letters and can often leave you trying to access "D:" where the data actually needs to be on "F:" or something. It's therefore VERY important to not rely on basic "BCDEDIT" commands, otherwise you'll end up looking at BCD failures and "WinLoad.exe" screens all day. Using the script above should sort that out for you.
 
For more inforamtion on my deployment process (including the script above), check my Conenct Blogs:
 

Quote: "I know not what other much is else. But what other else is there?" - ***** (OP hidden as that was too awful! Lol)

kubasa's picture
12
Aug
2011
0 Votes 0
Login to vote

Here what I do.  We are using

Here what I do.  We are using DS 6.9 SP3.  I'm sure there are other options but this was the only way we could get BitLocker to work properly.  Hopefully this help a bit.

Capture Name Script Job (run before deploy image job)

REM Replace tokens in unattend.xml
REM ReplaceTokens .\sysprep_w7\unattend.xml .\temp\%ID%.inf

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

Deploy Image Script Job  (drive Y is mapped instead of the default F)

@echo off

net use y: \\altiris_server\express
x:

diskpart /s y:\software\hotfixes\W7_diskpart_master.txt   *(SEE BELOW)*

format s: /fs:ntfs /v:Reserved /q <y:\software\hotfixes\W7_disk_prep_answer.txt    *(SEE BELOW)*
format w: /fs:ntfs /q <y:\software\hotfixes\W7_disk_prep_answer.txt /v:    *(SEE BELOW)*

y:
cd WAIK\Tools\PETools\x86\
bootsect /nt60 SYS /mbr

cd y:\
cd WAIK\Tools\x86\
imagex /apply "y:\Images\Windows 7\1_1.wim" 1 w:

bcdboot.exe w:\windows

w:
cd windows\system32
Bcdedit.exe -set {bootmgr} device partition=w:
Bcdedit.exe -set {default} device partition=w:
Bcdedit.exe -set {default} osdevice partition=w:
Bcdedit.exe -set {default} description "Windows 7 Enterprise"

y:
cd y:\
copy "y:\temp\%ID%.inf" "W:\Windows\panther\unattend\unattend.xml" /Y

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

W7_diskpart_master.txt

Select disk 0
Clean
Create partition primary size=100
Select partition 1
Assign letter=S
Active
Create partition primary
Select partition 2
Assign letter=W
Exit

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

W7_disk_prep_answer.txt

Y