• PARTITION MAGIC GUIDE
  • Set Active Partition From Command Prompt

Set Active Partition with Diskpart Command Line

Set active partition from command prompt is often used when you have multiple system in one disk, you can set active partition in Windows 2008, in Windows 2003, and the latest Windows 10, by setting one partition active is to make this partition bootable, at the meantime you set other partition not active

Main interface

Before we go to detailed steps, there are some information we shall know

  • Active partition : active partition must be primary partition
  • Primary partition : OS can only runs in Primary Partitions
  • Boot sector : created by the operating system, located at the beginning of the active partition
  • Boot loader : Find Operating System boot files

Steps to set active partition in command line with diskpart

1. press WIN+R to open RUN box, type diskpart

2. in the opened window type list disk

diskpart_lisk_disk

3. diskpart will list all the disks you have installed, type select disk ###

4. type list partition

5. type select partition ###

6. type active

Now you set this partition active, when you reboot, you can switch to another Windows system.

Set Active Partition in Disk Management

Set active partition in Disk management is another way to make partition bootable, Server 2008, Windows 10, and other Windows Systems can share steps as follow to set active partition:

1. Press shortcut key WIN+R to open RUN box, type diskmgmt.msc , or you can just right-click on Start bottom and select Disk Management in Windows 10 and Windows Server 2008

2. right-click on the partition you want to set active, choose Mark partition as active,

disk_management_mark_active

Set Active Partition in Partition Expert

1. Run Partition Expert, Right-click on one partition to Set Active

mde_set_active_partition

2. Then there is an alert: Setting this partition as active partition will set the other partition as inactive, Are you sure you want to set the partition as active?

partition_expert_info

3. Click YES to continue, > Commit .

DOWNLOAD BUY NOW

Set Active Partition BIOS

1. Reboot your computer, when you say the message Press F# to enter setup , Press the bottom, and you will see BIOS interface.

2. Go into each menu and find terms with BOOT, may be BOOT ORDER, FIRST BOOT DEVICE, things like that, my pc shows Advance BIOS Features: First Boot Device, Second Boot Device, Third Boot Device. > Press Enter

3. Use up and down arrow key to choose between: HDD (hard drive), Floppy, CDROM, or Network; or between: CD-ROM Drive; Removable Devices; Hard Drive; Network boot. BIOS differs.

4. Exit and YES to Save changes

  • Resize a Partition in Windows 7
  • Free Download Partition Magic Portable
  • Move Free Space from One to Another
  • Backup & Recovery
  • Hard Disk Manager
  • HFS+ for Windows
  • ExtFS for Windows
  • Disk Wiper Professional
  • Drive Copy Professional
  • Migrate OS to SSD
  • Paragon Alignment Tool Professional
  • NTFS for Mac
  • Hard Disk Manager for Mac
  • ExtFS for Mac

diskpart set active

[How to] Make partition Active or Inactive using DISKPART

The system will boot from the partition only if it has Active flag set.

To make partition Active:

  • Run Command Prompt as Administrator
select disk #
list partition
select partition #

To remove Active flag:

Enter your email and receive updates about special offers and exclusive content!

Connect with us for giveaways, exclusive promotions and last news!

diskpart set active

This browser is no longer supported.

Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.

  • 9 contributors
Applies to: Windows Server 2022, Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012, and Windows Server 2008 R2, Windows Server 2008

The diskpart command interpreter helps you manage your computer's drives (disks, partitions, volumes, or virtual hard disks).

Before you can use diskpart commands, you must first list, and then select an object to give it focus. After an object has focus, any diskpart commands that you type will act on that object.

Determine focus

When you select an object, the focus remains on that object until you select a different object. For example, if the focus is set on disk 0 and you select volume 8 on disk 2, the focus shifts from disk 0 to disk 2, volume 8.

Some commands automatically change the focus. For example, when you create a new partition, the focus automatically switches to the new partition.

You can only give focus to a partition on the selected disk. After a partition has focus, the related volume (if any) also has focus. After a volume has focus, the related disk and partition also have focus if the volume maps to a single specific partition. If this isn't the case, focus on the disk and partition are lost.

To start the diskpart command interpreter, at the command prompt type:

You must be in your local Administrators group, or a group with similar permissions, to run diskpart.

You can run the following commands from the Diskpart command interpreter:

Listing available objects

You can view a list of options associated to each command by running the main command followed by what is available to that specific command. Running list by itself will display the four parameters below:

Screenshot of the diskpart list command.

After you run the list command, an asterisk ( * ) appears next to the object of focus.

To see available disk(s), run list disk :

To select a disk, run select disk followed by the disk number. For example:

Screenshot of  diskpart showing available list command options.

Before disk 1 can be utilized, a partition will need to be created by running create partition primary :

Lastly, we can perform a quick format of disk 1 to NTFS with the label "Backup" by running format fs=ntfs label=Backup quick as seen below:

Screenshot of diskpart showing how to create a partition and formatting the drive.

Related links

Command-Line Syntax Key

Disk management overview

Storage Cmdlets in Windows PowerShell

Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see: https://aka.ms/ContentUserFeedback .

Submit and view feedback for

Additional resources

MiniTool

  • Knowledge Base

How to Mark Partition as Active or Inactive in Windows

What is active partition? This article will answer the question. What's more, this article also states the detailed steps to set one partition active.

Active partition is computer boot partition . And the startup files of operating system are installed in this partition. Partition C: in Windows systems is usually  set as active partition  by default while active partition in Linux is set according to specific setting. When the system is booted, operating system on active partition will perform drive image in order to assign drive letters to primary partitions and logical partitions . All primary partitions will be imaged first while logical drives are assigned according to subsequent letters. 

Let’s see how to assign drive letter manually.

1.The Definition of Hard Disk Active Partition

Active partition is computer boot partition. And the startup files of operating system are installed in this partition. Partition C: in Windows systems is usually set as active partition by default while active partition in Linux is set according to specific setting. When the system is booted, operating system on active partition will perform drive image in order to assign drive letters to primary partitions and logical partitions. All primary partitions will be imaged first while logical drives are assigned according to subsequent letters. 

2.The Methods for Setting Partition as Active or Inactive

The system partition must be the active primary partition for booting . And it must lie in the hard disk accessed by computer when OS is booting. There should be only one active system partition in one disk. Several basic disks are allowed to exist on computer, each of which has its own active partition. However, you can start computer only by one specified disk. If you want to use another OS, you must set the system partition of the certain OS as active before restarting computer.

You can’t mark an existing dynamic volume as active, but, you can convert basic disk which includes active partition to dynamic disk. This active partition will become active simple volume after disk conversion. If active partition is not the current system partition or boot partition, it will become simple volume and its record in partition table will be lost. Then, it will become inactive.

Actually, active partition is the primary partition with boot data. It can achieve taking over starting tasks and other operations from BIOS in order to boot system.

You had better have only one primary partition, or it may be difficult for you to manage your disk. You can generally divide a 10G primary partition in a small hard disk. For a big one, you can divide a primary partition which is about 15G to 20G. You don’t need to divide a primary partition that is too large.

Set Partition as Active (only 32-bit)

The first method: you can use Windows interface.

  • Enter “ compmgmt.msc ” in “ Run ” ( to open Computer Management ).
  • Click “ Disk Management ” under “ Storage ” of “ Computer Management ”.
  • Right click the partition which needs setting active and click “ Mark Partition as Active ”.

hard disk active partition

The second method: you can use command line

  • Enter “ cmd ” in “ Run ”.
  • Enter “ diskpart ”.
  • Enter “ list disk ”. 
  • Enter “ select disk 0 ”, for example, we want to set the first partition of disk 0 active.
  • Enter “ list partition ”.
  • Enter “ select partition 1 ”.
  • Enter “ active ”. 

Set Partition as Inactive

You can only use command line to set partition as inactive, because the “ Mark Partition as Inactive ” option in Windows interface can’t be chosen now.

  • Enter “ CMD ” and run diskpart by inputting “ DISKPART> ”.
  • Enter “ LIST DISK ” to determine ## number of your hard disk.
  • enter em=””>Select DISK 0” to set your disk as current operating hard disk.
  • Enter “ LIST PARTITION ” to determine ## number of your disk partition .
  • Enter “ Select PARTITION 1 ” to set the first partition as current operating partition.
  • Enter “ INACTIVE ” to set the current partition as inactive. 

