How to create a partition on a USB using command prompt?

A partition is a section of a physical storage device that is separated from other sections. Creating partitions on a USB drive allows you to logically divide the storage space into different sections that can be used for different purposes. For example, you may want to create separate partitions for storing operating system files, applications, documents, media files, backups, etc. Partitioning a USB drive provides a few key advantages:

  – Improved organization and easier file management by grouping similar types of files [1]
  – Isolation of data so if one partition gets corrupted, the others are unaffected [2]
  – Ability to use different file systems on each partition (e.g. NTFS, exFAT, FAT32) [1]

This guide will walk through how to use the command prompt in Windows to create a new partition on a USB drive.

Prerequisites

To use the diskpart command on a Windows computer, you need to have administrative access. This is because diskpart allows you to make changes to disks and partitions, which requires elevated permissions. Without admin access, you’ll see an “Administrative access required for diskpart” error message.

To gain admin access on a Windows computer, your user account needs to be a member of the Administrators group. You can check if your account has admin rights by going to Settings > Accounts > Family & other users. If your account type is listed as “Administrator” then you have the necessary access.

If your standard user account doesn’t have admin privileges, you’ll need to enter the credentials of an admin account when prompted by User Account Control to use diskpart. Alternatively, you can open Command Prompt as an admin by right-clicking it in the start menu and selecting “Run as administrator.”

Overall, having administrative permissions is crucial for using diskpart and making substantial changes to disks and volumes. Without it, diskpart commands will fail with an access denied error. Just be sure you understand the risks before using diskpart’s powerful capabilities.

Back Up USB Drive

It is critically important to back up the data on your USB drive before partitioning it. As explained by [How to Partition External Hard Drives: A Guide to How & Why](https://drivesaversdatarecovery.com/how-to-partition-external-hard-drives-what-you-need-to-know/), even though partitioning does not usually cause data loss, backing up your drive protects you in case anything goes wrong during the partitioning process. Losing the data on your USB drive can be devastating, so taking the time to properly back up your data first provides an essential safeguard.

Backing up does not format or erase the contents of the drive itself. As this [Quora thread](https://www.quora.com/Does-backing-up-system-on-laptop-to-flash-drive-formats-the-USB-into-only-the-size-it-backed-up) explains, formatting and backing up are two separate processes. Formatting prepares the drive to store new data, while backing up copies the existing data over to a second location.

So before partitioning your USB drive, be absolutely sure to properly back up all of the important files and folders you want to keep. This will allow you to safely partition without risking permanent data loss.

Open Command Prompt

The first step to partitioning a USB drive using the command prompt is to open the Command Prompt application. There are a few different ways to open Command Prompt on Windows 10 and 11:

From the Start menu, type “cmd” in the search box and select the “Command Prompt” app to open it. Alternatively, press Windows key + R to open the Run dialog box, type “cmd” and hit Enter (Source 1).

You can also access Command Prompt from the Power User menu. Click Start, expand the “Windows System” folder and select “Command Prompt” (Source 2).

Once open, you’ll see a blank Command Prompt window ready for inputting commands.

List Disks

The first step is to view the available disks on your system using the list disk command in diskpart. According to Microsoft documentation, “The list disk command displays all disks on the computer” (Microsoft, 2023). This will show the disks with their disk number, which you will need to identify the USB drive you want to partition.

To use the list disk command, first open the Command Prompt. Then type “diskpart” and press Enter to launch the diskpart utility. Finally, type “list disk” and it will display the information about your disks (Seagate, 2023). The disk number for your USB drive is typically the highest numbered disk.

For example, your USB drive may show up as “Disk 5” in the list. The list disk command lets you clearly identify which disk number belongs to your USB drive before proceeding.

Select Disk

Once the list of disks is displayed in the command prompt, you need to identify and select the USB drive disk that you want to partition. The disk number will be displayed for each disk. Typically, USB drives will be listed with higher disk numbers like Disk 2, Disk 3 etc. Identify your USB drive disk number from the list and run the command “select disk ” to select it. For example, if your USB drive shows up as Disk 2, you would run select disk 2. This will shift focus to the selected USB disk drive for the next steps.

According to the Microsoft documentation on select partition, this command selects the specified disk and shifts focus to it for subsequent diskpart commands.

Clean Disk

The clean command in diskpart is used to completely overwrite and erase all data on the selected disk. This removes all existing partitions, volumes, files and folders. According to the Microsoft documentation, “This command removes any and all partition or volume formatting from the disk with focus.”

To use the clean command, first list the available disks using the list disk command. Then select the disk you want to clean using the select disk # command, replacing # with the disk number. Finally, type “clean” and hit enter to initiate the cleaning process. The command will completely wipe the drive, so be certain you have the correct disk selected.

As noted in the Seagate knowledge base article, “The drive’s partition, data, and signature is now removed. You will return to the diskpart prompt. Warning: Clean will delete all data on the drive.” It is an irreversible process, so double check you have backups before proceeding.

The clean command is more thorough than clean all, which only deletes partition information. To fully overwrite all sectors and make data recovery impossible, use the clean command.

Sources:

https://www.seagate.com/support/kb/how-to-diskpart-eraseclean-a-drive-through-the-command-prompt-005929en/

https://www.buffalotech.com/knowledge-base/cleaning-a-disk-in-windows-7-using-diskpart

Create Partition

To create a new primary partition, use the create partition primary command in Diskpart. This will carve out space from the unallocated space on the disk to create a new partition. For example:

create partition primary size=1024

This will create a 1024 MB primary partition on the selected disk. You can specify the size in MB or GB. The partition will be created from the available unallocated space on the disk.

According to the Microsoft documentation, “This command creates a primary partition on the basic disk with focus. After creating the partition, the focus automatically shifts to it.”1

So after creating the primary partition, you can proceed to format it without having to select it explicitly. The focus will already be set on the newly created partition.

Format Partition

Once the partition has been created on the USB drive, the next step is to format it. Formatting sets up a file system on the partition so that you can store files on it. For USB drives, it is recommended to use the NTFS (NT File System) file system.

To format the partition with NTFS, right-click on the partition you created and select “Format”. In the format dialog, choose “NTFS” from the “File system” drop down menu. Leave the other options as default.

According to NTFS.com, NTFS is the preferred file system for USB drives because it is more modern and has better performance compared to the older FAT32 file system. NTFS also supports larger partition sizes and file sizes.

Once you click “OK”, Windows will quickly format the partition. After it finishes, the partition will be ready to use as a NTFS formatted USB drive.

Assign Letter

After the partition is formatted, the next step is to assign a letter to it so that it can be accessed as a drive. To do this, go back to Disk Management and right-click the new partition. Select “Change Drive Letter and Paths”.

In the Change Drive Letter and Paths window, click “Add”. Select a letter for the partition from the dropdown. Make sure to pick a letter that is not already in use. Click “OK” to assign the drive letter.

Once a letter is assigned, the partition will show up as a drive in File Explorer. You can now copy files to it and access it just like any other drive on your computer. Refer to this Microsoft article for more details on changing or adding a drive letter in Disk Management.

Leave a Comment