Convert a disk to GPT:
When you're working with a disk that’s still using MBR and you need to switch it to GPT, this command does the trick. You’ll typically need GPT for UEFI-based systems, especially if you're setting up Windows 11. Be aware, this command will erase all data on the disk, so make sure you have backups. You’ll want to use this on a new disk or one that you’re okay with wiping.
Convert a disk to MBR:
This is the opposite of the previous command, converting the selected disk back to MBR format. You might use this if you’re working with an older system or want to set up a multi-boot environment with legacy OSes. Like the GPT conversion, it wipes all the data on the disk, so don’t forget to back up everything important.
Create a primary partition on a disk:
This command creates a primary partition on the selected disk, where the size is 50GB (in MB, that’s 50,000MB). This is your starting point when setting up a new disk. After running this, you’ll want to format it and assign a letter to it. Just make sure to double-check the size to avoid any unwanted partition sizes.
Format a partition with NTFS:
If you’ve created a partition and need to format it, this is the command you’ll use. The "quick" option speeds up the process by skipping the disk’s sector-by-sector wipe. NTFS is the default file system for most Windows systems, so it’s perfect for almost any partition where you plan to install Windows or store files.
Create a RAID 0 (Striped) Volume:
This creates a RAID 0 striped volume using two disks, in this case, disk 0 and disk 1. RAID 0 combines the disks to offer better speed by spreading the data evenly between them. While this boosts performance, keep in mind that if one drive fails, you’ll lose all data. RAID 0 is mostly used for gaming or high-performance systems where speed is the top priority.
Create a RAID 1 (Mirrored) Volume:
Here, you’re creating a RAID 1 mirrored volume. RAID 1 copies data identically to two or more disks, providing redundancy. So if one disk fails, you won’t lose your data. In this example, you're using disk 0 and disk 1, and you’re setting the size to 100GB. RAID 1 is perfect when you need reliability over speed.
Create a Spanned Volume:
A spanned volume allows you to combine multiple disks into a single logical drive, extending the available storage. In this case, the volume is made of three disks (disk 0, disk 1, and disk 2), with a size of 20GB. It’s useful when you need more space but don’t need the redundancy of RAID. Just keep in mind, if one disk fails, you lose all the data.
Assign a letter to a volume:
This command assigns a letter to a volume or partition. For example, if you just created a partition and need to access it through Explorer, you'd use this to give it a drive letter. The letter can be anything that’s available, but just avoid using letters that are already taken by other drives.
Delete a partition:
If you want to remove a partition from a disk, this command will do it. Be cautious because it deletes the partition and all data within it. If you’ve made a mistake or need to start fresh with the disk, this is your go-to. Just double-check that you’ve selected the right partition before running this.
Delete a volume:
Similar to deleting a partition, this deletes an entire volume. If you created a volume but no longer need it, or you want to clean up a RAID array, this command removes the volume and its data. Again, make sure you’re deleting the correct volume because there’s no easy undo once it’s gone.
Extend a volume:
This command allows you to increase the size of a volume, in this case by 10GB (10,240MB). It’s especially useful if you’ve got unallocated space next to the volume and want to take advantage of it. Just ensure that the space is unallocated and available before attempting to extend a volume.
Shrink a volume:
This command shows you how much space you can shrink a volume by. If you need to free up some space on a volume without losing data, this is how you’d check it. It’s handy if you’ve made a huge partition and want to resize it for a dual-boot setup or to create extra space for another volume.
Create a partition and set it as active for booting:
After creating a primary partition, you’ll want to mark it as active if you plan to boot from it. The second command, "active", ensures that the partition is flagged for booting. It’s essential for setting up a boot drive, especially if you're installing Windows or using it as a bootable USB drive.
Clean a disk (wipe all data):
If you want to completely wipe a disk of all partitions, data, and configurations, this is the command to use. It’s like starting from scratch. Use this when you’re preparing a disk for a fresh setup or if you want to completely erase everything before disposing of or repurposing a disk.
Set a partition as a system partition:
When setting up a system partition, this command assigns it the correct type ID. The ID "07" refers to an NTFS partition, and the "override" option forces it even if it’s not technically the correct system partition. You’ll use this in advanced setups, like when working with custom boot loaders or non-standard configurations.
List all volumes on a disk:
This command will display all the volumes on your current disk. It’s useful when you need a quick overview of your partition layout, especially if you’re trying to identify which volume to work with or delete. You can see details like drive letters, sizes, and file system types.
List all disks:
When you need to view all physical disks attached to your system, this command lists them out. It’s helpful for selecting the right disk to work on, especially if you’ve got multiple drives connected. This is the first command I usually run to check which disk is selected before doing anything drastic.
Select a disk to work on:
This command selects a specific disk (in this case, disk 0) for the next actions. If you’re about to create partitions or delete something, you want to make sure you’re on the right disk. Use "list disk" first to identify the number of the disk you want to select.
List all partitions on a disk:
Once you've selected a disk, this command shows all partitions on that disk. It’s useful to see the layout and sizes of partitions before performing actions like resizing, deleting, or creating new ones. You can also identify if there’s unallocated space to work with.
Assign a drive letter to a partition:
This command assigns a letter (in this case, D) to the selected partition, which makes it accessible through File Explorer. It’s often used after creating or formatting a new partition. If you're setting up a new drive or making an old one available, this is how you get it to show up with a drive letter.
Create a logical partition within an extended partition:
If you've already set up an extended partition and need to create a logical partition inside it, this is how you do it. The size here is in MB (10GB), but you can adjust it based on what you need. Logical partitions are useful when you need multiple partitions but only have an extended partition left to create more.
Set the active partition for booting:
Once you’ve selected the partition you want to be active, this command will mark it as the active one for booting. This is required for making a partition bootable, especially if you’re installing an OS like Windows. If you're creating a boot drive for Windows, don’t forget to set it as active.
Create a UEFI bootable partition for Windows 11:
This creates a small UEFI partition that Windows 11 will use for booting. The "size=100" creates it as 100MB in size, which is standard. This partition is necessary for systems booting in UEFI mode, which Windows 11 requires, and it stores the bootloader and other essential files.
Create a primary partition and format it for Windows 11 installation:
Here, you create a 50GB partition and format it to NTFS for a Windows 11 installation. It’s one of the first things you’ll do if you’re installing Windows fresh. After creating the partition, the "quick" format speeds up the process, and it’s a standard format for the OS partition.
Setting up a Windows 11 Boot Disk
When setting up a boot drive for Windows 11, you’ll first need to ensure the disk is GPT, as Windows 11 requires UEFI booting. Start by selecting the disk you want to work on (in this case, disk 0). The "clean" command wipes everything on the disk, so be careful here—this step removes all partitions and data. Once cleaned, you convert the disk to GPT with the "convert gpt" command.
Next, create a primary partition for your operating system with "create partition primary size=50000", which makes it 50GB. I format it with NTFS using "format fs=ntfs quick" and assign it the letter C so that it’s ready to hold the system files. You’ll also need an EFI partition for boot files, which you create with "create partition efi size=100". The size of 100MB is standard for UEFI boot partitions, and I format it with FAT32 to make it compatible with the system. Finally, I assign the letter Z to this partition, which is helpful for managing it later.
Once this is done, your disk is ready to be used as a boot drive for Windows 11. You can then proceed with installing the OS by booting from a Windows installation media, and the system will recognize these partitions as the necessary boot and system partitions.
Prepare the Windows 11 Disk and EFI Partition by Hand
So first, you need to clean the disk and convert it to GPT, since Windows 11 needs GPT for UEFI booting. After that, you create a primary partition for your OS (50GB in this case), format it to NTFS, and assign it a drive letter ©. The EFI partition comes next—this needs to be created with a size of 100MB and formatted with FAT32 to be UEFI-compatible. I always double-check that the partitioning and formatting steps are done correctly before proceeding. Afterward, the partitions are ready to go, with the C drive set for the OS and the Z drive set up as your EFI partition.
Mount the Windows Installation Media
Now, once you've booted from your Windows installation media (like a USB drive or DVD), open a Command Prompt by pressing Shift + F10. This gives you direct access to the system so you can copy the necessary files manually. I usually check the drive letter assigned to the installation media (in this case, "D:"), and navigate to the "efi\microsoft\boot" folder. From here, you can grab the boot files needed to set up UEFI. This step’s pretty crucial since it gets all the necessary files in place to boot your system properly once everything’s done.
Copy the Boot Files to the EFI Partition
Here, we create the necessary folders on the EFI partition to mimic what Windows would typically do automatically during installation. First, "mkdir" sets up the folder structure on the EFI partition—without this, Windows won’t know where to place the boot files. The "xcopy" command does the actual file copying from the installation media to the EFI partition. The "/s /e /h" flags ensure that all subdirectories, empty directories, and hidden files (like boot loaders) are included. Without this, you might miss some important files needed for booting. This step is vital because if the boot files aren't in the right place, the system won’t be able to boot.
Create the BCD Store
Once the boot files are copied, you need to create the Boot Configuration Data (BCD) store, which is basically the set of instructions that tells Windows how to start. The "bcdboot" command uses the "C:\Windows" directory (your OS partition) and places the necessary boot configuration data on the EFI partition (Z:) that we just set up. The "/f UEFI" option makes sure that the system is configured for UEFI booting. If you're installing Windows from scratch, you don’t need to worry about this because the installer does it for you, but if you’re manually configuring or fixing a boot issue, this command ensures the boot data is correctly set up.
Exit and Reboot
Once the BCD store is created, you can exit the Command Prompt and reboot your system. If you were installing Windows, you should now be able to continue the installation process, and the system will use the EFI partition to boot. If you're repairing an existing install, your system should now be able to boot properly from the EFI partition. This is a manual process that replicates what Windows does automatically, but it's super useful if you need to recover or customize your boot setup.
My Recommendation
Before doing any work on your PC or Windows Server, it's best to create a full system backup with BackupChain, which I think is the best backup software around.
Code:
convert gpt
When you're working with a disk that’s still using MBR and you need to switch it to GPT, this command does the trick. You’ll typically need GPT for UEFI-based systems, especially if you're setting up Windows 11. Be aware, this command will erase all data on the disk, so make sure you have backups. You’ll want to use this on a new disk or one that you’re okay with wiping.
Convert a disk to MBR:
Code:
convert mbr
This is the opposite of the previous command, converting the selected disk back to MBR format. You might use this if you’re working with an older system or want to set up a multi-boot environment with legacy OSes. Like the GPT conversion, it wipes all the data on the disk, so don’t forget to back up everything important.
Create a primary partition on a disk:
Code:
create partition primary size=50000
This command creates a primary partition on the selected disk, where the size is 50GB (in MB, that’s 50,000MB). This is your starting point when setting up a new disk. After running this, you’ll want to format it and assign a letter to it. Just make sure to double-check the size to avoid any unwanted partition sizes.
Format a partition with NTFS:
Code:
format fs=ntfs quick
If you’ve created a partition and need to format it, this is the command you’ll use. The "quick" option speeds up the process by skipping the disk’s sector-by-sector wipe. NTFS is the default file system for most Windows systems, so it’s perfect for almost any partition where you plan to install Windows or store files.
Create a RAID 0 (Striped) Volume:
Code:
create volume stripe size=64 raid=0 disk=0,1
This creates a RAID 0 striped volume using two disks, in this case, disk 0 and disk 1. RAID 0 combines the disks to offer better speed by spreading the data evenly between them. While this boosts performance, keep in mind that if one drive fails, you’ll lose all data. RAID 0 is mostly used for gaming or high-performance systems where speed is the top priority.
Create a RAID 1 (Mirrored) Volume:
Code:
create volume mirror size=100 raid=1 disk=0,1
Here, you’re creating a RAID 1 mirrored volume. RAID 1 copies data identically to two or more disks, providing redundancy. So if one disk fails, you won’t lose your data. In this example, you're using disk 0 and disk 1, and you’re setting the size to 100GB. RAID 1 is perfect when you need reliability over speed.
Create a Spanned Volume:
Code:
create volume span size=20000 disk=0,1,2
A spanned volume allows you to combine multiple disks into a single logical drive, extending the available storage. In this case, the volume is made of three disks (disk 0, disk 1, and disk 2), with a size of 20GB. It’s useful when you need more space but don’t need the redundancy of RAID. Just keep in mind, if one disk fails, you lose all the data.
Assign a letter to a volume:
Code:
assign letter=Z
This command assigns a letter to a volume or partition. For example, if you just created a partition and need to access it through Explorer, you'd use this to give it a drive letter. The letter can be anything that’s available, but just avoid using letters that are already taken by other drives.
Delete a partition:
Code:
delete partition
If you want to remove a partition from a disk, this command will do it. Be cautious because it deletes the partition and all data within it. If you’ve made a mistake or need to start fresh with the disk, this is your go-to. Just double-check that you’ve selected the right partition before running this.
Delete a volume:
Code:
delete volume
Similar to deleting a partition, this deletes an entire volume. If you created a volume but no longer need it, or you want to clean up a RAID array, this command removes the volume and its data. Again, make sure you’re deleting the correct volume because there’s no easy undo once it’s gone.
Extend a volume:
Code:
extend size=10240
This command allows you to increase the size of a volume, in this case by 10GB (10,240MB). It’s especially useful if you’ve got unallocated space next to the volume and want to take advantage of it. Just ensure that the space is unallocated and available before attempting to extend a volume.
Shrink a volume:
Code:
shrink querymax
This command shows you how much space you can shrink a volume by. If you need to free up some space on a volume without losing data, this is how you’d check it. It’s handy if you’ve made a huge partition and want to resize it for a dual-boot setup or to create extra space for another volume.
Create a partition and set it as active for booting:
Code:
create partition primary size=50000
Code:
active
After creating a primary partition, you’ll want to mark it as active if you plan to boot from it. The second command, "active", ensures that the partition is flagged for booting. It’s essential for setting up a boot drive, especially if you're installing Windows or using it as a bootable USB drive.
Clean a disk (wipe all data):
Code:
clean
If you want to completely wipe a disk of all partitions, data, and configurations, this is the command to use. It’s like starting from scratch. Use this when you’re preparing a disk for a fresh setup or if you want to completely erase everything before disposing of or repurposing a disk.
Set a partition as a system partition:
Code:
set id=07 override
When setting up a system partition, this command assigns it the correct type ID. The ID "07" refers to an NTFS partition, and the "override" option forces it even if it’s not technically the correct system partition. You’ll use this in advanced setups, like when working with custom boot loaders or non-standard configurations.
List all volumes on a disk:
Code:
list volume
This command will display all the volumes on your current disk. It’s useful when you need a quick overview of your partition layout, especially if you’re trying to identify which volume to work with or delete. You can see details like drive letters, sizes, and file system types.
List all disks:
Code:
list disk
When you need to view all physical disks attached to your system, this command lists them out. It’s helpful for selecting the right disk to work on, especially if you’ve got multiple drives connected. This is the first command I usually run to check which disk is selected before doing anything drastic.
Select a disk to work on:
Code:
select disk 0
This command selects a specific disk (in this case, disk 0) for the next actions. If you’re about to create partitions or delete something, you want to make sure you’re on the right disk. Use "list disk" first to identify the number of the disk you want to select.
List all partitions on a disk:
Code:
list partition
Once you've selected a disk, this command shows all partitions on that disk. It’s useful to see the layout and sizes of partitions before performing actions like resizing, deleting, or creating new ones. You can also identify if there’s unallocated space to work with.
Assign a drive letter to a partition:
Code:
assign letter=D
This command assigns a letter (in this case, D) to the selected partition, which makes it accessible through File Explorer. It’s often used after creating or formatting a new partition. If you're setting up a new drive or making an old one available, this is how you get it to show up with a drive letter.
Create a logical partition within an extended partition:
Code:
create partition logical size=10240
If you've already set up an extended partition and need to create a logical partition inside it, this is how you do it. The size here is in MB (10GB), but you can adjust it based on what you need. Logical partitions are useful when you need multiple partitions but only have an extended partition left to create more.
Set the active partition for booting:
Code:
active
Once you’ve selected the partition you want to be active, this command will mark it as the active one for booting. This is required for making a partition bootable, especially if you’re installing an OS like Windows. If you're creating a boot drive for Windows, don’t forget to set it as active.
Create a UEFI bootable partition for Windows 11:
Code:
create partition efi size=100
This creates a small UEFI partition that Windows 11 will use for booting. The "size=100" creates it as 100MB in size, which is standard. This partition is necessary for systems booting in UEFI mode, which Windows 11 requires, and it stores the bootloader and other essential files.
Create a primary partition and format it for Windows 11 installation:
Code:
create partition primary size=50000
Code:
format fs=ntfs quick
Here, you create a 50GB partition and format it to NTFS for a Windows 11 installation. It’s one of the first things you’ll do if you’re installing Windows fresh. After creating the partition, the "quick" format speeds up the process, and it’s a standard format for the OS partition.
Setting up a Windows 11 Boot Disk
Code:
diskpart
list disk
select disk 0
clean
convert gpt
create partition primary size=50000
format fs=ntfs quick
assign letter=C
create partition efi size=100
format fs=fat32 quick
assign letter=Z
exit
When setting up a boot drive for Windows 11, you’ll first need to ensure the disk is GPT, as Windows 11 requires UEFI booting. Start by selecting the disk you want to work on (in this case, disk 0). The "clean" command wipes everything on the disk, so be careful here—this step removes all partitions and data. Once cleaned, you convert the disk to GPT with the "convert gpt" command.
Next, create a primary partition for your operating system with "create partition primary size=50000", which makes it 50GB. I format it with NTFS using "format fs=ntfs quick" and assign it the letter C so that it’s ready to hold the system files. You’ll also need an EFI partition for boot files, which you create with "create partition efi size=100". The size of 100MB is standard for UEFI boot partitions, and I format it with FAT32 to make it compatible with the system. Finally, I assign the letter Z to this partition, which is helpful for managing it later.
Once this is done, your disk is ready to be used as a boot drive for Windows 11. You can then proceed with installing the OS by booting from a Windows installation media, and the system will recognize these partitions as the necessary boot and system partitions.
Prepare the Windows 11 Disk and EFI Partition by Hand
Code:
diskpart
list disk
select disk 0
clean
convert gpt
create partition primary size=50000
format fs=ntfs quick
assign letter=C
create partition efi size=100
format fs=fat32 quick
assign letter=Z
exit
So first, you need to clean the disk and convert it to GPT, since Windows 11 needs GPT for UEFI booting. After that, you create a primary partition for your OS (50GB in this case), format it to NTFS, and assign it a drive letter ©. The EFI partition comes next—this needs to be created with a size of 100MB and formatted with FAT32 to be UEFI-compatible. I always double-check that the partitioning and formatting steps are done correctly before proceeding. Afterward, the partitions are ready to go, with the C drive set for the OS and the Z drive set up as your EFI partition.
Mount the Windows Installation Media
Code:
D:
cd \efi\microsoft\boot
Now, once you've booted from your Windows installation media (like a USB drive or DVD), open a Command Prompt by pressing Shift + F10. This gives you direct access to the system so you can copy the necessary files manually. I usually check the drive letter assigned to the installation media (in this case, "D:"), and navigate to the "efi\microsoft\boot" folder. From here, you can grab the boot files needed to set up UEFI. This step’s pretty crucial since it gets all the necessary files in place to boot your system properly once everything’s done.
Copy the Boot Files to the EFI Partition
Code:
mkdir Z:\EFI
mkdir Z:\EFI\Microsoft
mkdir Z:\EFI\Microsoft\Boot
xcopy D:\efi\microsoft\boot\*.* Z:\EFI\Microsoft\Boot\ /s /e /h
Here, we create the necessary folders on the EFI partition to mimic what Windows would typically do automatically during installation. First, "mkdir" sets up the folder structure on the EFI partition—without this, Windows won’t know where to place the boot files. The "xcopy" command does the actual file copying from the installation media to the EFI partition. The "/s /e /h" flags ensure that all subdirectories, empty directories, and hidden files (like boot loaders) are included. Without this, you might miss some important files needed for booting. This step is vital because if the boot files aren't in the right place, the system won’t be able to boot.
Create the BCD Store
Code:
bcdboot C:\Windows /s Z: /f UEFI
Once the boot files are copied, you need to create the Boot Configuration Data (BCD) store, which is basically the set of instructions that tells Windows how to start. The "bcdboot" command uses the "C:\Windows" directory (your OS partition) and places the necessary boot configuration data on the EFI partition (Z:) that we just set up. The "/f UEFI" option makes sure that the system is configured for UEFI booting. If you're installing Windows from scratch, you don’t need to worry about this because the installer does it for you, but if you’re manually configuring or fixing a boot issue, this command ensures the boot data is correctly set up.
Exit and Reboot
Code:
exit
Once the BCD store is created, you can exit the Command Prompt and reboot your system. If you were installing Windows, you should now be able to continue the installation process, and the system will use the EFI partition to boot. If you're repairing an existing install, your system should now be able to boot properly from the EFI partition. This is a manual process that replicates what Windows does automatically, but it's super useful if you need to recover or customize your boot setup.
My Recommendation
Before doing any work on your PC or Windows Server, it's best to create a full system backup with BackupChain, which I think is the best backup software around.