Solved

Automated Repartition for Hard Disk in Unattended installation

Posted on 2007-12-05
43
2,387 Views
Last Modified: 2010-04-21
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
Comment
Question by:EDSDSS
  • 21
  • 17
  • 5
43 Comments
 
LVL 32

Expert Comment

by:and235100
Comment Utility
0
 

Author Comment

by:EDSDSS
Comment Utility
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
 
LVL 32

Expert Comment

by:and235100
Comment Utility
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
 
LVL 32

Expert Comment

by:and235100
Comment Utility
Diskpart is an XP/2000/2003 tool
But it does work in DOS as well: http://www.computerhope.com/diskpart.htm
0
 

Author Comment

by:EDSDSS
Comment Utility
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
 
LVL 32

Expert Comment

by:and235100
Comment Utility
No - you are correct.
Without the additional support - you would only be able to access fdisk...
0
 
LVL 2

Expert Comment

by:h11
Comment Utility
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
 

Author Comment

by:EDSDSS
Comment Utility
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
 
LVL 32

Expert Comment

by:and235100
Comment Utility
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
 
LVL 2

Expert Comment

by:h11
Comment Utility
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
 

Author Comment

by:EDSDSS
Comment Utility
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
 
LVL 2

Expert Comment

by:h11
Comment Utility
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
 

Author Comment

by:EDSDSS
Comment Utility
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
 
LVL 2

Expert Comment

by:h11
Comment Utility
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
 

Author Comment

by:EDSDSS
Comment Utility
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
 
LVL 2

Expert Comment

by:h11
Comment Utility
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
 
LVL 2

Expert Comment

by:h11
Comment Utility
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
 

Author Comment

by:EDSDSS
Comment Utility
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
 
LVL 2

Expert Comment

by:h11
Comment Utility
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
 

Author Comment

by:EDSDSS
Comment Utility
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
 

Author Comment

by:EDSDSS
Comment Utility
h11,

Are you still going to upload to me the ISO image?
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 

Author Comment

by:EDSDSS
Comment Utility
I am increasing the point value to 350.
0
 
LVL 2

Expert Comment

by:h11
Comment Utility
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
 

Author Comment

by:EDSDSS
Comment Utility
all right h11, take your time, awiting you on next monday. Thanks
0
 
LVL 2

Expert Comment

by:h11
Comment Utility
contact me at timothy.volk@gmail.com I will let you know where the image is.
0
 

Author Comment

by:EDSDSS
Comment Utility
I send my email to you, awiting your response. Thanks
0
 

Author Comment

by:EDSDSS
Comment Utility
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
 
LVL 2

Expert Comment

by:h11
Comment Utility
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
 

Author Comment

by:EDSDSS
Comment Utility
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
 
LVL 2

Expert Comment

by:h11
Comment Utility
remove also

PartitionType=Primary
QuickFormat=Yes
let me know how it goes
0
 

Author Comment

by:EDSDSS
Comment Utility
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
 
LVL 2

Expert Comment

by:h11
Comment Utility
Explain to me what you have done up to now.
0
 

Author Comment

by:EDSDSS
Comment Utility
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
 
LVL 2

Accepted Solution

by:
h11 earned 500 total points
Comment Utility
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
 
LVL 2

Expert Comment

by:h11
Comment Utility
correction save the second file as partinfo.txt
0
 

Author Comment

by:EDSDSS
Comment Utility
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
 
LVL 2

Expert Comment

by:h11
Comment Utility
what size is the hard disk?
0
 

Author Comment

by:EDSDSS
Comment Utility
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
 
LVL 2

Expert Comment

by:h11
Comment Utility
I have done tihs on sata drives when i was testing it and had no problem.
0
 

Author Comment

by:EDSDSS
Comment Utility
Dear H11,

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

Thanks
0
 

Author Closing Comment

by:EDSDSS
Comment Utility
Thank you very much h11 for your help.
0
 

Author Comment

by:EDSDSS
Comment Utility
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
 
LVL 2

Expert Comment

by:h11
Comment Utility
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

There are 2 things you must have in order to connect to the internet behind a router, The "Gateway IP" of the router, which is usually something like 192.168.xxx.1, I've seen routers with default values of: 192.168.0.1, 192.168.1.1, 192.168.11.1, …
When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup". After a while, you have entered a loop for Auto repair which does not fix anything and you will be in a  panic as all your work w…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now