1) Manually prepare a disk using diskpart or diskpart import script
Configuring a MBR partitioned drive is a bit different than configuring a GPT partitioned drive.
Here are some reference technet articles:
For mbr:
You must be registered for see links
For gpt:
You must be registered for see links
You have 2 choices for each partition scheme, and none of them include Windows XP or Vista support.
It might be possible to support dual-booting to Vista and XP, but you need to install them first as they don't have native system partition support. In Windows 7/2008server they started adding a 100mb system partition for storing certain things. I don't know all what is stored on them. I know that defender updates are stored there. Probably registry settings as well. Anything beyond defender updates is just speculation from me.
The choices for each method are whether or not you want to include a recovery partition.
MBR diskpart script for no recovery partition is:
select disk 0
clean
create partition primary size=350
format quick fs=ntfs label="System"
assign letter="S"
create partition primary
format quick fs=ntfs label="Windows"
assign letter="W"
exit
MBR diskpart script for recovery partition is:
=====================================================
rem == CreatePartitions-BIOS.txt
rem == These commands are used with DiskPart to create
rem == three partitions for a BIOS/MBR based computer.
rem == Adjust the partition sizes to fill the drive as necesary.
=====================================================
select disk 0
clean
=====================================================
rem == 1. System partition
=====================================================
create partition primary size=350
format quick fs=ntfs label="System"
assign letter="S"
active
=====================================================
rem == 2. Windows partition
=====================================================
rem == a. Create the Windows partition.
create partition primary
rem == b. Create space for the recovery image.
rem == Note, adjust the size to match the size of the recovery image.
shrink minimum=15000
rem == c. Prepare the Windows partition.
format quick fs=ntfs label="Windows"
assign letter="W"
=====================================================
rem == 3. Recovery image partition
=====================================================
create partition primary
format quick fs=ntfs label="Recovery image"
assign letter="R"
set id=27
list volume
exit
For GPT without recovery partition diskpart script is:
select disk 0
clean
convert gpt
create partition primary size=300
format quick fs=ntfs label="Windows RE tools"
assign letter="T"
rem == Note: for Advanced Format Generation One drive
rem == change to size=260.
create partition efi size=100
format quick fs=fat32 label="System"
assign letter="S"
create partition msr size=128
create partition primary
format quick fs=ntfs label="Windows"
assign letter="W"
For GPT partition WITH recovery partition it's:
=====================================================
rem == CreatePartitions-UEFI.txt
rem == These commands are used with DiskPart to
rem == create five partitions for a UEFI/GPT-based PC.
rem == Adjust the partition sizes to fill the drive as necessary
=====================================================
select disk 0
clean
convert gpt
=====================================================
rem == 1. Windows RE tools partition
===============================================
create partition primary size=300
format quick fs=ntfs label="Windows RE tools"
assign letter="T"
set id="de94bba4-06d1-4d40-a16a-bfd50179d6ac"
gpt attributes=0x8000000000000001
=====================================================
rem == 2. System partition
=====================================================
rem == Note: for Advanced Format Generation One drive
rem == change to size=260.
create partition efi size=100
format quick fs=fat32 label="System"
assign letter="S"
=====================================================
rem == 3. Microsoft Reserved (MSR) partition
=====================================================
create partition msr size=128
=====================================================
rem == 4. Windows partition
=====================================================
rem == a. Create the Windows partition
create partition primary
rem == b. Create space for the recovery image.
rem == Note, adjust the size to match the size of the recovery image.
shrink minimum=15000
rem == c. Prepare the Windows partition =========
format quick fs=ntfs label="Windows"
assign letter="W"
rem === 5. Recovery image partition ================
create partition primary
format quick fs=ntfs label="Recovery image"
assign letter="R"
set id="de94bba4-06d1-4d40-a16a-bfd50179d6ac"
gpt attributes=0x8000000000000001
list volume
exit
Note that the recovery partitions are at the end of the primary hard disk and that they are created by shrinking the primary partition. You could change the size of the shrink minimum to save a smaller amount of room or larger amount of room. If you get real good with creating recovery partitions you could make them very small and thus use up less room. This is not incredibly important for large magnetic hard disks, but it can be very beneficial on smaller SSD hard disks.
The way you can use these scripts varies:
You can either create a script on a USB flash drive and thus call the script using something like this
,
where F is the letter of the USB flash drive to partition the drive:
DiskPart /s F:\CreatePartitions.txt
or
you could use something like this, and put the
MBRNOREC.txt along with a few other diskpart scripts on the
boot.wim index:2 root.
Diskpart /s X:\MBRNOREC.txt
Why would you want to put it there on
X:?
Because that's where the command prompt defaults you to when you press
Shift-F10 during setup. So if you already had the files there, you wouldn't need to fumble around trying to find your files before you apply them. You could also use this to your advantage making a choice script to decide which diskpart txt script you want to run diskpart /s with.
Using a script to apply different schemes is incredibly useful for setting up different OS versions to their default sizes. You never NEED to use a smaller system partition, but you could match them up with the default ones that
Windows Setup creates for certain OS versions.
Here's a list of sample MBR "SYSTEM" partition sizes:
Windows 7/SP1 and Server 2008/R2:
100MB system
Windows Server 2011 SBS Standard/Essentials and Home:
100MB system, 50GB Windows partition, 100GB minimum data partition
Windows 8/Server2012:
300MB system
Windows 8.1/Server2012r2:
350MB system
Now that you can manually partition your primary drive, how do you apply the image and get it ready to run?
OK, putting the diskpart txt scripts in the
boot.wim index 2 is a neat shortcut but if you make a script to apply images, you'll need to know where the disk with the
sources\install.wim or
sources\install.esd is. I'm sure a lot of people would have a very short solution, but I'd probably use something like this:
if exist d:\sources\install.wim set MYIMAGE=d:\sources\install.wim
if exist d:\sources\install.esd set MYIMAGE=d:\sources\install.esd
if exist e:\sources\install.wim set MYIMAGE=e:\sources\install.wim
if exist e:\sources\install.esd set MYIMAGE=e:\sources\install.esd
and so forth until z: Then you could call up the path to the image using the %MYIMAGE% tag instead of messing with a faulty small loop that may or may not get it right.
Now, to apply the image, you do something such as:
Dism /apply-image /imagefile:%MYIMAGE% /index:1 /ApplyDir:W:\
That would be your Windows partition, and hence why you would apply the image to that partition.
Now, Make sure your "SYSTEM" partition (not Windows partition) is set to Active if you are using MBR partition format.
This is done by using the "Active" command after creating the system partition.
An example where this is done correctly would be:
format quick fs=ntfs label="System"
assign letter="S"
active
This is important if you want your system to be bootable.
To make said system partition bootable, you run the following command:
W:\Windows\system32\bcdboot W:\Windows
It copies the files from W:\Windows to the system partition. You can also use the /l argument to change the boot information language.
bcdboot w:\Windows /l en-us would set it to English - United States. es-es would be Spanish. pt-br would be Brazilian Portuguese, and so on.