• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2404
  • Last Modified:

Automated Repartition for Hard Disk in Unattended installation

Hello All,

I made an unattended CD for my Windows XP setup. Everything I have is fine and the unattended installation works perfectly except for one thing, REPARTION OF THE HARD DISK. I have tried everything to automate the repartition but nothing seems to be working.

Basically, what I am trying to do is to delete all current Hard Disk portions and create two new portions; the C Drive should take 30 GB and the result of the Hard Disk should go the D Drive and format both portions with NTFS file system and then to launch the Windows Setup.

Please help,
Thanks,
0
EDSDSS
Asked:
EDSDSS
  • 21
  • 17
  • 5
1 Solution
 
and235100Commented:
0
 
EDSDSSAuthor Commented:
and235100,
I tired to use diskpart, but I could not because it does not work in DOS.
Could you please explain me if it is possible how to use diskpart to delete the portions and then to create 30GB to C drive and the result to D Drive and format new portions with NTFS?
Thanks for your reply,
0
 
and235100Commented:
Something like:

@echo off
diskpart clean all
diskpart create partition primary size=30720
diskpart active
diskpart create partition extended
diskpart create partition logical

Then you can proceed to format and run setup from there...

0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
and235100Commented:
Diskpart is an XP/2000/2003 tool
But it does work in DOS as well: http://www.computerhope.com/diskpart.htm
0
 
EDSDSSAuthor Commented:
I got the following message when I try to run it from DOS bootable desk.
This program cannot be run in DOS mode.
I am able to run it form windows DOS only.
0
 
and235100Commented:
No - you are correct.
Without the additional support - you would only be able to access fdisk...
0
 
h11Commented:
add this to the top of your winnt.sif file found in the i386 directorty
note this will format hd automatically and all data that was present will be gone
[Data]
Autopartition = 1
MsDosInitiated = 0
UnattendedInstall = Yes
0
 
EDSDSSAuthor Commented:
Guys, thanks for your replies

I want to delete all current Hard Disk portions and create two new portions; the C Drive should take 30 GB and the result of the Hard Disk should go the D Drive and format both portions with NTFS file system and then to launch the Windows Setup.

If anyone have idea how to do that please help.
0
 
