Jump to content

Partitioning prior to unattended install


Recommended Posts

Hello everyone. I found this forum in the course of searching for an answer to the question I am about to ask. I found some other things on this forum related to my question, but none seemed to answer it exactly so I thought I'd give it a shot.

I am trying to create an unattended Windows XP with SP1 installation disk, but I also want to separate the system files and the user data. To do this I make one 8GB partition for the system (C:) and a second partition taking up the rest of the space (D:). I have the unattended install working so that C:\Documents and Settings\ is instead located in D:, which is what I want. However, it would be ideal if I could have these partitions created and formatted before the installation process so it is truly "unattended." As it stands now, the point at which the install runs arbitrary commands is after the installation and if D: is not already formatted then the install halts.

I've been looking into perhaps using BartPE and diskpart, but I am not sure how to go about doing that. All the documentation is very sparse, and what I want to do seems pretty simple. I've created similar scripts in the past to do this sort of thing for MacOS and Linux/UNIX, but is it possible with Windows? If so, can anyone here give me some advice about how to do it?

Thank you.

Link to comment
Share on other sites


well, the unattended will ask where you want the windows installation on your hard drive, at least mine does

after that, it is unattended

and you can specify partition size by creating a partition in setup, after that it is unattended

BTW, I would make the windows partition bigger than 8 GB, as it still will fill up quickly unless you set the swap and temp folders to a different drive, and don't put alot of program on the machine

Link to comment
Share on other sites

Thanks for the reply, but the idea was to get an install that was completely unattended. I want to stick the CD in, come back in an hour, and have Windows XP installed. Moreover, this doesn't address the question of how to actually create the partitions and get Windows set up how I want (and need) it.

As for the 8GB, that is fine for what this computer is going to be doing. The only software installed is going to be Firefox, Adobe Acrobat, Adobe Photoshop, and PuTTY.

Thanks again for the reply.

Link to comment
Share on other sites

  • 2 weeks later...

I'm a blind computer professional. I've managed to create an unattended XP CD that works great except for one thing: being blind, I must get sighted help to navigate and respond to the text mode partitioning and format screens, which makes the process not quite "unattended"

I've read everything I can find on the subject, but everything seems to point to Bart's PE or WinPE. I did some reading on Bart's PE, but quite frankly find it sounding like it's used to build the unattended CD I've already got. I haven't read anything yet which leads me to believbe that I haven't totally wasted my time.

DISKPART has the capability to run it's commands from a script, and I have a grasp of the commands I need, so that part of the puzzle is solved.

Unfortunately, nothing tells me where or how to launch the necessary DISKPART /s scriptname.txt command, unless it's in relation to WinPE or using something like Bart's PE, which as I said seems overkill for the work I've already done.

To me, the logical thing is a .cmd file of some name placed somewhere in the existing structure necessary for an unattended install, but nowhere in my research does anyone describe this - it's always "use WinPE or Bart's PE" - which is a load of garbage. There has to be some way to accomplish this other than one of those two apps.

Would appreciate any help I could get at this point. Screen reader software, which normally allows me to fully use everything on the computer, can't be loaded in any way prior to the very first text mode screens that appear, so previously I've been stuck with having to get a sighted person to read things to help me fill in the blanks - it's a pain the sighted don't realize it is until they're also faced with being blind. I mention this as an aside in the hopes that all of those who have sufficient eyesight to do installs, whether that be on an enterprise or individual level, might appreciate what you have to be thankful for.

Link to comment
Share on other sites

You're right that it doesn't make any sense. Or rather, there ought to be a way to partition and format prior to an unattended install without using BartPE or WinPE. However, the fact of the matter is that it is impossible otherwise.

BartPE and WinPE are preinstallation environments, which means they are there to "prepare" your machine for installation. I got my unattended CD working exactly as I wanted by doing the following:

  1. Configuring BartPE to automatically launch an arbitrary script upon boot
  2. This script would read my diskpart configuration file and partition the drive accordingly, and then format the newly created partitions
  3. Run the Windows Setup from the CD by using winnt32.exe
  4. Reboot into Windows Setup, and from here on the answer file does the rest

There is no way around it. This is the way to do anything more complicated than format the one system partition automatically with an unattended install. Perhaps there is some secret documented command somewhere that is launched before the graphical part of Windows Setup begins, but I sincerely doubt it. I don't even think Windows Setup can run what needs to be run prior to the graphical part of the installation, i.e., 32-bit executeables.

It sounds like you're where I was about three weeks ago. I had my answer file, and diskpart configured out but didn't have the slightest idea of how get my partition table and filesystems as I wanted. After playing with BartPE for a day or so, though, I figured it out and it was really quite simple after that.

Link to comment
Share on other sites

However, the fact of the matter is that it is impossible otherwise

I wouldn't be this steep about the matter. Autoformat/partitioning has been around for a long while, propably a lot longer than xPE softwares.

I think that enough searching and working would result in another way. Wether or not the newfound way would be better than xPE is another topic to discuss.

I could try to ask around at work, there are some veteran guys who are likely to know atleast something about this.

-j

..I'm VERY suprised if there really isn't a way to do this now-a-days, since I have seen it happen with NT4. Although I think that was a program the sysadmin wrote, or scrapped up somewhere.

Link to comment
Share on other sites

Sure. In BartPE I set \install.bat to be the shell by looking at how nu2menu does it, so the machine reboots when the process ends. Then in the root directory of my CD I have this file, named install.bat:

@echo off

net start dmserver

if NOT ERRORLEVEL 0 (
CALL :error
GOTO:EOF
)

diskpart /s %SYSTEMDRIVE%\diskpart.cfg
if ERRORLEVEL 0 (
CALL :format
CALL :install
) ELSE (
CALL :error
)
GOTO:EOF

:format
format C: /FS:NTFS /V:System /Q /y
if ERRORLEVEL 0 (
; CALL :copy
) ELSE (
CALL :error
)

format R: /FS:NTFS /V:Profiles /Q /y

if NOT ERRORLEVEL 0 (
CALL :error
)

GOTO:EOF

:install
%SYSTEMDRIVE%\files\i386\winnt32.exe /unattend:%SYSTEMDRIVE%\files\i386\winnt.sif /s:%SYSTEMDRIVE%\files\i386 /syspart:C: /tempdrive:C: /makelocalsource
GOTO:EOF

:error
start /wait cmd
GOTO:EOF

The diskpart.cfg file creates one system partition of 8GB and a second partition that is the rest of the drive, labels them C: and R: respectively, then formats them. The first line is necessary because otherwise diskpart will complain about not being able to connect to the Logical Disk Management Service, or something like that. I guess most things start that by default. Also, in BartPE, %SystemDrive% will refer to the CD-ROM from which you're running the preinstallation environment.

Also, there's no line break on the winnt32.exe line, it's just really long.

Link to comment
Share on other sites

jest,

Windows Setup itself has no ability to partition and format anything but the system drive, as far as I know. If there is some utility that does this it will be functionally equivalent to BartPE in the sense that, well, it's doing something before installation. I'm sure something could be written quickly that isn't as general as BartPE (or WinPE), i.e., the only thing it can do is partition and format.

As for booting into DOS, that won't work. The DOS version of format can't format as NTFS, and has other 16-bit limitations (e.g., the drives can't be larger than a certain size). I tried doing this first, of course, but found that I needed the 32-bit WinNT command shell.

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...