About The Author

Position: Columnist

How to set a partition as active

This article shows how to setup your primary partition as active using the diskpart utility.

This how-to article applies for any of the following Windows versions: Windows XP, Vista, 7, 8 or 8.1

The following instructions are done through Command Prompt, which you can use if you can’t boot into Windows to set the partition as active.

However, you can use Disk Management if you can boot into Windows and do the necessary changes to your partition:

  • Click Start
  • Click Control Panel
  • Click System and Security
  • Click Administrative Tools
  • Double-click Computer Management

Select Disk Management from Storage

Select Disk Management from Storage

  • Right-click on the partition you want to set as partition and click Mark Partition as Active

Use diskpart from Easy Recovery Essentials

You can use Command Prompt from Easy Recovery Essentials and run the diskpart utility to make the necessary modifications to a partition:

Download Easy Recovery Essentials

  • Burn the ISO Image. Follow our instructions on how to burn a bootable ISO image . If you’d like to have a recovery USB instead, follow our instructions on how to make a recovery USB .
  • Boot Easy Recovery Essentials from the CD, DVD or USB

Easy Recovery Essentials screenshot

To download Easy Recovery Essentials, click here .

Set partition as active on Windows XP

In order to use diskpart and set your computer’s primary partition as active again, use your Windows XP installation disc to start Recovery Console .

If you don’t the original Windows XP CD, go to Use diskpart from Easy Recovery Essentials .

  • Insert the Windows XP installation CD
  • Restart the computer
  • Press any key at the “Press any key” screen

Windows XP Press R for Recovery Console

Windows XP Press R for Recovery Console

Recovery Console on Windows XP

Recovery Console on Windows XP

  • After Recovery Console logged into the Windows Installation, type diskpart . Hit Enter to load the diskpart utility.
  • Type list partition , press Enter
  • Type select partition X , where X is your partition
  • Press Enter
  • Type active and press Enter
  • Restart your computer

Set partition as active on Windows Vista

Marking a partition as active on Windows Vista systems follows the same steps as the steps for Windows 7 or Windows 8 .

You need to use the original disc (Windows Vista install DVD) to access Command Prompt and run diskpart.

If you don’t the original Windows Vista DVD, go to Use diskpart from Easy Recovery Essentials .

  • Insert the installation DVD and boot from it (press any key at the “Press any key” screen)

Windows Vista Repair Your Computer Menu

Windows Vista Repair Your Computer Menu

Windows Vista System Recovery Options

Windows Vista System Recovery Options

  • Click Command Prompt
  • Type: list partition
  • Type: active

Set partition as active on Windows 7

To set the primary partition to be active on your Windows 7 computer, follow these steps:

If you don’t the original Windows 7 DVD, go to Use diskpart from Easy Recovery Essentials .

  • Insert the Windows 7 DVD
  • Press any key to boot from the DVD

Windows 7 System Recovery Options Screen

Windows 7 System Recovery Options Screen

  • Once in Command Prompt, type these commands and press Enter after each: diskpart list disk
  • Type select disk 0 , where 0 is your computer’s disk that has the partition.
  • Type list partition to have diskpart list all partition on the select disk and hit Enter to run the command
  • Type select partition 1 , where 1 is the number of the partition you want to set as active. Press Enter
  • Type active to mark the partition as active. Press Enter
  • Your partition is now active. Type exit , hit Enter and restart your computer.

Set partition as active on Windows 8

To set a primary partition as active on a Windows 8 system, follow these steps:

If you don’t the original Windows 8 DVD/USB, go to Use diskpart from Easy Recovery Essentials .

  • Insert the Windows 8 or Windows 8.1 USB and boot form the media

Windows 8 Repair Your Computer Menu

Windows 8 Repair Your Computer Menu

  • Click Troubleshoot
  • When at Command Prompt, type these commands: diskpart list disk
  • Type select disk 0 , replace 0 with your computer’s primary disk
  • Type list partition
  • Type select partition 1 , replace 1 with the partition’s letter that you want to set as active
  • Type active
  • You can restart your computer now

More Information

Linked entries, support links.

  • The NeoSmart Support Forums , member-to-member technical support and troubleshooting.
  • Get a discounted price on replacement setup and installation discs: Windows XP , Windows Vista , Windows 7 , Windows 8 .

Applicable Systems

This Windows-related knowledgebase article applies to the following operating systems:

  • Windows XP (all editions)
  • Windows Vista (all editions)
  • Windows 7 (all editions)
  • Windows 8 (all editions)
  • Windows 8.1 (all editions)

Propose an edit

Related Articles

Disable legacy boot mode and enable uefi, how to reinstall windows 10, remove dual boot menu – fix for windows, windows won’t start – guide for windows xp, vista, 7, 8, 10, fix slow boot – guide for windows xp, vista, 7, 8, 10, how to reset pc bios/cmos, new fix boot errors with our recovery disk.

  • Using Windows 10? Download recovery disk for Windows 10 (free)
  • Using Windows 8? Download recovery disk for Windows 8
  • Using Windows 7? Download recovery disk for Windows 7
  • Using Windows Vista? Download recovery disk for Windows Vista

Fix guides for common boot errors

Startup blue screens ✓

Disk corruption ✓

Registry failure ✓

Virus infections ✓

Bootloader issues ✓

And more! ✓

  • Startup Repair Infinite Loop
  • Fix the MBR
  • Your PC needs to be repaired
  • Restore To Factory Settings
  • iPhone 15 Plus vs. Pro Max
  • 3 Key Tech Trends to Watch in 2024

Diskpart Command

Use the 'diskpart' command to manage hard drive partitions

diskpart set active

  • Emporia State University

In This Article

Jump to a Section

  • Availability

Related Commands

The diskpart Command Prompt command is used to create or delete partitions on hard drives .

Diskpart Command Availability

The diskpart command is available from within the Command Prompt in Windows operating systems, including Windows 11, 10, 8, etc.

You can also access this command from the Recovery Console in Windows 2000 and Windows XP.

Managing partitions is also possible without the use of a command from within any version of Windows using the Disk Management tool, or free disk partition software .

Diskpart Command Syntax

diskpart < parameter >

The availability of certain diskpart command switches and other syntax may differ from operating system to operating system. See  How to Read Command Syntax  if you're not sure how to read the syntax as it's described in this table.

Diskpart Command Examples

Here are some examples showing how the diskpart command can be used:

Create 5 GB Partition

In the above example, the diskpart command creates a 5,000 MB partition on the hard drive located at \Device\HardDisk0 .

Delete Partition by Name

For this one, the diskpart command will remove the Partition1 partition located on the hard drive \Device\HardDisk0 .

Delete Partition by Letter

This command will remove the partition currently assigned the drive letter G .

Select a Disk

Finally, in this multipart command, diskpart is being used to select a particular disk, disk 1 in this example, so we can remove the readonly attribute that's been set on it.

The fixboot , fixmbr , and bootcfg commands are often used with the diskpart command.

Get the Latest Tech News Delivered Every Day

  • Fixboot Command (Recovery Console)
  • More Command
  • Rename Command
  • Dir Command
  • Fixmbr Command (Recovery Console)
  • Copy Command
  • Bootcfg Command
  • Format Command
  • AOMEI Partition Assistant Standard Edition v10.3.0 Review
  • Net User Command (Examples, Options, Switches, & More)
  • Del Command
  • How to Remove Write Protection on a Micro SD Card
  • The 34 Best Free Data Destruction Tools of 2024
  • Expand Command
  • Net Send Command
  • 10 Best Free Disk Partition Software Tools

Disk Administration, Partition a disk.

DiskPart can be used to automate disk-related tasks, such as creating volumes or converting disks to dynamic disks. Scripting these tasks is useful if you deploy Windows by using unattended Setup or the Sysprep tool, which do not support creating volumes other than the boot volume.

