Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account



Photo

Winpe Boot, Diskpart, .bat Scripting

- - - - -

  • Please log in to reply
10 replies to this topic

#1
chekm8

chekm8
  • Member
  • 4 posts
  • Joined 28-March 05
Morning all,

Been lurking on and off on this forum and have gotten some great help, but can't seem to quite pinpoint my issue. A quick breakdown of what I have going. Have an unattended instal running for our W2K desktops using .BAT files. The process below has been proven and has ran without any issues and has had "0" user input other than to remove the CD from the drive (which I found here, can be automated)


PROCESS;
1. CD running DOS boots
a. determines NIC and drops propper drivers
b. determines IP address and based on IP, maps propper server mapping
c. drops flag (small Ghost img) and reboots
d. after reboot, if flag (in 1c.) is found, asks for computer name which is save it to the .UDF on network

2. then runs Unattend.bat from network location
a. runs the W2K unattend.txt which formats and does it's thing
b. copies over the .UDF and names the box based on what's in the UDF
c. calls out APPS.BAT file that installs applications

3. Application install starts


So now we are moving to Windows XP. I've replaced the i386 files with that of WXP on my network share. I would like to have the same process as above work but ran into a drive formatting issue. XP doesn't build because the partition size is not large enough due to the fact that the "ExtendOemPartition=1" doesn't seem to work anymore under XP. I've tried to turn that switch off so that it prompts the user to format the drive and it works, but that defeats the purpose of having and unattended install. I would like that have that piece still automated.

So got a hold of WinPE 2004, tried the integrating DISKPART into old process but can't be run in DOS mode so it looks like I need to change step 1 to run from WinPE. Did some manual testing on VirtualPC and I can get WINBOM.INI to partition the drive and conver to NTFS. But when I run the UNATTEND.BAT on the network, I get "ACCESS DENIED". What am I doing wrong?

Is there any way to leave the process at the top alone and just utilize the DISKPART? It seems like using WINPE and WXP would be faster to build these boxes. Also, since WinPE should be the new standard, how do I tweak Process 1? I can probably eliminate Process 1a and 1c since WinPE takes care of that.

What do I need in WINBOM.INI to make it work so that it partitions the drive, maps to the proper server and runs the Unattend.bat?

Or, partition the drive, reboot the box, run through the process above (without 1a/1c)?

Using this code to partition the drive;
[DiskConfig]
Disk1 = Disk1.config

[Disk1.config]
WipeDisk = Yes
Size1 = *
PartitionType1 = Primary
SetActive1 = Yes
FileSystem1 = NTFS
QuickFormat1 = Yes

Thank you in advance for the help.


How to remove advertisement from MSFN

#2
ChrisBaksa

ChrisBaksa

    Member

  • Member
  • PipPip
  • 230 posts
  • Joined 05-March 04
I saw some interesting comments in your post.

The extendOEMPartition switch does work under XP. Our desktop team uses it with every build. I also use it with Windows 2000 and 2003 Server installs.

You may want to change your logic. I found it best to create a FAT32 partition and let the install process convert it to NTFS on it's own. I found that when I created an NTFS partition using powerquests PQIDEPLOY, that the OS didn't like the format. So now I allow the setup to convert during install (it's an unattend switch) it gave me a fully supported File structure by Microsoft.

Don't forget.. after you create and format the partition, you have to MOUNT it to the PE OS as a drive letter so it can be written to.


Chris

#3
getwired

getwired

    Member

  • Member
  • PipPip
  • 231 posts
  • Joined 20-November 04
You should install NTFS, not FAT32 with conversion. The end result isn't as efficient if you start with FAT32.

#4
Noise

Noise

    Windows Guru

  • Member
  • PipPipPip
  • 425 posts
  • Joined 27-February 04
Wow, this is almost exactly how I setup my XP installation procedure for my company. I like the cut of your jib chekm8 :)

Here's how I do it.

Use the freeware GDISK.EXE to format your initial partition as fat16.
Instead of 1.C use the disks volume label. Use gdisk like this in DOS:
GDISK 1 /MBR /WIPE /Y
GDISK 1 /CRE /PRI /FOR /-32 /V:XPREADY /Q /Y
The above two lines will wipe any data from the hard disk, create a single/active 2GB FAT16 partition on the drive, and set the volume lable to something you can identify in your scripts after rebooting.

