• Windows Server OS and management

diskpart change partition size

.shock - Fotolia

Using Diskpart to create, delete, clean or extend disk partitions

The diskpart is one of the oldest tools in the Windows operating system that handles a wide range of disk management jobs, such as assigning drive letters and deleting partitions.

For basic disk operations on Windows systems, administrators can use diskpart , a command-line utility that remains useful for many different drive-related jobs more than 20 years after it was released.

Microsoft included the free disk management tool in Windows starting in 1999 with the Windows 2000 operating system. Diskpart scans for newly added disks, but it can also create, delete and resize drive partitions , and assign or reassign drive letters. Diskpart also works with drive volumes, virtual hard disks and removable media such as USB flash drives.

Microsoft continues to develop diskpart, and the latest version of the utility features 38 commands. To use diskpart, you list the objects, such as disks or partitions, and then select the object to change it.

diskpart commands

Using diskpart requires understanding data storage terminology

Diskpart use requires a basic understanding of Windows disk terminology . A basic disk is a storage device, such as hard drives, solid-state drives and USB flash drives, which you format with a Windows file system .

A basic disk can hold one or several partitions. A partition is a logical structure confined to a single disk.

A volume is a construct of the operating system that consists of one or more partitions that can span one or more disks.

Using diskpart

You should be careful when using diskpart because there is no undo function if you select the wrong object. Also, once a command is entered, even a destructive one, diskpart does not ask for confirmation before it runs. For example, if you perform an errant diskpart delete partition operation, you must use another utility, such as third-party disk management program, to recover the data or use a backup image to restore the drive.

Follow these tips to avoid issues when using diskpart:

Creating a partition using diskpart

Using diskpart to partition your disk can help increase the I/O performance of hard disks newly added to a RAID array . The documentation for many server applications, such as Exchange Server, recommends using diskpart to create the primary or extended partitions. You can use a primary partition as the system partition; you can only use an extended partition for additional logical drive assignments.

The diskpart create command makes disk partitions, volumes on a single disk or multiple disks, and virtual hard disks.

For this and all following commands, you need to open the command prompt before you run diskpart. Type cmd from the run command window from the Windows search box or the run command dialog box that you open with the Windows+R key combination.

To create a partition:

diskpart create partition

Extending a partition using diskpart

When it comes to adding space to a partition or volume, this method is superior to configuring two disks. Dynamic disk extensions only concatenate the newly added space, meaning they merely add the disk space to the end of the original partition without restriping the data.

Concatenation isolates performance within each partition and does not offer fault tolerance when the partition is configured in a RAID array. Diskpart restripes your existing data. This is beneficial when the partition is set up in a RAID array, because the existing partition data spreads across all the drives in the array, rather than just adding new space to the end, like the Disk Management utility.

To extend a partition:

diskpart extend partition

Deleting a partition using diskpart

The delete command in diskpart removes dynamic disks, partitions, volumes and shadow copies. When you have multiple volumes on the disk or an unwanted partition, such as a recovery partition , this command will remove them and return them to unallocated space.

To delete a partition:

diskpart extend partition

Creating a volume using diskpart

When using dynamic disks in Windows, you can create four volume types with diskpart: volume mirror, RAID-5 volume , simple volume and striped volume.

To create a simple volume :

Cleaning a disk using diskpart

When you have an entire disk to wipe clean, you can use the diskpart clean command to convert all the stored data into unallocated space. This operation deletes all data on the disk by writing zeros on each disk sector. Diskpart also removes all partition and volume information from the selected drive.

To clean a disk :

Other ways to use diskpart

For maintenance work that requires a bootable USB flash drive, you can use diskpart to format the partition and set up the file system on the removable drive. Administrators can also use diskpart in both the Windows Preinstallation Environment and Windows Recovery Environment to correct disk problems or set up the machine for deployment.

With the diskpart /s switch, administrators can run scripts to automate tasks associated with setting up Windows machines, such as configuring the disks for multiple systems, adding a recovery partition or wiping all data from a disk to return it to a factory state.

Sample code from the Microsoft site gives examples of how to develop a text-based script file administrators can call from diskpart and run automatically. IT workers can run several diskpart scripts, but Microsoft recommends building in a delay of 15 seconds after a script runs to prevent issues.