and235100Commented:
You would have to create one partition (as per h11's instructions) then utilise a batch file after windows was setup (so diskpart functionality is available) to create an extended partition, and then the D: drive.

Unfortunately - Diskpart is really the only viable way of doing what you want.
0
 
h11Commented:
you could create a dos boot disk run fdisk from a bat file with this command
FDISK 1/PRI:30000000 - Command line to create a 30 gig DOS primary partition on hard disk and then put in your  xp auto cd and then add this to the top of your winnt.sif file found in the i386 directorty
[Data]
Autopartition = 1
MsDosInitiated = 0
UnattendedInstall = Yes

note this will format hd automatically and all data that was present will be gone.  This will only format the primary partition which you just created.  It should leave the rest alone that you can later format and use. by using the suggestion given to you by 235100.  you can create  a bat file have this command run in a run once under the winnt.sif
@echo off
create partition extend
assign e:

0
 
EDSDSSAuthor Commented:
Guys, thanks again for your help,

I need to create and format both portions before starting windows setup because I want to install my documents and settings on D drive.

Any ideas to do that?

[data removed by Jason1178, CA]
0
 
h11Commented:
do you want to do this during the installation? Or are you willing to do it first with a boot disk and then use your auto cd to do the rest?

if so you could create a dos boot disk run fdisk from a bat file with this command
FDISK 1/PRI:30000000 - Command line to create a 30 gig DOS primary partition
0
 
EDSDSSAuthor Commented:
h11,

I want to do the partition before starting the installation, and I want to format both partitions with NTFS then start the setup.

Is that possible?
0
 
h11Commented:
So you could use a dos boot disk to create your partitions then use your cd to do the rest correct?  If that will work for you I will find out the commands you need to do for this. let me know
0
 
EDSDSSAuthor Commented:
H11,

If it possible to use one dos bootable disk to create the two partitions and format them with NTFS it will be fine with me. I can use the disk to format and then the CD to do the installation.

Thanks in advance.
0
 
h11Commented:
EDSDSS:

you can create the two partitions with dos but not convert them to NTFS.  When you instll the xp it will automatically convert the first partition to NTFS and the second one can be converted to NTFS in a command on your auto cd install.  I will give you all the commands on Monday when I get back in the office.
0
 
h11Commented:
is your hard disk a sata hd or a IDE HD?  If it is a sata fdisk will not work correctly. I found this article this will help you on getting your Autocd complete.

http://www.msfn.org/board/HOWTO-Unattended-CD-BartPE-t68252.html

Download link for the BARTpe
http://www.nu2.nu/pebuilder/
0
 
EDSDSSAuthor Commented:
h11,

Can you please explain to me step by step how to use this tool "BartPE" to do the partition and then to run the window setup. Because I am not able to understand it form the article. I think it is a tool for emergency.

Please note that I have some SATA HDD.

Thanks,
0
 
h11Commented:
I will create a ISO image and  upload it to a web site wher you can get it.  Give me a day or so to do this.
0
 
EDSDSSAuthor Commented:
h11,

I will use this image which you will upload to automated the partition and formatting? then I have to remove this CD and use my automated CD to do the installation?

Thanks in advance.
0
 
EDSDSSAuthor Commented:
h11,

Are you still going to upload to me the ISO image?
0
 
EDSDSSAuthor Commented:
I am increasing the point value to 350.
0
 
h11Commented:
I have ran into some problems with Bartpe and have had no time to work on this.  I will look at it this weekend and let you know of the status on Monday.
0
 
EDSDSSAuthor Commented:
all right h11, take your time, awiting you on next monday. Thanks
0
 
h11Commented:
contact me at timothy.volk@gmail.com I will let you know where the image is.
0
 
EDSDSSAuthor Commented:
I send my email to you, awiting your response. Thanks
0
 
EDSDSSAuthor Commented:
h11,

thanks for the file, I am downloading it right now. I will let you know by tomorrow.

Please note that i have increased the point value to 500.
0
 
h11Commented:
Change this in you winnt.sif file

;SetupMgrTag
[Data]
AutoPartition=1
MsDosInitiated="0"
UnattendedInstall="Yes"
[Unattended]
UnattendMode=FullUnattended
OemSkipEula=Yes
OemPreinstall=Yes
NoWaitAfterTextMode=1
NoWaitAfterGUIMode=1
TargetPath=\WINDOWS
DisableDynamicUpdates=Yes
FileSystem=NTFS remove
WaitForReboot="No"
KeepPageFile=0
ResetSourcePath=C:\
UpdateInstalledDrivers=Yes
Repartition=no
PartitionType=Primary
FileSystem=NTFS remove
QuickFormat=Yes
ExtendOEMPartition=1 remove
UnattendSwitch=Yes
0
 
EDSDSSAuthor Commented:
h11, my winnt.sif file become like this, i have just removed the 3 lines which u ask me to remove. please confiurm. Thanks

;SetupMgrTag
[Data]
AutoPartition=1
MsDosInitiated="0"
UnattendedInstall="Yes"

[Unattended]
UnattendMode=FullUnattended
OemSkipEula=Yes
OemPreinstall=Yes
NoWaitAfterTextMode=1
NoWaitAfterGUIMode=1
TargetPath=\WINDOWS
DisableDynamicUpdates=Yes
WaitForReboot="No"
KeepPageFile=0
ResetSourcePath=C:\
UpdateInstalledDrivers=Yes
Repartition=No
PartitionType=Primary
QuickFormat=Yes
UnattendSwitch=Yes
0
 
h11Commented:
remove also

PartitionType=Primary
QuickFormat=Yes
let me know how it goes
0
 
EDSDSSAuthor Commented:
h11, i got the following error when i try to boot from it.
stop: c0000221 unknkown hard error
\systemroot\system32\ntdll.dll

any idea?
0
 
h11Commented:
Explain to me what you have done up to now.
0
 
EDSDSSAuthor Commented:
h11,
I was not able to boot from your image due to the above error, so I tired to create my own image using BartPE and it works. I copy your files from your image to my. but I am only able to format the current partition. I can't delete the current partitions or create new.

I want this image to delete all current partitions and then create two partitions 30 GB to C drive and the result goes to the D drive and format both partitions with NTFS.

Is that possible h11?

Thanks for your great help.
0
 
h11Commented:
create two files one called Autorun1.cmd and the other called partion.txt  save these files inside your Bartpe project under the I368\system32 directory. then create your iso image.

autorun1.cmd

NET START DMADMIN

DISKPART /s partinfo.txt
FORMAT c: /fs:ntfs /Q /V:Local /Y
FORMAT D: /fs:ntfs /Q /V:Local /Y

pause

partion.txt

SELECT DISK 0
CLEAN
CREATE PARTITION PRIMARY size=30096
ASSIGN
ACTIVE
CREATE PARTITION EXTENDED
CREATE PARTITION LOGICAL
ASSIGN
EXIT


0
 
h11Commented:
correction save the second file as partinfo.txt
0
 
EDSDSSAuthor Commented:
h11, i got the following dos messege when i start bartPE,

the logical disk manager administrative service service was started successfually.
x:\i386\system32>DISKPART /s partinfo.txt
Microsoft DiskPart version 5.1.3565
Copyright <c> 1999-2003 Microsoft Corporation.
On computer: MININT-JVC
Disk 0 is now the selected disk.
DiskPart was suceeded in cleaning the disk.
DiskPart was unable to create the specified partition.
x:\i386\system32>format C: /fs:ntfs /Q /V:local /Y
spefified drive does not exisit.
x:\i386\system32>format D: /fs:ntfs /Q /V:local /Y
spefified drive does not exisit.
x:\i386\system32>pause
Press any key to continue....

it just deleted the partitions and did not create any partitions or do the formatting.

Please advice.

0
 
h11Commented:
what size is the hard disk?
0
 
EDSDSSAuthor Commented:
h11,
It was 160GB Sata,

I tired with 60GB IDE and it work fine. I will do more testes and I will let you know.

Thanks for your greate help.
0
 
h11Commented:
I have done tihs on sata drives when i was testing it and had no problem.
0
 
EDSDSSAuthor Commented:
Dear H11,

Thanks for you great help. I have done my tests and it works fine.

Thanks
0
 
EDSDSSAuthor Commented:
Thank you very much h11 for your help.
0
 
EDSDSSAuthor Commented:
I used BartPE to automate the repartitions part than for unattended XP setup I use my CD. I merge the two CD using EasyBoot.
0
 
h11Commented:
EDSDSS

I am no longer using cds I am using a usb pen to do all of this it loads bartpe, partitions the drives and starts the windows xp setup.  I am no longer blocked by the limits on a cd..  
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 21
  • 17
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now