When using the DiskPart command as a part of a script, we recommend that you complete all of the diskpart operations together as part of a single diskpart script. To run consecutive diskpart scripts, allow at least 15 seconds between each script for a complete shutdown of the previous execution before running the DiskPart command again in successive scripts. Otherwise, the successive scripts might fail. Add a pause between consecutive DiskPart scripts by adding a TIMEOUT /t 15 command to the batch file.

When setting up a new drive, create in this order: Create Partition, Format drive, Assign drive letter.

When selecting a volume or partition, you can use either the number or drive letter or the mount point path.

The Windows GUI interface can also be used to assign a mount-point folder path to a drive. In Disk Manager , right-click the partition or volume, and click Change Drive Letter and Paths , then click Add and then type the path to an empty folder on an NTFS volume.

The Windows Recovery Console , includes a simplified DISKPART command. It only provides functionality for adding and deleting partitions, but not for setting an active partition.

Always back up the hard disk before running DiskPart.

The default SAN policy in Windows Server 2008 / R2 is now VDS_SP_OFFLINE_SHARED for all non boot SAN disks. This means that the disks will be offline at server startup (even if the drive contains a paging file).

This Disk Management error message indicates that the drive is offline:

"the disk is offline because of policy set by an administrator".

Query the current SAN policy to see if it is Offline Shared

DISKPART.EXE DISKPART> san SAN Policy : Offline Shared

To manually bring the disks online: Computer Management ➞ Storage ➞ Disk Management , right-click the disk and choose Online .

If these are not part of a cluster, than an alternative is to make a SAN policy change, select the offline disk, clear its readonly flag and bring it online:

“Divide et impera” ~ Latin saying (Divide and conquer)

Related commands

docs.microsoft.com - Configure UEFI/GPT-Based Hard Drive Partitions using Windows PE and DiskPart. docs.microsoft.com - Configure BIOS/MBR-Based Hard Disk Partitions using Windows PE and DiskPart. FORMAT - Format a disk. FSUTIL - File and Volume utilities. DISKSHADOW - Volume Shadow Copy Service. REAGENTC - Configure Windows Recovery Environment (Windows RE) and System Reset. SYSPREP - (Generalize) a Windows installation. PowerShell equivalents: clear-disk , get-disk, set-partition, get-volume Partition Wizard - GUI Disk Partition Manager. Equivalent bash command (Linux): fdisk - Partition table manipulator for Linux.

OnMSFT.com

Diskpart Commands: How to Manage Hard Drive Partitions in Windows 11/10

Pranav Bhardwaj

August 29, 2023

How to Manage Hard Drive Partitions using Diskpart

Looking for more How To posts? Check out our How To Page for all the latest tips on Windows, Microsoft Teams, LinkedIn, and more!

In this article

Efficient hard drive management is essential for maintaining an organized and optimized computer system. Windows operating systems offer various tools to help users manage their data, and Diskpart is one such powerful utility. Diskpart allows users to manipulate hard drive partitions directly from the command line, providing granular control over disk space allocation.

Whether you want to create, extend, delete, or format partitions, Diskpart offers a command-line-driven approach that’s particularly useful for system administrators and advanced users. This guide delves into the details of using Diskpart to manage hard drive partitions effectively in Windows 11/10.

What is Diskpart?

Diskpart, short for “Disk Partition,” is a command-line utility included in Windows 11/10 that empowers users to manage disks, partitions, and volumes. Unlike graphical interfaces, Diskpart operates solely through text-based commands, offering a powerful way to interact with storage devices. It’s especially valuable for managing partitions in scenarios where the graphical interface might not be accessible, such as during system recovery or maintenance.

Diskpart provides a comprehensive set of commands that enable users to create new partitions, extend existing ones, format partitions with different file systems, and even remove partitions entirely. Its versatility and direct control over disk structures make it a preferred tool for those who require a more hands-on approach to disk management.

Precautions to take while using Diskpart commands

While Diskpart can be a highly effective tool, it’s essential to take precautions before using its commands to avoid unintended data loss or system disruptions. 

Here are some precautions to consider:

  • Backup Your Data : Before performing any disk management operations using Diskpart, create backups of your critical data. Diskpart commands can lead to irreversible changes, and having a backup ensures that you can restore your data if something goes wrong.
  • Double-Check Disk Selection : Make sure you’re selecting the correct disk and partition when applying Diskpart commands. A wrong selection can result in unintended changes to your system.
  • Understand Commands : Familiarize yourself with the specific commands you’re going to use and their implications. Misinterpreting commands can lead to data loss or system instability.
  • Use “List” Commands : Utilize commands like list disk, list partition, and list volume to get a clear view of your disk configuration before making any changes. This helps you verify your selections.
  • Avoid Direct “Clean” Command : Be cautious with the clean command, as it removes all partitions from a selected disk without confirmation. This command can lead to complete data loss if not used carefully.

List of common Diskpart commands

Diskpart commands are the building blocks of disk management. Here’s a list of common commands along with their purposes:

How to launch Diskpart on Windows 11/10

Launching Diskpart is a straightforward process. Here’s how you can do it:

  • Press Windows + R to launch the Run Command box. 

Launch Command Prompt with Admin Rights

  • If prompted by User Account Control, click “Yes” to grant administrative privileges to Diskpart. You’ll now be within the Diskpart environment, ready to execute disk management commands.

Diskpart Commands

How to check existing hard drives, volumes, & partitions using DiskPart

Before making any changes, it’s crucial to understand your disk’s current configuration. Diskpart can help you get this information:

  • Open the Command Prompt and enter diskpart.

List Disk Command

  • Type select disk <number> to choose the disk you want to inspect.
  • Similarly, use the list partition and list volume commands to see the partitions and volumes on the selected disk.

List Partition

How to create a partition using Diskpart

Creating a partition using Diskpart provides you with control over its size, file system, and drive letter assignment. 

Creating a partition using Diskpart involves a few steps. Let’s go through the process:

  • Launch Diskpart as described earlier.
  • To access the disk list, use the list disk command, and then choose the desired disk by entering its corresponding number with the select disk # command, where “ # ” is the disk number.

Ensure You Selected The Right Disk

  • After selecting the disk, use the clean all command to wipe out the disk. (optional step)
  • Once the disk is wiped out, use the create partition primary command to create a partition using the entire space on that drive.
  • If you want to create multiple partitions, you can assign how much space a partition could take. For that, use the create partition primary size=X command, where “ X ” is the size that you wish to set to the partition in megabytes.
  • After creating the partition, format it with a file system using the format fs=<filesystem> quick command. For instance, use the format fs=ntfs quick for NTFS or format fs=fat32 quick for FAT32.
  • Once the formatting process is complete, Diskpart will automatically assign a letter to the partition. In the event that it does not, you can manually set it by using the command assign letter=<letter> . Replace “ <letter> ” with the desired drive letter. 

Create Partition Using Diskpart

How to extend a partition using Diskpart

Extending a partition allows you to combine unallocated space with an existing partition. It’s an excellent way to make efficient use of available space.

Here’s how you can do it:

  • Launch Diskpart using the earlier method.
  • Make sure that there is enough free space adjacent to the partition you plan to extend on the same drive without any partitions in between. Verify the contiguous availability of the free space.
  • Use the list disk command to list all the attached disks on your system. Choose the disk containing the partition you want to extend using the select disk <number> .
  • Next, use the list volume command to get the list of all the volumes under the selected disk.
  • Now, choose the volume that you want to extend using the select volume # command. Insert the volume number in place of “ # ”.
  • Next, use the extend command to add the entire free space to the selected volume. However, if you don’t want to include the entire unallocated space to the selected volume, use the extend size=# , and replace “ # ” with the amount of space you want to extend in megabytes.

Extend The Disk Using Diskpart

How to shrink a volume using Diskpart

