Jump to content

Windows installation problems using BartPE


Vann

Recommended Posts

Because I needed to create a very specific partition arrangement and then format the drives, I decided to use BartPE to run launch my Windows unattended install (since the unattended install cannot partition things prior to installation). I want the setup to go like this: 8GB C: system partition and D: the rest of the drive, then setting ProfilesDir=D:\ in winnt.sif so C:\Documents and Settings\ is instead D:\.

I configured BartPE to launch a file called install.bat in the root directory of the CD as the shell (instead of nu2menu). Here is that file.

@echo off

REM if EXIST C:\install GOTO _install
REM if NOT EXIST C:\install GOTO _prepare

:_prepare
net start dmserver
net start dmadmin
diskpart /s %SYSTEMDRIVE%\diskpart.cfg
if ERRORLEVEL 0 GOTO _format
if NOT ERRORLEVEL 0 GOTO _error
GOTO _end

:_format
format C: /FS:NTFS /V:System /Q /y
format M: /FS:NTFS /V:Profiles /Q /y
REM echo install > C:\install
GOTO _install
REM GOTO _end

:_install
REM del /f C:\install
%SYSTEMDRIVE%\files\i386\winnt32.exe /unattend:%SYSTEMDRIVE%\files\i386\winnt.sif /s:%SYSTEMDRIVE%\files\i386 /syspart:C: /tempdrive:C: /makelocalsource
IF NOT ERRORLEVEL 0 GOTO _error
GOTO _end

:_error
start /wait cmd
GOTO _end

:_end

Here is my diskpart.cfg:

select disk 0
clean
create partition primary size=8192
select partition 1
assign letter=C
active
select disk 0
create partition extended
create partition logical
assign letter=M

I thought that Windows would reassign the drive letter M: to D: upon reboot, but that is not the case. The installation finishes but it cannot load the profile directories and all sorts of bad things happen. Is there any way around this? Or any thoughts on the matter?

Thanks.

Link to comment
Share on other sites


After much struggling with this i found that BartPE doesn't work with diskpart...

When I changed to WinPE directly, all my problems went away.

Try a third part application if you havent already.

Roger

Link to comment
Share on other sites

Work in what way? Diskpart runs fine here. If you change the shell, as I did, the Logical Disk Management service is not started and you get an error when you run diskpart. However, that's why I have "net start dmserver" and "net start dmadmin" in that batch file.

Diskpart definitely partitions everything correctly. The problem is that I have to juggle drive letters, and I wasn't expecting the assignment to be retained after boot.

Link to comment
Share on other sites

Ok as to that, I would run diskpart to get multiple drives (even if they didnt have the drive letter I was lookig for)

Then I would reboot and WinPE would take a drive value of E: and then my script would build the drive correctly after I wiped the drive.

Roger

Link to comment
Share on other sites

Ok as to that, I would run diskpart to get multiple drives (even if they didnt have the drive letter I was lookig for)

Then I would reboot and WinPE would take a drive value of E: and then my script would build the drive correctly after I wiped the drive.

Roger

Diskpart only keeps the drive letter assignment for that session of WinPE. It does not store the values afterwards in the install.

For instance, if you set the "C" drive to be the "F" drive, that only stays as the "F" drive until you leave the WinPE environment. Upon reboot to the install, Windows assigns the drive letters according to how it finds the drives.

At least, that's my understanding of how it works.

Link to comment
Share on other sites

  • 3 weeks later...

so after finally getting around to trying this, i noticed that after runninng the intitial winnt32.exe commmands there is what i consider way too much file copying going on. after issuing the command in winpe it copies files to the ~bt and ~ls directories, and then after rebooting back into text mode setup, copies the same files again.

am i wrong here? is there something i messed up? i always thought that it should just skip text mode setup all together and just get on with the gui part right when the winnt32 command was issued.

Link to comment
Share on other sites

  • 1 month later...

i'm having similar problems with pertitions, i have more than one Disk, and more pertitions however. The principle is the same, i need quite specific drive letter so the doc's and settings and programs directories can both be moved to a seperate partitions! Does anyone know how to do this, any help woudl be grately appreciated?

Link to comment
Share on other sites

  • 1 month later...
  • 2 weeks later...

@Vann: If you move to a Windows XP SP2 based WinPE your problem should go away... The problem you're hitting occurs when WinPE is installed on the HD and you're running a Winnt32 installation with non-standard drive letter assignments. Winnt32 tries to migrate your drive letters which ends up confusing everyone.

They fixed this in "version 2004" (the sp2 release of winpe).

Metzen is right about WinPE not saving drive letter assignments in any other scenario.

You should probably skip the /makelocalsource switch -- using it is telling Winnt32 that the file source it's copying from is going to disappear in textmode setup (like a net connection, or a cd that you plan on removing). Since your source files are on the HD you can save some time by not using this flag.

@Voltaic: Winnt32 always lays down textmode setup. The only way to start further through setup is to use imaging...

If you're just dumping out installations of the OS then you can also just use the OS cd and an unattend file on a floppy (no winpe involved here) to throw down the OS. This skips the Winnt32 phase -- so you just get Textmode and Gui mode... and a lot less file copying.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...