For an in-depth tutorial on how to use diskpart for preparing a Windows 10 system for deployment, this blog post on the SearchEnterpriseDesktop site provides detailed instructions to use diskpart with a script .

Dig Deeper on Windows Server OS and management

diskpart change partition size

diskpart (Disk Partition Utility)

AndrewZola

How to create a custom ISO for Windows 10

KariFinn

Windows 10 disk management terms and tasks IT should know

GaryOlsen

Delete the Windows recovery partition on a Lenovo Thinkpad or Desktop

CameronMcKenzie

Part of: Windows disk and file server management tips for admins

Learn how to generate a detailed report that uncovers unusual activity by users on a Windows file share without having to manually investigate every file and folder.

Microsoft's Azure Files offering alleviates traditional support efforts and hardware costs. Using this additional service can improve performance and keep end users happy.

Learn how to use the clustering tools provided by the Microsoft server OS to create a highly available file server to avoid downtime if disaster strikes.

A file server deployment must satisfy the needs of both the end user and the IT staff. Tune up Windows Server for a secure and performant repository for your critical data.

Many organizations still need a file server, but some of the advantages of Microsoft's cloud storage option might persuade companies to make the switch.

Azure management groups, subscriptions, resource groups and resources are not mutually exclusive. Businesses can -- and often do ...

Amazon CodeGuru reviews code and suggests improvements to users looking to make their code more efficient as well as optimize ...

Establishing sound multi-cloud governance practices can mitigate challenges and enforce security. Review best practices and tools...

Mobile device management tools offer several benefits, like improved productivity and enhanced security, to organizations that ...

Organizations should consider whether an on-premises or cloud MDM or UEM platform is best. Determine how to make the decision and...

IT should understand the differences between UEM, EMM and MDM tools so they can choose the right option for their users. Learn ...

When the keyboard for a remote desktop isn't working, sys admins will need to run through these steps to find the root cause of ...

Running a remote desktop comes with all sorts of hardware considerations for IT to address, including how the desktop interacts ...

A remote desktop workstation may require specific configurations for the local hardware, including options to set up multiple ...

Resizing Volumes in Windows via DiskPart Utility

  categories.

(Is your server not living up to its potential? Order a server from us with promo code PACKETS for 15% off your first invoice)

The  DiskPart utility  enables you to configure storage from a script, a remote session, or another command prompt. It is different from other command-line tools, as it does not operate in a single-line mode. In DiskPart, your commands are read from standard input/output (I/O) and directed to any disk, partition, or volume.

DiskPart enhances the Disk Administrator graphical user interface (GUI). Specifically, it can do a superset of actions supported by Disk Management.

The C: drives of Alnitech servers has a 100GB default volume. You can use the rest of the space at your own discretion. You can find a list of the DiskPart commands you can use in this  Microsoft TechNet article . Some quick notes before you get started:

________________________

Creating a new volume

Scenario: Create a new volume “data drive” with 10GB of space and mount it as “T:”

Shrinking the size of a volume

Scenario: Shrink the system volume (drive C:) by 10GB

DiskPart’s shrink command reduces an existing partition’s size without damaging said partition.

Expanding the size of a volume

Scenario: Expand the system volume (drive C:) by 10GB

Option 1: To expand the volume/partition as much as possible: diskpart> extend

Option 2: To constrain the extension within a specific size parameter: diskpart> extend size=10240

Using the Windows GUI for resizing

Alternatively, you can use the Computer Management GUI in Windows to do volume resizing tasks.

Make sure you have sufficient space to make these changes.

Related Articles