Shrinking a volume allows you to reclaim unused space, which can then be used to create new partitions or extend existing ones. Here’s how you can shrink a volume using Diskpart:

  • Launch Diskpart using the previously outlined steps.
  • Type list volume to see a list of all volumes on your system. Note the volume number of the one you want to shrink.
  • Enter select volume <number> to choose the volume you wish to shrink.
  • To initiate the shrinking process, type shrink desired=<size> and press Enter. Replace “ <size> ” with the amount of space you want to shrink the volume by in megabytes.
  • Diskpart will calculate the available space that can be shrunk based on the specified size.
  • Once the process is complete, you can exit Diskpart by typing exit and pressing Enter.

Shrink Volume Using The Diskpart

How to delete a partition using Diskpart

You can easily delete a partition, too, using Diskpart. Removing a partition should be done with caution, as it leads to data loss. Follow these steps:

  • Open the Command Prompt and launch Diskpart.
  • Select the disk containing the partition you want to delete using select disk <number> . If you don’t know the disk number, use the list disk command.
  • Now, use the select partition <number> command to select the partition that you want to delete. Use the list partition command if you don’t know the partition number.
  • After selecting the partition, use the delete partition command to delete it.

Delete A Partition Using Diskpart

Similarly, you can use the delete volume command to delete a partition.

How to completely wipe out the hard disk using DiskPart

If you encounter issues when formatting your system’s hard disk, an external hard drive, or a USB pen drive, you can use DiskPart to wipe them clean. However, please note that you cannot clean the disk on which your operating system is installed.

If you need to wipe out an entire hard disk using Diskpart, follow these steps with caution:

  • Type list disk and note the disk number you want to wipe.
  • Select the disk by typing select disk <number> .
  • Now type the clean all command and press Enter. This command will erase all data on the selected disk. Be patient; depending on the size of your hard disk, it could take even hours to complete this command.

Clean Disk Using Diskpart

Alternatives to Diskpart

While Diskpart is a powerful tool for managing hard drive partitions in Windows 11/10, there are alternative methods and third-party tools available for users who prefer different approaches. Here are a couple of alternatives to consider,

Windows Disk Management

Windows Disk Management

Windows provides a built-in graphical tool called “Disk Management.” To access it, right-click on the “Start” button and select “Disk Management.” This tool offers an intuitive interface where you can perform tasks like creating hard drive partitions , formatting, deleting, and resizing them. While it might not offer the same level of command-driven control as Diskpart, it’s user-friendly and suitable for most basic partition management needs.

Third-Party Partitioning Tools

Several third-party partitioning tools are available that provide advanced features and user-friendly interfaces. Tools like EaseUS Partition Master , MiniTool Partition Wizard , and AOMEI Partition Assistant offer capabilities beyond what Diskpart provides, including visual representations of your disk layout, more flexible partition resizing, and better data protection during operations. These tools can be especially useful for users who prefer not to work with command-line utilities.

Can Diskpart commands be undone?

Unfortunately, Diskpart commands are irreversible and can lead to data loss if executed incorrectly. It’s crucial to double-check your commands and backup your data before making any changes using Diskpart.

Can I use Diskpart on external drives and USB devices?

Yes, Diskpart can be used on internal and external drives, including USB devices. However, exercise caution and make sure you select the correct disk to avoid accidental data loss.

Is it possible to resize volumes using Diskpart?

Yes, resizing the volume is possible using the Diskpart shrink and extend commands.

Manage your system hard drive easily

Effective hard drive management is essential for maintaining a well-organized and optimized computer system. Diskpart provides a versatile and powerful solution for managing hard drive partitions in Windows 11/10. By understanding its commands and following the steps outlined in this guide, you can confidently create, extend, delete, and manage partitions according to your needs. Remember to exercise caution, back up your data, and double-check your actions before executing Diskpart commands. With this knowledge, you’ll be well-equipped to make the most of your disk space while ensuring the safety of your data.

Looking for more? Check out these OnMSFT.com posts on Diskpart .

Voice Access comes to Windows 11 OOBE in recent Insider builds

Microsoft president demands ‘human oversight’ on ai to avert ‘weaponization’.

OnMSFT.com is built on:

Wordpress GeneratePress Azure

Theme thanks to heather.

diskpart set active

Home About Contact Us

Join our team, © copyright 2014 - 2024 onmsft.com llc.

diskpart set active

Top Contributors in Windows 10: Ramesh Srinivasan  -  neilpzz  -  Horace Wiggins  -  franco d'esaro  -  _AW_   ✅

February 14, 2024

Top Contributors in Windows 10:

Ramesh Srinivasan  -  neilpzz  -  Horace Wiggins  -  franco d'esaro  -  _AW_   ✅

  • Search the community and support articles
  • Search Community member

Ask a new question

How do I change system partition to primary over DISKPART?

I had a problem with installing windows 10 on my SSD and this IT expert helped me destroy my SSD by making it system and I don't know how to revert it to primary 

https://blogs.technet.microsoft.com/asiasupp/2012/03/06/error-we-couldnt-create-a-new-partition-or-locate-an-existing-one-for-more-information-see-the-setup-log-files-when-you-try-to-install-windows-8-cp/#comment-35885

It's funny because it is associated with Microsoft 

Can anyone help me what should I do now ? 

I don't have any OS installed i dont have any CD or DVD  I only have one flash with Windows 10 installation, no other devices beside phone 

I don't know what category this belongs 

Report abuse

Replies (8) .

Andre Da Costa

  • Volunteer Moderator

3 people found this reply helpful

Was this reply helpful? Yes No

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

Thanks for your feedback.

SarahKong

  • Independent Advisor

8 people found this reply helpful

I have installed Windows 10 on SSD I did the Diskpart thing Sarah told me ,and then in windows 10 installation I deleted partition SSD had and created a new one and it was primary partition, but now it really worries me that I don't have system or recovery partition like I always used to have, I only have one large primary partition,

Can Windows work like this ?

2 people found this reply helpful

If you system is still booting, you need to provide a snipping tool picture of your Disk Management window.  This utility is listed on the WinKey+X menu.

A "System" partition designation usually means the partition is being used for booting and contains the boot files.

diskpart set active

Disk 2 is SSD, Disk 1 is for my private files, Disk 0 is for Games

Windows is installed on Disk 2 , but I have a System reserved partition on Disk 0 and I don't have System Recovery partition

The System reserved partition is where your boot files are and at one time, you recovery options.

If you want to know for sure, open an admin command prompt and type the command below.  Copy and paste the results.

reagentc /info

The 464 MB partition may have been one created by an upgrade process and may have been your recovery options, but the command should tell you for sure.

1 person found this reply helpful

Question Info

  • Norsk Bokmål
  • Ελληνικά
  • Русский
  • עברית
  • العربية
  • ไทย
  • 한국어
  • 中文(简体)
  • 中文(繁體)
  • 日本語

How to use DiskPart to clean and format drive not working on Windows 10

If a drive is causing problems on Windows 10, it could be a logical issue that can be fixed with a few commands.

DiskPart fix drive on Windows 10

  • Fix MBR drive
  • Fix GPT drive

On Windows 10 , you can use the DiskPart tool to resolve virtually any logical problem with a storage drive, and in this guide, I'll outline the steps that I typically use to fix most issues (such as data corruption or other logical problems) using DiskPart.

DiskPart is a command-line tool to manage drives, partitions, volumes, and virtual disks through Command Prompt. Usually, it works better than other tools like "Disk Management" and the "Format" feature available on File Explorer.

On Windows 10, you can have different partition styles, including Master Boot Record (MBR) and GUID Partition Table (GPT). The MBR is the legacy partition style for the standard Basic Input/Output System (BIOS). The GPT is a newer partition style, usually found in Unified Extensible Firmware Interface (UEFI) computers. The difference between the two is that GPT is meant to replace MBR since it supports more than four partitions, and it's required on drives with more than 2TB of space. You typically want to use GPT, but MBR is also a good option for external storage. These instructions will help you use DiskPart on either partition style.

These steps will erase everything on the selected drive, and you cannot undo the changes. If the drive is still accessible, it's recommended to back up the data before proceeding. If multiple drives are connected to your device, disconnect them to avoid selecting the wrong one.

In this how-to guide , I will walk you through the steps to use DiskPart to clean and format a hard drive to fix data corruption and other problems on Windows 10.