As for converting this 2GB FAT16 partition to NTFS? Make sure your unattend.txt has this in it and it will convert the small fat16 partition to a single huge ntfs partition (cut-and-pasted the two sections because I'm lazy).

[Data]
    AutoPartition=1
    MsDosInitiated="0"
    UnattendedInstall="Yes"
    AutomaticUpdates=1

[Unattended]
    UnattendMode=FullUnattended
    UnattendSwitch=Yes
    OemSkipEula=Yes
    OemPreinstall=Yes
    TargetPath=\WINDOWS
    DriverSigningPolicy=ignore
    ExtendOemPartition=1
    FactoryMode=Yes
    FileSystem=ConvertNTFS
    Hibernation=No
    Repartition=Yes
    WaitForReboot=No
    NtUpgrade=No
    OemPreinstall=Yes
    CrashDumpSetting=0



#5
ChrisBaksa

ChrisBaksa

    Member

  • Member
  • PipPip
  • 230 posts
  • Joined 05-March 04

You should install NTFS, not FAT32 with conversion. The end result isn't as efficient if you start with FAT32.

<{POST_SNAPBACK}>


That depends on your application.

The tools I use do not Format NTFS properly. So Fat32 is what I use innitially.
This allow me to create a formatted 10 gig partition or up to a 500 Gig partition Very fast. The 10 gig partition takes less than 15 seconds.

Yes it extends the build time a but because of the conversion. But I accept it.
This is not an issue when I do imaging.

Chris

#6
getwired

getwired

    Member

  • Member
  • PipPip
  • 231 posts
  • Joined 20-November 04
Not only does it extend the build time, but it results in a system that is not as efficient as if you had formatted it NTFS to begin with.

#7
chekm8

chekm8
  • Member
  • 4 posts
  • Joined 28-March 05
Sweet! Thanks for the great info guys!

I editted STARTNET.CMD and got it to work. I've managed to get PE to just format the drive completely in NTFS format, then mapped out my shared drive and kick off the unattend.txt. I bypassed Diskpart completely and it still worked.

format c: /fs:NTFS /q /Y
net use drive: \\server\share password /USER:domain\login
i:\i386\winnt32.exe /s:i:\i386 /unattend:i:\unattend.txt

Weird how Microsoft switched back to "/unattend" from "/u". Anyway, I got that to work so I can test out some builds. Now I just need to tweak a few things so I can map to the nearest server depending on the IP address. You guys are kool! :thumbup

#8
chekm8

chekm8
  • Member
  • 4 posts
  • Joined 28-March 05
shoot! forgot to add. I know I read it somewhere on this site I believe, but I'm having a problem after PE finishes the Prep. I have to manually close out of PE for XP to start it's build. Tried the "exit" command in STARTNET.COMD and it seems to just hang. Any suggestions? TIA.

#9
getwired

getwired

    Member

  • Member
  • PipPip
  • 231 posts
  • Joined 20-November 04
Two things:

1: also add /makelocalsource /tempdrive:C: /syspart:C: to your winnt32 command to ensure it works properly.

2: Adding EXIT as the last command in startnet.cmd (right after winnt32) should just work, as it will exit the cmdprompt and cause a reboot. That's not working for you?

#10
duomenox

duomenox

    Junior

  • Member
  • Pip
  • 59 posts
  • Joined 25-May 04
If you want to format FAT32 and optimize it for conversion to NTFS copy oformat.com and cvtarea.exe from the WinXP Deployment Kit (or the Server 2003 Deployment kit) to your WinPE disc.

(The deployment kit can be found on the XP or 2003 CD as deploy.cab under CDROOT\Support\Tools)

Add the following lines to your boot process,

oformat c: /a:8 /v:"(Volume Name)" /q

cvtarea c:\cvtarea.tmp 1024 MB /contig /firstcluster 3 gb

That was assuming you have a drive that is 10GB or larger.
To convert from FAT32 to NTFS use the following command

convert c: /fs:ntfs /cvtarea:cvtarea.tmp


If you format your drives using this procedure and use cvtarea.exe to create a place holder for the NTFS MFT files your coverted NTFS partition will be almost as effiecient as a native NTFS format.

We use this procedure because Ghost Corp 8.0 cannot write to an NTFS partition in a ghost image.... so we keep all our images FAT32 and convert to NTFS during the configuration process.

One last thing,
If you convert your system drive to NTFS while in windows and want to script the converstion process you will need to use the following line

cmd.exe /C "echo y | convert c: /x /fs:ntfs /cvtarea:cvtarea.tmp"

This will bypass the request to force a dismount, then supply a yes answer to the "would you like to convert during the next reboot" question... the cmd /c will close the command window opened to run the command directly after the command finishes.

Use this method if you have a practical need to have your partiitons FAT32 (like for read/write use in ghost).

#11
getwired

getwired

    Member

  • Member
  • PipPip
  • 231 posts
  • Joined 20-November 04
THX - forgot about oformat...




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users