(Is your server's network not living up to its potential? Order a server from us with promo code...

(Is your server not living up to its potential? Order a server from us with promo code PACKETS...

  Tag Cloud

  support.

diskpart change partition size

About QuickPacket

A humble company with the heart of a small business, and the staffing of a large one. We are able to meet your needs with personalized, always available support.

diskpart change partition size

Privacy Policy   |   Terms of Service   |   DMCA Notices © 2020 QuickPacket.

diskpart change partition size

Generate Password

logo

Diskpart: Resize NTFS/FAT Boot Partition in Windows 7,8,10

This tutorial will introduce how to use DiskPart to resize partition in Windows 10, 8, 7. Besides, another eaiser way will be shared to resize (extend/shrink) NTFS/FAT32 system boot partition.

diskpart change partition size

Why resize partition using Diskpart?

A partition on the hard drive is like clapboard in system, programs and personal files. System and software will run well if the hard drive has only one partition, normally C: partition. A well-partitioned hard drive helps us more on data management. After purchasing a PC, you will find it is partitioned to three volumes C, D, E in general. However, the system drive C usually is not enough to hold all your users data and programs, then it is when you will need Diskpart to resize partition.

Hard Drive Partition

Surely, resizing includes shrinking and extending two aspects. When one of the partitions is too big, you can use Diskpart to  shrink partition  to make full use of it in Windows 7/10/XP, create another new partition for instance. Other than resizing partition on hard drive, the partition on USB flash drive may also need to be changed. Anyway, you may have other reasons to resize hard drive partition. Now follow this article to learn how to change partition size in three ways.

Resize NTFS partition via Diskpart in Windows 7, 8,10

Diskpart is one of the built-in partition tools in Windows, which is an embedded product that needs to be used under Command Prompt. It is able to resize NTFS partitions. Now, we will show you how to extend a NTFS partition and there must be one adjacent unallocated space on its right side. Press Windows key + R key at the same time to start Run box.

Type cmd and press Enter key to start Command Prompt.

▶Input  Diskpart.exe  and press Enter.

▶Input  list volume  and press Enter.

▶Input  select volume x  (x is the volume number you want to extend) and press Enter.

▶Input  extend size=10240  (size stands for the capacity you will extend by and the unit is MB) and press Enter.

▶Input  exit  and press Enter.

In most instances, Diskpart will extend the volume successfully. Nevertheless, it will encounter errors like “extend volume may not be extended” when there are unmovable files in the volume. In addition, Diskpart won’t allow you to resize system partition as well as FAT-based volume. As a result, when you want to extend partition in Windows XP or resize system volume, it is better to ask powerful third party partitioning software,  AOMEI Partition Assistant Professional  for example.

Use Diskpart alternative to resize partition in Windows 7

AOMEI Partition Assistant Professional  provides partassist.exe utility for its users to partition hard drive from Command Prompt. You can operate it as using Dikspart yet get more advanced features. In detail, this tool supports Windows 11/10/8.1/8/7/XP and Windows Vista. Also, it allows you to resize system partition and FAT/FAT32/FAT16/NTFS-based volumes. More importantly, it will reallocate the unmovable files without damaging them in order to resize the volume. Download it freely to have a try.

Download and install AOMEI Partition Assistant. Repeat the same steps to start Command Prompt.

▶Input cd + installation directory of AOMEI Partition Assistant. e.g. cd C:\Program Files (x86)\AOMEI Partition Assistant Pro Edition 6.0 to start partassist.exe and press Enter.

▶Input partassist.exe /list to list all volumes and press Enter. Again, it is important that you know exactly which drive letter you will extend or shrink.

▶Input partassist.exe /resize:F /extend:right to automatically extend F using the unallocated space on its right side and press Enter.

▶Or input partassist.exe /resize:F /reduce-right:10GB to shrink F to generate 10GB unallocated space on its right side and press Enter. Input exit and press Enter.

To sum up, partassist in AOMEI Partition Assistant does offer much more advanced functions than Diskpart on resizing partition in Windows 7/10/XP. This alternative to Diskpart actually has graphical user-interface as well. So for those users who aren’t get used to command prompt operations, this user-friendly interface saves much troubles.

Extend OS partition with the graphical interface of AOMEI Partition Assistant

AOMEI Partition Assistant Professional is able to merge a partition with unallocated space no matter whether they are adjacent or not via the “ Merge Partitions ”  feature.

Step 1. Start AOMEI Partition Assistant. Right-click boot drive C and select "Merge Partitions".

Merge Partitions

Step 2. Check the unallocated space you want to add into the C drive and click "OK".

Check Unallocated Space

Step 3. Preview the virtual result and click"Apply".

Apply Merge

Tip: It will complete the task after reboot.

Words in the end, there are many methods to achieve the goal and all you need to do is to choose the most convenient one. Diskpart does have the function of resizing partitions, but if you need more advanced features, AOMEI Partition Assistant is the best choice. From the last three screenshots, you may find this software can perform many other operations. For example, you can realize BYOD by  installing Windows 10 on the external hard drive . Besides, it is considered to create one bootable media just in case.

Free Partition Manager

diskpart change partition size

diskpart change partition size

Download.com Rating

diskpart change partition size

Still Need Help?

Have your problem been solved? If not, please input query in the search box below.

This browser is no longer supported.

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

Shrink a basic volume

Applies To: Windows 10, Windows 8.1, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012

You can decrease the space used by primary partitions and logical drives by shrinking them into adjacent, contiguous space on the same disk. For example, if you discover that you need an additional partition but do not have additional disks, you can shrink the existing partition from the end of the volume to create new unallocated space that can then be used for a new partition. The shrink operation can be blocked by the presence of certain file types. For more information, see Additional considerations

When you shrink a partition, any ordinary files are automatically relocated on the disk to create the new unallocated space. There is no need to reformat the disk to shrink the partition.

If the partition is a raw partition (that is, one without a file system) that contains data (such as a database file), shrinking the partition might destroy the data.

Shrinking a basic volume

You must be a member of the Backup Operators or Administrators group, at minimum, to complete these steps.

To shrink a basic volume using the Windows interface

In Disk Manager, right-click the basic volume you want to shrink.

Click Shrink Volume .

Follow the on-screen instructions.

You can only shrink basic volumes that have no file system or that use the NTFS file system.

To shrink a basic volume using a command line

Open a command prompt and type diskpart .

At the DISKPART prompt, type list volume . Note the number of the simple volume you want to shrink.

At the DISKPART prompt, type select volume <volumenumber> . Selects the simple volume volumenumber you want to shrink.

At the DISKPART prompt, type shrink [desired=<desiredsize>] [minimum=<minimumsize>] . Shrinks the selected volume to desiredsize in megabytes (MB) if possible, or to minimumsize if desiredsize is too large.

Additional considerations

When you shrink a partition, certain files (for example, the paging file or the shadow copy storage area) cannot be automatically relocated, and you cannot decrease the allocated space beyond the point where the unmovable files are located. If the shrink operation fails, check the Application Log for Event 259, which will identify the unmovable file. If you know the cluster(s) associated with the file that is preventing the shrink operation, you can also use the fsutil command at a command prompt (type fsutil volume querycluster /? for usage). When you provide the querycluster parameter, the command output will identify the unmovable file that is preventing the shrink operation from succeeding. In some cases, you can relocate the file temporarily. For example, if you need to shrink the partition further, you can use Control Panel to move the paging file or stored shadow copies to another disk, delete the stored shadow copies, shrink the volume, and then move the paging file back to the disk. If the number of bad clusters detected by dynamic bad-cluster remapping is too high, you cannot shrink the partition. If this occurs, you should consider moving the data and replacing the disk.

Do not use a block-level copy to transfer the data. This will also copy the bad sector table and the new disk will treat the same sectors as bad even though they are normal.

You can shrink primary partitions and logical drives on raw partitions (those without a file system) or partitions using the NTFS file system.

Submit and view feedback for

Additional resources

 ITPro Today: IT News, How-Tos, Trends, Case Studies, Career Tips, More

Formatting and Resizing Partitions with Diskpart

Formatting and Resizing Partitions with Diskpart

Mark Minasi | Mar 25, 2010

In last month's " Initializing Windows Disks with Diskpart ," I showed you how Diskpart lets you view, select, create, and obtain detailed information about disk partitions. This month, we'll make those partitions useful by formatting them and giving them drive letters, then we'll see how to resize an existing partition to make it larger or smaller. (Learn more from " Diskpart Exerts VHD Control " and " Diskpart Goes Virtual ").

In last month's example, we added an empty 24GB drive to a Windows system and created a 10GB partition by typing select disk 1 (which pointed Diskpart to the second physical hard disk) and create partition primary size=10240 (Diskpart prefers size information in megabytes). To complete this disk's setup, we need to give it a drive letter with the Assign command, then format it with the Format command.

The Assign command is simple: After you focus Diskpart on a partition or volume, you can give that partition/volume a drive letter (or change the existing drive letter) by typing

To set this partition's drive letter to T, for example, you would use

(If you don't specify a letter, Diskpart automatically assigns the next available letter to the partition.)

Now, you need to format the disk before you can use it. The syntax of Diskpart's Format command is a bit different from the syntax of the native Format command that Windows OSs have had since DOS 1.0. It has many options, but in most cases these options will do the trick:

For example, you could format the partition quickly, allow Format to use the default cluster size, and label it "Data drive" by typing

That command gives you a working disk volume, but what if you want to change the volume's size? Since Windows Vista, Diskpart has been able to expand or shrink a partition/volume. Why shrink an existing volume? I've had to do it on a number of Vista and Windows Server 2008 systems because Windows' useful BitLocker drive-encryption tool lets you encrypt entire OS drives—but only if you have the foresight to leave 1.5GB of unused space on the disk where the OS resides. Because Vista/Server 2008 Setup is sadly BitLocker-unaware (a problem that Windows 7 and Server 2008 R2 don't share), many Vista/Server 2008 users carefully set up their systems, add BitLocker as a final touch, then find that Bitlocker won't work without a 1.5GB partition. Oops!

I've used Diskpart to help many people in this situation. The tool's Shrink command reduces an existing partition's size without damaging that partition. To shrink a partition/volume, I'd first select that partition or volume. For example, if I want to shrink the C drive on a system by 1.5GB, I would type list volume to determine the volume number that specifies the C drive (e.g., volume 2), select that volume by typing select volume 2, then type

In my example, I need to clear 1,500MB of free space so that I can create the partition that will make BitLocker happy. If I just type shrink without any parameters, Diskpart computes the maximum space it can extract from C, then shrink C by that amount. But I don't want C minimized in size; I just want 1,500MB taken from it. So, I'll add the desired= parameter:

That command will give me the 1.5GB of space I need to set up that extra drive letter that Vista/Server 2008's Bitlocker needs. To see how much space you can snatch from an existing drive, you can type shrink querymax .

Consider the opposite situation. You have a volume on a drive that doesn't fill that drive, leaving some precious disk space unused. How do you expand the volume to use all remaining space? You can use Diskpart's Extend command:

As with Shrink, first shift Diskpart's focus to the volume/partition you want to extend. Then, either type simply extend , which causes Diskpart to expand the volume/partition as much as possible, or constrain the extension with the size= parameter:

Diskpart's ability to expand and shrink volumes is a welcome addition to the list of built-in Windows storage tools. Next month, we'll take a look at a new-to-Windows-7 storage capability: the ability to create and manipulate drives packaged in VHD format.

diskpart change partition size

More information about text formats

How We Engage

Quick Links

Managed Testing Services

Managed crowd testing, project-based testing, strategic consultancy, global delivery, risk-based testing, test.predictor, test.consolidator.

Quality Assurance

Ensure the success of your technologies. We’ll help you optimize costs, quality and customer experience.

Quality Engineering

We’ll help you achieve business assurance and embrace the culture of quality orchestration across your business, technologies and operations.

Digital Engineering

Offer your customers outstanding experiences with expert digital engineering solutions, including DevOps, product engineering, AI & data analytics, digital EdTech and more.

Confused Between DevOps, Continuous Delivery and Continuous Deployment? Let’s Break It Down

You may have heard the terms – Continuous Delivery, Continuous Deployment and DevOps being use...

Strategic Advisory

Lorem ipsum dolor sit amet eros hac cras auctor cursus malesuada ultrices suspendisse sed.

New Testing Show Podcast: Test Coverage – An Expert Evaluation

Test coverage, apart from being a crucial factor in software maintenance, indicates software quality. It acts as a metric for...

Whatever industry you’re in, we have the expertise and experience to tailor the right testing solution for you, based on your specific needs and requirements.

Medical Devices

Retail & consumer goods, banking and financial services, media & entertainment, pharma’s 6 crucial digital health challenges (and how to overcome them).

In addition to developing innovative and effective digital health products, pharma & medical device companies need to deal with added...

Tell us your business goals and priorities, and we’ll customize one or more of our flexible engagement models for the perfect solution.

The 6 Ways Managed Software Testing Services Can Boost Your Business

Ensuring quality and meeting the customers’ expectations in this rapidly growing competitive landscape is a challenging yet inevitable task for...

Tools & Innovation

We have developed advanced, intelligent tools that take testing and data & knowledge management to a new level of efficiency, while providing invaluable insights.

The Unique Benefits of AI-Led Tools in Quality Engineering

Effective testing tools and streamlined testing plans are more important than ever before. By combining AI-enhanced tools that can simplify...

As a Qualitest client you get access to some of the best technology available in the software testing world.

Competition is Fierce: Improving Your Quality Engineering with the Power of AI

Artificial intelligence (AI) is seemingly everywhere, and for good reason. From driving citizen services in government to tailoring a personalized customer experiences in...

Get the latest quality engineering insights to evolve your methodologies and technologies and help move your business forward

Latest Insights

Large uk local authority achieves faultless migration from on-prem to the cloud, taking your it to the next level: the immense value of staff augmentation services, how to extend a disk in windows using diskpart, introduction:.

Sometimes a disk has more space available to an operating system (OS) than what it actually uses. You can extend the size of the space allocated to the OS.

Requirements:

Access to the Windows command line, and optionally a file editor if a scripting method is chosen

You can choose to extend the size of a disk using a  diskpart  script file, saving it with a  .txt  file extension and running it with  diskpart , or by using the  diskpart  interactive utility. Once access to the Windows command line is available, start  diskpart  as follows:

This will start the  diskpart  utility that is native to the Windows environment. Once  diskpart  is running, you can view the current disk information with:

This will return something such as:

DISKPART> list disk

Disk ### Status Size Free Dyn Gpt ——– ————- ——- ——- — — Disk 0 Online 136 GB 87 GB Disk 1 Online 279 GB 250 GB Disk 2 Online 931 GB 902 GB Disk 3 Online 136 GB 107 GB Disk 4 Online 136 GB 107 GB Disk 5 Online 93 GB 0 B Disk 6 No Media 0 B 0 B Disk 7 No Media 0 B 0 B

You can then view more detailed information about the particular disk using:

DISKPART> select disk 0 Disk 0 is now the selected disk. DISKPART> detail disk

What you need to determine, is which volume has the OS on it, which can be identified by the volume’s drive letter.

You can list volume information using  detail disk  or by:

DISKPART> list vol

Volume ### Ltr Label Fs Type Size Status Info ---------- --- ----------- ----- ---------- ------- --------- -------- Volume 0 System Rese NTFS Partition 350 MB Healthy System Volume 1 C NTFS Partition 48 GB Healthy Boot Volume 2 E New Volume NTFS Partition 29 GB Healthy Volume 3 F New Volume NTFS Partition 29 GB Healthy Volume 4 G New Volume NTFS Partition 29 GB Healthy Volume 5 H New Volume NTFS Partition 29 GB Healthy Volume 6 I Volume Name NTFS Partition 93 GB Healthy Volume 7 J Removable 0 B No Media Volume 8 L Removable 0 B No Media

You can then select the desired volume:

DISKPART> select vol 1

Volume 1 is the selected volume.

You can see from the  help extend  command that extending disk size is done in terms of megabytes (MB):

DISKPART> help extend

Extends the volume or partition with focus, and its file system, into free (unallocated) space on a disk.

Syntax: EXTEND [SIZE=] [DISK=] [NOERR] EXTEND FILESYSTEM [NOERR]

SIZE= Specifies the amount of space in megabytes (MB) to add to the current volume or partition. If no size is given, all of the contiguous free space that is available on the disk is used.

DISK= Specifies the disk on which the volume or partition is extended. If no disk is specified, the volume or partition is extended on the current disk.

Then you can extend the disk by the desired amount of space:

DISKPART> extend size=20000

DiskPart successfully extended the volume.

More Information:

For more information within  diskpart , type:

help extend

Sign up to receive insightful content.

New call-to-action

Let's make your job easier

Sign up to get insightful content.

diskpart change partition size

How to assign a drive a letter using Diskpart

How to add a partition using Diskpart

How to change partition size on Windows 11

Do you need to shrink or extend a partition on Windows 11? Here's how in four different ways.

Avatar for Mauro Huc

On Windows 11 , you can change partition size to either increase the drive size or use the unallocated space to create one or more partitions.

Regardless of the reason, you can resize a partition on Windows 11 without reformating or losing your files using the Settings app, Disk Management, Command Prompt, and PowerShell. When using these tools, you can change the size of any partition, including the “C,” or the partition on any drive, including those from an external location.

In this guide , you will learn the steps to shrink and extend the size of a partition on Windows 11.

Change partition size on Windows 11

Change partition size with disk management on windows 11, change partition size with command prompt on windows 11, change partition size with powershell on windows 11.

On Windows 11, you can use the “Disks & volumes” settings to shrink or expand a partition on the hard drive without losing data.

To change the size of a partition on Windows 11, use these steps:

Open Settings on Windows 11.

Click on System .

Click the Storage tab.

Under the “Storage management” section, click on Advanced storage settings .

Click the “Disks & volumes” setting.

Open Disks & volumes

Select the drive with the partition (volume) to resize.

Select the partition and click the Properties button.

Open volume properties

Under the “Size” section, click the Change size button.

Change size option

Confirm the new size of the partition.

Shrink or extend partition size

Click the OK button.

Once you complete the steps, the system will change the partition size without losing data to reflect the specified setting.

You can also use third-party tools like GParted to change the size or move the partition to a different section on the physical hard drive.

Using the legacy Disk Management tool is the easiest way to shrink or expand the partition size on Windows 11.

Shrink partition

To shrink a partition on Windows 11 with Disk Management, use these steps:

Open Start .

Search for Create and format hard disk partitions and click the top result to open the Disk Management console.

Right-click the drive you want to change its partition size and select the Shrink Volume option.

Disk Management shrink volume

Confirm the amount of space to shrink the partition (in megabytes).

Change partition size

Click the Shrink button.

Once you complete the steps, the partition will reduce to the specified size.

Extend partition

To increase (or extend) the drive partition size using Disk Management, use these steps:

Right-click the drive to change its partition size and select the Extend Volume option.

Disk Management extend volume

Click the Next button.

Under the “Selected” section, choose the disk with available space (if applicable).

Confirm the space to increase the drive partition (if necessary).

Increase partition size on Windows 11

Click the Finish button.

After completing the steps, the drive partition will extend to the specified size.

If the “Extend volume” option is greyed out, the physical drive doesn’t have any space to increase the volume.

It’s also possible to change the partition size without losing data on Windows 11 using the DiskPart tool with Command Prompt.

To shrink a partition with Command Prompt on Windows 11, use these steps:

Search for Command Prompt , right-click the top result, and select the Run as administrator option.

Type the following command to start diskpart and press Enter :

Type the following command to list the volumes and press Enter :

Type the following command to select the volume you want to shrink the partition and press Enter :

In the command, change “2” for the number representing the partition you want to modify.

Type the following command to determine the space you can decrease the partition and press Enter :

Type the following command to shrink the drive partition by a specific amount (in megabytes) and press Enter :

DiskPart shrink partition commands

In the command, change “7099” for the amount (in megabytes) you want to shrink the partition.

(Optional) Type the following command to shrink the partition by its maximum space reclaimable and press Enter :

Once you complete the steps, DiskPart will reduce the size of the partition to the new smaller size.

To increase the drive partition size with DiskPart, use these steps:

Type the following command to list the available disks and their capacity, and press Enter :

Type the following command to select the volume to shrink the partition and press Enter :

In the command, change “2” for the number that represents the partition to modify.

Type the following command to increase the size of the partition and press Enter :

In the command, change “20480” for the amount (in megabytes) you want to increase the partition.

(Optional) Type the following command to increase the size of the partition using all contiguous space on the drive and press Enter :

DiskPart extend partition commands

After you complete the steps, the partition will extend to the new size without losing your data.

Alternatively, you can also Change partition sizes using PowerShell commands.

To resize a partition with PowerShell, use these steps:

Search for PowerShell , right-click the top result, and select the Run as administrator option.

Type the following command to list all the drives and their total size, and press Enter :

Type the following command to list the available partitions on the drive and Enter :

In the command, change “2” for the number of the drive with the partition to shrink.

(Optional) Type the following command to understand the minimum and maximum space you can resize the partition and press Enter :

In the command, change the disk and partition number corresponding to your situation. Also, the SizeMin and SizeMax are specified in bytes, which means that you may need to use an online converter to understand the information in gigabytes or any other size.

Type the following command to resize the partition to 5GB and press Enter :

PowerShell resize partition (shrink)

In the command, replace the partition number and size for the information corresponding to your drive and the size to shrink the drive. Also, we’re using GB , but you can also specify the space in bytes, KB, MB, and TB

Once you complete the steps, PowerShell will shrink the partition, leaving additional unallocated space to create additional volumes.

To extend the partition size with PowerShell, use these steps:

Type the following command to list the available partitions in the drive and press Enter :

In the command, change “2” for the drive number with the partition you want to extend.

(Optional) Type the following command to understand the minimum and maximum space you can resize the partition on Windows 11 and press Enter :

In the command, change the disk and partition number corresponding to your situation.

Type the following command to increase the partition to 9GB and press Enter :

In the command, replace the partition number and size for the information corresponding to your drive and the size to increase the partition.

PowerShell resize partition (extend)

(Optional) Type the following command to extend the partition to its maximum size on Windows 11 and press Enter :

In the command, replace the disk and partition number for the information that corresponds to your situation. Also, to specify the new size of the partition, use the SizeMax number available in step No. 4 .

After completing the steps, the partition will cover the available space or the specified amount.

We hate spam as much as you! Unsubscribe any time Powered by follow.it ( Privacy ), our Privacy .

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. 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.

IMAGES

  1. How Do I Create a Partition Using Diskpart

    diskpart change partition size

  2. What Is DiskPart and How to Use It? (Ultimate Guide & Tips)

    diskpart change partition size

  3. What is disk formatting

    diskpart change partition size

  4. How can I use DiskPart to extend a volume?

    diskpart change partition size

  5. Windows diskpart create partition

    diskpart change partition size

  6. Partition offset and allocation unit size of a disk for SQL Server

    diskpart change partition size

VIDEO

  1. Easily Step to Resize Partition with Data Intact for Windows

  2. HOW TO PARTITION DISK

  3. How to Change Drive Partition Size on Windows 11

  4. Partition your hard disk to avoid losing data and appear organized

  5. DISK PARTITION USING DISK MANAGEMENT

  6. How To Partition Hard Disk In Windows || Best Trick

COMMENTS

  1. Using Diskpart to create, delete, clean or extend disk partitions

    At the DISKPART prompt, type create partition primary size=10000 (The size parameter refers to the size in megabytes. In this case, 10000 equals

  2. Resizing Volumes in Windows via DiskPart Utility

    To shrink or expand volumes:Computer Management > Disk Management > Select the partition you wish to shrink/expand > Right-click on the mouse button to shrink

  3. Diskpart: Resize NTFS/FAT Boot Partition in Windows 7,8,10

    Diskpart is one of the built-in partition tools in Windows, which is an embedded product that needs to be used under Command Prompt. It is able

  4. Shrink a basic volume

    To shrink a basic volume using a command line · Open a command prompt and type diskpart . · At the DISKPART prompt, type list volume . · At the

  5. Formatting and Resizing Partitions with Diskpart

    That command gives you a working disk volume, but what if you want to change the volume's size? Since Windows Vista, Diskpart has been able to

  6. How to extend a disk in Windows using diskpart

    Procedure: · Disk ### Status Size Free Dyn Gpt ——– ————- ——- ——- — — · Extends the volume or partition with focus, and its file system, into free (unallocated)

  7. Diskpart Helps to Increase Partition Size.mp4

    Download Free AOMEI Partition Assistant Now https://www.aomeitech.com/llyy/download/aomei-partition-assistant.

  8. How to resize drive partition on Windows 10

    To increase the drive partition size with diskpart, use these steps: ... Quick note: Identify the total size of the drive with the partition you

  9. How to change partition size on Windows 11

    Shrink partition · Open Start. · Search for Create and format hard disk partitions and click the top result to open the Disk Management console.

  10. Creating Disks and Volumes Using the DiskPart Command

    Select disks and convert to the GPT type. X:\windows\system32\DR> diskpart · Create the UEFI System partition. Create the UEFI partition. · Retain the boot volume

  11. DiskPart

    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