How to fix drive (MBR) problems with DiskPart on Windows 10

To fix drive issues on Windows 10 with DiskPart, use these steps:

  • Open Start .
  • Search for Command Prompt , right-click the top result, and select the Run as administrator option.
  • Type the following command to launch DiskPart and press Enter : diskpart
  • Type the following command to list all the active drives and press Enter : list disk
  • Type the following command to select the drive to clean and press Enter : select disk DISK-NUMBER

In the command, replace "DISK-NUMBER" with the drive number you want to repair as it appears in the "Disk" column. You could erase the wrong drive if you do not perform this step correctly. Proceed with caution.

  • Type the following command to wipe out the drive and press Enter : clean
  • Type the following command to confirm the drive is still selected, and press Enter : list disk
  • Quick note: The output should include an asterisk (*) next to the selected drive. If the correct storage is not specified, perform step 5 again.
  • (Optional) Type the following command to convert the drive to an MBR partition style and press Enter : convert mbr
  • Quick note: This step is only required if the storage is configured as GPT , and you must use MBR partition style. If the partition is already MBR, you don't have to run the command, but running the command won't affect the process. You should be able to determine the partition type with the "list disk" command. If the drive doesn't have a GPT mark (*), it's an MBR partition.
  • Type the following command to create a new partition and press Enter : create partition primary
  • Type the following command to select the new primary partition and press Enter : select partition 1
  • Type the following command to make the partition active and press Enter : active
  • Quick tip: You only have to set a partition as active when using MBR. You can determine if the drive uses an MBR or GPT partition style with the "list disk" command. If the partition has a mark in the GPT column, it's not an MBR partition. If you have to set up a GPT partition style, use the other steps (see below).
  • Type the following command to format the partition using the NTFS file system, set a drive label, and press Enter : format fs=FILE-SYSTEM label=DRIVE-LABEL quick

In the command, replace "FILE-SYSTEM" with the name of the file system to use, such as "NTFS" or "FAT32," and replace "DRIVE-LABEL" with the name of the drive as you want it to appear on File Explorer. The " quick" option isn't required, but it will perform a format faster. However, it's best to skip the option if you are unsure about the drive's condition. The format could take a long time, depending on the hard drive's size. This example formats the drive using the NTFS file system and names the partition "myData": format fs=ntfs label=myData quick

  • Type the following command to assign a letter and make the drive available on File Explorer, and press Enter : assign letter=DRIVE-LETTER

In the command, change "DRIVE-LETTER" for the letter to use on the drive, which is not assigned to another device. This example assigns the "G" letter: assign letter=g

  • Type the following command to terminate DiskPart and press Enter : exit
  • Type the following command to close Command Prompt and press Enter : exit

Once you complete the steps, if the drive does not have physical issues, it should be accessible again through File Explorer.

How to fix drive (GPT) problems with DiskPart on Windows 10

To use DiskPart to fix drive issues with GPT partition style, use these steps:

  • Type the following command to run DiskPart and press Enter : diskpart
  • Type the following command to select the drive you want to clean and press Enter : select disk DISK-NUMBER

In the command, replace "DISK-NUMBER" with the drive number to repair, as it appears in the "Disk" column.

  • Type the following command to confirm the drive is still selected and press Enter : list disk
  • Quick note: The output should include an asterisk (*) next to the selected drive. If the correct storage is not specified, repeat step 5 one more time.
  • Type the following command to convert the partition style to GPT and press Enter : convert gpt
  • Type the following command to format the partition with the NTFS file system, set a drive label, and press Enter : format fs=FILE-SYSTEM label=DRIVE-LABEL quick

In the command, replace "FILE-SYSTEM" with the name of the file system you want to use, such as "NTFS" or "FAT32," and replace "DRIVE-LABEL" with the name of the drive as you want it to appear on File Explorer. The quick option is optional to perform a format faster. However, if you are unsure about the drive's condition, it is best to skip the option. The format could take a long time, depending on the hard drive's size. This example formats the drive using the NTFS file system and names the partition "myData": format fs=ntfs label=myData quick

In the command, change "DRIVE-LETTER" for the letter to use on the drive, which is not assigned to another device. This example sets the "W" letter: assign letter=w

After you complete the steps, the drive should be fixed with a GPT partition style and accessible from File Explorer.

More resources

For more helpful articles, coverage, and answers to common questions about Windows 10 and Windows 11, visit the following resources:

  • Windows 11 on Windows Central — All you need to know
  • Windows 10 on Windows Central — All you need to know

Get the Windows Central Newsletter

All the latest news, reviews, and guides for Windows and Xbox diehards.

Mauro Huculak

Mauro Huculak is technical writer for WindowsCentral.com. His primary focus is to write comprehensive how-tos to help users get the most out of Windows 10 and its many related technologies. He has an IT background with professional certifications from Microsoft, Cisco, and CompTIA, and he's a recognized member of the Microsoft MVP community.

  • 2 Sony is working to bring PlayStation VR2 to Windows PC
  • 3 For less than 50 cents per game, you can grab an Xbox Series S and 3 months of Game Pass Ultimate
  • 4 Microsoft is forcefully auto-upgrading 'eligible' users running older versions of Windows 11 to 23H2 ahead of 'Moment 5'
  • 5 The best Wi-Fi 6 mesh router I've ever tested is discounted to an all-time low, and it STILL powers my home network two years later

diskpart set active

More Recovery Products

  • Partition Manager     Partition Master Personal disk manager   Partition Master Enterprise Business disk optimizer   Edition Comparison Partition Master Versions Comparison   Disk Copy Hard drive cloning utility Partition Master Free Partition Master Pro

Centralized Solutions

MSPs Service

Screen Capture

Video Toolkit

Audio Tools

Transfer Products

File Management

iOS Utilities

More Products

  • Support     Support Center Guides, License, Contact   Download Download installer   Chat Support Chat with a Technician   Pre-Sales Inquiry Chat with a Sales Rep   Premium Service Solve fast and more

How to Use Diskpart to Set Boot Partition in Windows 10 New Guide]

diskpart set active

Sherly updated on Jan 19, 2024 | Home > Computer Instruction

Diskpart, a command-line disc management utility bundled into Windows, allows users to add the active marker to the hard drive partition. Therefore, the following section will cover a manual technique with the help of the software EaseUS Partition Master for Diskpart set boot partition Windows 10. 

Can Diskpart Set Boot Partition in Windows 10

Yes, Diskpart can set the boot partition in Windows 10. A Diskpart command interpreter is a tool that assists you in managing the devices on your computer (disks, partitions, volumes, or virtual hard disks). 

To utilize the Diskpart commands, you must first list the objects on the disc and then select one of those objects to make it the active partition . Any Diskpart commands you type will operate on the currently-focused thing once it has been given the focus. 

However, do you know how to use Diskpart commands to set an active partition? Don't worry. The next section will guide you step-by-step on how to set a bootable partition via Diskpart.

There is a link for you to learn more about an active partition before setting the partition active.

related articles

Is Primary and Active Partition the Same [Beginner's Guide]

An active partition is the partition the computer boots from and starts the operating system. It is possible for a primary partition also to be active, but this is only sometimes the case.

primary partition

Diskpart Set Boot Partition in Windows 10 - [Step-by-Step Guide]

Herein, you will learn how to perform the process to make a hard drive partition bootable in Windows 10, 8, and 7 via the Command Prompt and Diskpart. 

Follow the procedures below to make the partition bootable at the command prompt: 

Step 1.  Right-click the Windows icon, select "Search," and type " command prompt " into the search bar. 

Step 2.  Select "Run as administrator" by right-clicking Command Prompt . 

run cmd as administrator

Step 3.  Type " diskpart " in the Command Prompt and click Enter. 

Step 4.  Type the following command lines in Diskpart and press Enter each time:

  • select disk 0 (Replace 0 with your disc number)
  • list volume
  • select volume 3 (Replace 3 with the volume number of the target partition) 

set active partition

Step 5.  Type exit and click Enter to close the software.

This is a comprehensive guide to setting an active partition using Diskpart's rapid commands. EaseUS Partition Master, on the other hand, can make the partition bootable without requiring any commands.

Alternative to Diskpart Set Boot Partition in Windows 10

You can use EaseUS Partition Master Free as an alternative to Diskpart. It aims to make managing your hard drives less chore. Its "set active" feature can make a partition active without requiring any commands, making it friendly to even beginners. Besides, it supports almost popular Windows versions, like Windows XP/Vista/7/8/10/11. Now, download it and follow the guide below.

 Windows 11/10/8/7  100% Secure

Step 1.  Run EaseUS partition manager software. On the disk map, right-click the target partition and choose "Advanced".

Step 2. Then, select "Set Active" from the drop-down menu. Click "Yes".  And choose "Execute 1 Task(s)" and click "Apply".

Besides, to manage your disk partition well, EaseUS Partition Master has the following features:

  • Hard drive defragmentation
  • Remove active flag from partition
  • Set partition active/inactive effortlessly
  • Clone SD card /hard drive and make it bootable
  • Create/resize/format/erase hard drive partitions without difficulty
  • Change the file system types and set the cluster size, like exFAT allocation unit size

Try the reliable  bootable partition manager  instead of the Diskpart if you're having trouble with it. Just get EaseUS Partition Master now. It is easier to use. Try it now!

In this article, we went through a step-by-step approach that can be used to Diskpart set the boot partition in Windows 10 manually and with the assistance of the software EaseUS Partition Master. This software can make the partition bootable without requiring any commands to be entered by the user. 

By the way, there are some other links related to the active partition you may be concerned about. Click the following links if you are facing similar problems.

Diskpart Set Boot Partition Windows 10 FAQs

If you still have some confusion, you can go through the frequently asked question to avoid confusion. 

1. How to create a boot partition using Diskpart?

Follow these steps, and you can create a boot partition using Diskpart:

Step 1. Search "command prompt" in the search box and run it as administrator.

Step 2. Then type diskpart and press the Enter key.

Step 3. Type these commands below, and press Enter each time:

  • select disk 1 (Replace 1 with the correct disk number)
  • select volume 1 (Replace 1 with the correct partition number)

2. How do I change the boot drive?

You can turn to EaseUS Partition Master. It is a trustworthy utility to change the boot drive. Follow the steps here:

Step 1. Launch EaseUS Partition Master on your PC.

Step 2. Right-click on the new boot partition and choose "Advanced."

Step 3. Click "Set active."

3. Should I use GPT or MBR for the boot drive?

It depends on the partition numbers and the OS requirements. GPT allows users to have up to 128 primary partitions, while MBR can only create 4 primary partitions. Besides, you can't use MBR as the primary disk in Windows 11.

Was This Page Helpful?

diskpart set active

Updated by Sherly 

Sherly joined EaseUS in 2022 and she has always loved writing articles and enjoys the fun they bring. She receives professional training here, focusing on product performance and other relative knowledge. She has written over 200 articles to help people overcome computing issues.

Read full bio

Related Articles

How to Fix Outlook Rules Not Working [8 Ways Included]

author icon

[PS4 USB Format] How to Format USB for PS4

author icon

How to Use CMD Delete File/Folder [Windows 11 Applicable]

author icon

Will System Recovery Delete My Files? Answered Here!

author icon

EaseUS Data Recovery Services

Request a free evaluation >>

EaseUS data recovery experts have uneaqualed expertise to repair disks/systems and salvage data from all devices like RAID, HDD, SSD, USB, etc.

diskpart set active

Copyright ©   EaseUS. All rights reserved.

AOMEI Partition Assistant Help Guides

Refer to the following help documents to better make use of AOMEI Partition Assistant for overall data protection. Contact us if you have any further question via [email protected]

  • Overview of AOMEI Partition Assistant
  • Install and Uninstall
  • Change Language
  • Extend Partition Wizard
  • Resize Partition
  • Move Partition
  • Merge Partitions
  • Split Partition
  • Allocate Free Space
  • Copy Hard Disk
  • Copy Partition
  • Copy with Sector by Sector
  • Partition Recovery
  • Partition via Command Line
  • Quick Partition
  • Create Partition
  • Delete Partition
  • Format Partition
  • Check Errors
  • Change Drive Letter
  • Partition Properties
  • Check Bad Sector
  • Delete all Partitions
  • Rebuild MBR
  • Initialize Disk
  • Disk Properties
  • Convert Dynamic Disk to Basic
  • convert disk between MBR and GPT
  • Convert FAT/FAT32 to NTFS
  • Convert NTFS to FAT32
  • Convert Primary to Logical Partition
  • Convert Logical to Primary Partition
  • Windows 10/8 To Go Creator
  • Migrate OS to SSD Wizard
  • Make Bootable CD Wizard
  • Disk & Partition Copy Wizard
  • Wipe Hard Disk
  • Wipe Partition
  • Hide/Unhide Partition
  • Set Active Partition
  • Change Partition Type ID
  • Change Serial Number
  • Burn AOMEI Bootable ISO File
  • Windows AIK Download
  • Windows ADK Download
  • Before repartition
  • How to extend partition
  • What type is your disk storage
  • What is Partition Assistant Main Console
  • What is Partition Assistant PreOS Mode?
  • More Knowlege
  • General FAQ
  • Partition Assistant Error Codes
  • Partition Assistant >
  • Help Documents >

Set Active Partition- Partition Assistant Help

Typically, your disk always has only active partition. A Windows operating system need to be booted from the active partition.

AOMEI

Overview of set active partition

Before you do, how to set active partition.

Set Active Partition

  • You can't make a logical drive or an extended partition active. Only a primary partition can be set as active.
  • Your computer can only boot from the main partition which is set active, and there can be only one active partition per physical hard disk drive.

System Requirements for Cleanroom Recovery

Verify that the Commvault software meets the following system requirements for recovering entities using the Cleanroom recovery operation.

Commvault Software

Use a storage target with Air Gap Protect using Hot and Cool tiers.

For more information, see Air Gap Protect .

Verify that local users are not associated to the Active Directory.

Verify that your CommServe DR set is uploaded daily to Commvault Cloud .

Before you back up source VMs, consider the following:

Verify that the Remote Desktop Protocol (RDP) is enabled on the source VM. For Linux, ensure that SSH is also enabled.

For Linux VMs, if you want to automatically power on the source VMs after the conversion, enable integration services on the source VMs.

For Windows VMs, to enable disks to be brought online as part of the conversion, enable a SAN policy for the source VM.

Open a command line or PowerShell session locally on the VM.

Open the disk partition tool:

Verify that the SAN policy is set to Offline Shared:

Change the policy to OnlineAll:

Recommendation

To minimize insider thread, it is recommended to enable multi-person authorization.

For more information, see Multi-Person Authorization to Minimize Insider Threat .

  • Azure Cleanroom Recovery Site

Verify the following for the Azure VM name:

Does not contain special characters and whitespaces.

Does not begin with '_' and end with '.' and '-'.

Verify that the Cleanroom recovery site is isolated from the production site.

Verify that the source entities that you want to recover are supported by Azure.

Get the Azure subscription and tenant that has never been accessed by production accounts or connections.

Create a resource group and a storage account to hold all the recovered resources in the Azure Cleanroom recovery site.

Verify that the identity management such as AD is configured in the Cleanroom site.

Verify that the following network resources are already configured to prevent outbound communication: Gateway, IPv4/IPv6 ranges defined, DNS, firewall policies, DNS updates, TTL, public and private IP registration, and network encapsulation .

Set up IAM to access Azure resources.

If your source data is encrypted, you need to have the key management service and encryption key configured in the Azure Cleanroom recovery site. Also, the key management service is added in Commvault. For more information, see Managing a Key Management Server

Verify that the region, availability zone, and VM sizes are compatible with each operating system.

For more information, see the following:

Virtual Machines (VMs) on Linux

Microsoft server software support for Azure virtual machines

Azure product availability by region

Get Azure Standard or Azure Premium general-purpose storage accounts for auto VM conversion to Azure.

Before you recover Red Hat Linux VMs to Azure Cleanroom target, add required Hyper-V drivers to the VMs and perform a new backup of the VMs. For more information, see Troubleshooting .

  • ${{ productname }} Software

diskpart set active

Stack Exchange Network

Stack Exchange network consists of 183 Q&A communities including Stack Overflow , the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

How is the "active partition" determined when using GPT?

According to https://superuser.com/a/1081043/380318 there is no such concept as an "active partition" when using GPT.

AFAIK with MBR partitioning, some minimal code in the MBR looks for an "active partition" and executes some boot code in that partition.

When GPT does no longer have that concept of an "active partition", how is the operating system to boot determined then?

After some OS patch update the system didn't boot with message "no operating system found", and I had to reinstall the boot loader. So I'm wondering what might have damaged the boot mechanism for that message to appear.

Maybe I should add that the machine was running under VMware, and I'm not administrator of the VMware configuration. Possibly some "BIOS update" in VMware might have caused the problem, but it only came apparent when the OS was rebooted.

I can't change the setting, but I looked up that the firmware start option is set to "BIOS (recommended)".

The bootloader in effect is GRUB2, and when the system boots I see to partitions on sda , but none of them having the "active flag":

  • "BIOS boot" (8MB)
  • "Linux filesystem" (24G)

Maybe these facts make the situation even more complex:

There are two unpartitioned "raw" disks, and there is a bootable medium (DVD image) currently attached that has a MBR label, an EFI (type 0xef) partition and a hidden (type 0x17) partition that is marked active .

Possibly at the time of boot failure that image was not connected.

U. Windl's user avatar

  • 1 en.wikipedia.org/wiki/EFI_system_partition –  Kamil Maciorowski Mar 1, 2023 at 7:30
  • So you think the EFI partition had vanished when "no operating system found"? I doubt that. –  U. Windl Mar 1, 2023 at 7:34
  • 1 This I did not say. The question is "how is the operating system to boot determined then?", the linked answer states that "the firmware itself keeps a list of boot entries corresponding to files in the EFI system partition, and integrates them into the regular 'select boot disk' menu" and the Wiki states that "an ESP contains the boot loaders or kernel images for all installed operating systems […]". It looks to me the ESP is kinda like an active partition, but I don't know the details and therefore it's just a comment. –  Kamil Maciorowski Mar 1, 2023 at 7:41
  • the ESP can still be there but there aren't any *.efi executable files for booting. Those are the actual "bootloader" in UEFI –  phuclv Mar 1, 2023 at 7:55

2 Answers 2

It depends:

For pure EFI boot, the firmware NVRAM holds "boot entries" that directly point to a specific partition by its GPT PARTUUID, and to a specific file within that partition. Run efibootmgr (with the -v option on older versions) to see the currently stored NVRAM entries.

This is stored entirely in NVRAM, not on the disk itself – all boot entries disappear when the firmware settings are reset, or when the NVRAM ("CMOS") is cleared for some reason, and sometimes the firmware will remove "stale" boot entries if it can't find the corresponding partition (e.g. due to the disk being temporarily removed).

(Multiple boot entries can be "active" at once (including multiple files within the same partition); most EFI implementations offer a menu to choose from them like you would choose from bootable disks. See section 3 of the specification.)

For EFI boot from removable disks (or in situations where the NVRAM has no working boot entries), the firmware scans all partitions for a filesystem that it recognizes, then tries to boot a file from the fixed path \EFI\Boot\Boot<arch>.efi (e.g. BootX64.efi ); see table .

This process always uses the first partition that has such a file. The partition's "type GUID" doesn't necessarily affect the process – firmware may scan all partitions regardless of type. (For removable disks, though, the specification actually requires exactly one EFI partition.) It is probably safe to assume that the firmware will scan in partition-table order and will stop looking after the first match.

While some operating systems install a copy of the bootloader at this location – allowing EFI boot to continue working in case the NVRAM boot entries disappear – not all of them do. For example, GRUB2 does not install itself at bootx64.efi unless specifically told to treat the disk as --removable .

In BIOS boot mode, even if the disk is GPT-partitioned, the initial boot code still lives at the same location in the "protective MBR" and still proceeds in the same way as with pure MBR disks:

For BIOS-style boot from a GPT disk using Syslinux, the Syslinux "GPT compatible" MBR uses a mechanism identical to the active bit. Each partition in GPT has 64 flag bits (0–63) associated with it; bit 2 is what Syslinux uses as the "Legacy BIOS bootable" flag.

You can set the GPT partition attributes through gdisk "extra functionality" menu.

For BIOS-style boot from a GPT disk using GRUB… well, GRUB never cared about "active" partitions or their VBRs to begin with – its MBR instead loads the GRUB kernel from a hard-coded start location (which is written to the MBR at grub-install time).

On GPT disks, the GRUB kernel is installed to a partition with a special type GUID (rather than being stashed in-between partitions), but only grub-install cares about this – the GRUB MBR still loads the kernel from a fixed LBA.

It is also possible to have a "hybrid" disk which is normally GPT-partitioned, but its protective MBR has an actual partition entry with the "active" flag pointing at the desired location (instead of the usual protective entry covering the whole disk), allowing GPT-unaware boot sectors to boot from a GPT disk.

u1686_grawity's user avatar

The concept of an "active partition" means that a partition is selected from which the boot loader is read. If there are multiple OS installations, their respective boot loaders will be installed in their respective partitions, so the partition table is used to allow co-installation.

With EFI, the boot loader is a file inside an FAT file system, and co-installation is managed by reserving space in the FAT. This removes the size limit for the boot loader and allows more sophisticated methods of looking for the next stage files, so the "active partition" mechanism is no longer needed.

Basically, this has always been a crutch, because the partition boot loader only has a few hundred bytes of code, and needs to reliably select the correct partition to continue from, even if there are multiple valid candidates, so the MBR loader that selects a partition to boot from will pass down this information.

Modern systems often have additional layers like encryption, redundancy and volume management between the harddisk and the actual file system, so it is quite likely that the early boot stages are completely unaware of where the next stage actually is, so instead of a single flag attached to a partition, there is now a command line given to the boot loader, and the option to load a configuration file from the ESP.

Switching between multiple bootloaders is the task of the BIOS, which keeps a list of boot menu entries in NVRAM. Only the bootx86.efi or bootx64.efi file can be used without registration, this is how removable media boot.

Simon Richter's user avatar

  • Maybe should explain one more thing: If there are multiple "EFI bootloader files", is there another EFI file that describes which of the bootloaders to use, or is it "in BIOS" (some NVRAM)? –  U. Windl Mar 2, 2023 at 13:57
  • That is in NVRAM. Only bootx86.efi or bootx64.efi is used without an NVRAM entry. –  Simon Richter Mar 2, 2023 at 14:17
  • I meant you should add it to your answer, so I can upvote it ;-) –  U. Windl Mar 2, 2023 at 14:17

You must log in to answer this question.

Not the answer you're looking for browse other questions tagged boot vmware gpt ..

  • The Overflow Blog
  • Who owns this tool? You need a software component catalog
  • Down the rabbit hole in the Stack Exchange network
  • Featured on Meta
  • Upcoming privacy updates: removal of the Activity data section and Google...
  • Changing how community leadership works on Stack Exchange: a proposal and...

Hot Network Questions

  • Can someone explain this choice of word?
  • How to curve text in QGIS layouts
  • Are views logically redundant?
  • If the Good Samaritan represents Jesus as many Church Fathers claimed, what does Luke 10:35 mean?
  • Is there any performance penalty to unsigned integer underflow?
  • Let f be an infinitely differentiable function such that f(1) = 0, f(5) = ln 4, f'(1) = 2 and f'(5) = −2. Using the given equation(below),Find f(x).
  • Can I raise my ceiling in my shed?
  • How do airlines make money or get some other kind of advantage when I book a flight using miles not earned from flying?
  • What film had an amnesiac time-travelling android from the future who became Jesus?
  • Can AI win against humans in competitive multiplayer computer games
  • How to efficiently transport troops from orbit
  • Simplify one-time switch made using a flip flop?
  • Why can't I connect my ground
  • Pasta Bar for 250 people
  • What happens when the runway is unusable at an isolated aerodrome?
  • If the average of a sequence converges, can I find a uniform bound that does not depend on where I start?
  • intersection of an infinite number of set interiors vs interior of intersection of infinite number of sets
  • Is there a name for the widespread logical fallacy in which you prove your point by 'eliminating' anyone who contradicts you?
  • Where are the DCC acronyms (such as HD and CL) stated and explained?
  • How do I write a sexist narrator without coming off as sexist myself?
  • How not to sound midi without real instrument?
  • When updating a package version, what should the license year be?
  • Do you say "give a sociable compliment" when you mean you give a compliment as a way to socialize with people but it's not a true praise?
  • What's the phrase "10 years" used for in the sentence "I'm 10 years your senior"

diskpart set active

IMAGES

  1. How to use diskpart cmd to set active partition in Windows 7

    diskpart set active

  2. diskpart set boot partition windows 10 Archives

    diskpart set active

  3. How to Set Active Partition in Diskpart Command Line

    diskpart set active

  4. How to use diskpart cmd to set active partition in Windows 7

    diskpart set active

  5. How to Set an Active Partition on Windows in 3 Ways

    diskpart set active

  6. How to Set or Mark a Partition as Active in Windows

    diskpart set active

VIDEO

  1. How To Format A Drive With Diskpart!

  2. CLEAR OR SET READ ONLY FLAG ON DISK IN WINDOWS USING DISKPART

  3. How to partition disk: simplified with command prompt

  4. format a pendrive using diskpart

  5. set readonly on your USB Drive in Windows 11

  6. Активный раздел жесткого диска как сделать Windows 11

COMMENTS

  1. How to Set Active Partition in Diskpart Command Line

    1. press WIN+R to open RUN box, type diskpart 2. in the opened window type list disk 3. diskpart will list all the disks you have installed, type select disk ### 4. type list partition 5. type select partition ### 6. type active Now you set this partition active, when you reboot, you can switch to another Windows system.

  2. [How to] Make partition Active or Inactive using DISKPART › Knowledge Base

    The system will boot from the partition only if it has Active flag set. To make partition Active: Run Command Prompt as Administrator; Type: diskpart. Type: list disk. Remember the desired disk number; Type: select disk # where # is the desired disk number; Type: list partition. Remember the desired partition number; Type: select partition ...

  3. diskpart

    After an object has focus, any diskpart commands that you type will act on that object. Determine focus. When you select an object, the focus remains on that object until you select a different object. For example, if the focus is set on disk 0 and you select volume 8 on disk 2, the focus shifts from disk 0 to disk 2, volume 8.

  4. How to Mark Partition as Active or Inactive in Windows

    1.The Definition of Hard Disk Active Partition Active partition is computer boot partition. And the startup files of operating system are installed in this partition. Partition C: in Windows systems is usually set as active partition by default while active partition in Linux is set according to specific setting.

  5. How to set a partition as active

    Click Administrative Tools Double-click Computer Management Click Disk Management under the Storage tab from the left Select Disk Management from Storage Right-click on the partition you want to set as partition and click Mark Partition as Active Click Yes Use diskpart from Easy Recovery Essentials

  6. How to Set an Active Partition on Windows in 3 Ways

    Method #1: Set Active Partition with Diskpart Command Line This method is often used when you have multiple systems in one disk, you can set active partition in Windows 2008, in Windows 2003, and the latest Windows 10, by setting one partition active is to make this partition bootable, at the meantime, you set other partition not active.

  7. Diskpart Command (Examples, Options, Switches & More)

    The diskpart command is used to add and delete hard drive partitions. Here's more on this command, including examples of how to use diskpart in Windows. ... active: Marks the disk's partition with focus, as active. add: Creates a new partition on the specified hard drive. assign: ... set id: Changes the partition type field for the partition ...

  8. How to use DISKPART commands in Windows 11/10

    Open Diskpart command in the Command Prompt. Type list disk and press Enter. Select the Disk you want to clean using select disk <no>. Type clean, and press the Enter key. Make sure not to use the ...

  9. DiskPart

    Only partitions can be marked as active. A partition must be selected for this operation to succeed. Use the select partition command to select a partition and shift the focus to it. ADD disk= n [align= n] [wait] [ noerr ] Mirror the simple volume with focus to the specified disk.

  10. Diskpart Commands: How to Manage Hard Drive Partitions in Windows 11/10

    Press Windows + R to launch the Run Command box. Type " cmd " and press Shift+Enter to open the Command Prompt with admin rights. In the Command Prompt, type diskpart and press Enter. This ...

  11. How do I change system partition to primary over DISKPART?

    How to: Perform a clean install of Windows 10 http://answers.microsoft.com/en-us/insider/wiki... Review the following guide for instructions and details about configuring your BIOS or UEFI boot settings for DVD, CD, USB or SD Card. a BIOS/UEFI Setup Guide: Boot from a CD, DVD, USB Drive or SD Card https://www.groovypost.com/howto/bios-uefi-setu...

  12. windows

    4 Answers Sorted by: 25 +100 Only way I know how to do this is close to what @Maximus put but do the following: diskpart.exe select volume 1 detail partition The output will indicate Active: Yes/No For example: You have to go through each volume to find which ones are Active and which ones are not.

  13. How to use DiskPart to clean and format drive not working on Windows 10

    To fix drive issues on Windows 10 with DiskPart, use these steps: Open Start. Search for Command Prompt, right-click the top result, and select the Run as administrator option. Type the following ...

  14. How to Use Diskpart to Set Boot Partition in Windows 10 New Guide]

    Step 1. Right-click the Windows icon, select "Search," and type " command prompt " into the search bar. Step 2. Select "Run as administrator" by right-clicking Command Prompt . Step 3. Type " diskpart " in the Command Prompt and click Enter. Step 4. Type the following command lines in Diskpart and press Enter each time: list disk

  15. Create disk partitions in Windows using diskpart command

    2. Now type diskpart on the command prompt. If you're running Windows server, you can just run Powershell then launch diskpart on the cli. diskpart 3. List available disk drives using the command below: list disk 4. Now select the drive you want to partition using select disk command.

  16. Set Active Partition- Partition Assistant Help

    How to set active partition. 1. Launch AOMEI Partition Assistant. Right-click on the partition you want to mark as active and select "Advanced" -> "Set Active Partition" . 2. A reminderwill be presented in the main window. Click "OK". 3. Click "Apply" to open the pending operations as shown in the screenshot below.

  17. DISKPART

    3.3) Type diskpart and press Enter to launch Windows Disk Partition Utility DISKPART, type list disk and press Enter to list available disks, type list vol and press Enter to list available volumes, type exit and press Enter to exit DISKPART (commands highlighted with yellow in screenshot in next step) 3.4) Note the disk number for Windows ...

  18. What happens when I mark a partition as active?

    4 Answers Sorted by: 8 The partition that has Windows on it is already marked active. If you mark another partition active, it will mark all other partitions as not active. If you reboot your computer with the Windows partition mark not active, it will not boot into Windows; it will probably say OS not found.

  19. System Requirements for Cleanroom Recovery

    Open a command line or PowerShell session locally on the VM. Open the disk partition tool: C:> diskpart. Verify that the SAN policy is set to Offline Shared: DISKPART> SAN SAN Policy : Offline Shared. Change the policy to OnlineAll: DISKPART> SAN POLICY=OnlineAll.

  20. Announcing Windows Server Preview Build 26063

    Download Windows Server Insider Preview (microsoft.com) [NEW] VMs created using ISO media may not boot: Some users may encounter boot issues when creating Gen 2 VMs using this build (26063) and attempting to set the DVD ISO as boot preference. The new VM is unable to boot through the ISO and skips to subsequent boot options.

  21. How is the "active partition" determined when using GPT?

    0. The concept of an "active partition" means that a partition is selected from which the boot loader is read. If there are multiple OS installations, their respective boot loaders will be installed in their respective partitions, so the partition table is used to allow co-installation. With EFI, the boot loader is a file inside an FAT file ...