- Windows Server OS and management

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

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:
- Do not use diskpart until you back up the disk you plan to modify.
- Exercise caution when using diskpart on systems that use dynamic disks, an older technology with advanced features that gave administrators a way to make a volume that spanned several disks.
- Check with your hardware vendor before 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:
- At a command prompt, type: diskpart
- At the DISKPART prompt, type list disk (Note the drive number you wish to manipulate.)
- At the DISKPART prompt, type: select disk 0 (This selects disk to edit; make sure to type in the disk number from step two.)
- At the DISKPART prompt, type create partition primary size=10000 (The size parameter refers to the size in megabytes. In this case, 10000 equals 10 GB. Change the word primary to extended to create an extended partition. If you do not set a size, then all available space on the disk will be used for the partition.)
- At the DISKPART prompt, type assign letter=D (Choose an unused drive letter.)
- At the DISKPART prompt, type exit
- From the command prompt, use the format command, or the Disk Management utility in Windows or any disk format tool to format the drive. You would typically use the NTFS file system during the initialization process.

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:
- Verify that contiguous free space is available on the same drive and that free space is next to the partition you intend to extend with no partitions in between. Be sure you have a full backup before trying this method.
- At a command prompt, type diskpart
- At the DISKPART prompt, type select disk 0 (Selects the disk.)
- At the DISKPART prompt, type select volume 0 (Selects the volume.)
- At the DISKPART prompt, type extend (If you do not set a size, then diskpart will use all available space on the disk.)

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:
- At the DISKPART prompt, type list partition
- At the DISKPART prompt, type select partition 4 (Selects the partition.)
- At the DISKPART prompt, type delete 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 :
- At the DISKPART prompt, type create volume simple size=1000 (The size is in megabytes.)
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 :
- At the DISKPART prompt, type select disk 0
- At the DISKPART prompt, type clean all
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 (Disk Partition Utility)

How to create a custom ISO for Windows 10

Windows 10 disk management terms and tasks IT should know

Delete the Windows recovery partition on a Lenovo Thinkpad or Desktop

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 ...
- Azerbaijani
- Knowledgebase
- Portal Home
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:
- List then select an object to give it focus. Any DiskPart command will then act on that object.
- Adding extra space to an existing file system requires no downtime.
- Shrinking a file system requires no downtime as well.
________________________
Creating a new volume
Scenario: Create a new volume “data drive†with 10GB of space and mount it as “T:â€
- At the command line, type diskpart and press Enter.
- List all the disks connected to your server. diskpart> list disk Disk ###    Status     Size      Free     Dyn   Gpt --------------  ------------- ----------  ---------  -------  ------ Disk 0      Online      223 GB   123 GB
- Select a disk (in this scenario, “disk 0â€) by typing the following command: diskpart> select disk 0
- To create a partition (in this scenario, with 10GB size), type the following command: diskpart> create partition primary size=10240 You can see the result by typing the following command: diskpart> list partition Partition ### Type Size Offset ------------- ---------------- ------- ------- Partition 1 Primary 350 MB 1024 KB Partition 2 Primary 100 GB 351 MB * Partition 3 Primary 10 GB 100 GB
- To set this new partition’s drive letter to “T,†type the following command: diskpart>assign letter=t Note: If you do not specify a letter, DiskPart automatically assigns the next available letter to the partition.
- You can opt to format the disk before you use it: diskpart>format fs=ntfs label="Data drive" quick
Shrinking the size of a volume
Scenario: Shrink the system volume (drive C:)Â by 10GB
- Determine the volume number ascribed to drive C: by typing the following command: diskpart> list volume
- Select the associated volume (in this scenario, “volume 1â€) by typing the following command: diskpart> select volume 1
- To shrink this volume, type the following command: diskpart> shrink desired=10240 Note: If you just type ‘shrink’ without any parameters, DiskPart computes the maximum space it can extract from the volume and then shrink selected volume by that amount.
- To see how much space you can snatch from an existing drive, type the following command: diskpart> shrink querymax
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
- To expand this volume, you can do either of the following options:
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.
- To create a new volume and mount it a drive letter:Computer Management > Disk Management > Select unallocated disk space you need > Right-click mouse button > New Simple Volume > Select needed size > Assign drive letter > Format partition
- 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 or expand.
Make sure you have sufficient space to make these changes.
- 45 Users Found This Useful
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.

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.

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

Generate Password

- DiskPart Command Line Utility
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.

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.

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

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

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

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

- Resize and Move Partition
- System/Disk Clone
- Convert MBR/GPT Disk
- Check & Fix Disk Errors

Download.com Rating

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
- 3 minutes to read
- 4 contributors
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.
- Manage basic volumes
Submit and view feedback for
Additional resources

- NEWSLETTER SIGN-UP

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.

More information about text formats
- Allowed HTML tags: <em> <strong> <blockquote> <br> <p>
- No HTML tags allowed.
- Web page addresses and e-mail addresses turn into links automatically.
- Lines and paragraphs break automatically.
- Leadership Team
- Diversity & Inclusion
How We Engage
- Tools & Innovation
Quick Links
- Test Automation
- Performance Testing
- Cyber Security Testing
- ETL Testing
- Multilingual NLP Assurance
- IV&V and Regulatory Assurance
- PoS Testing
- Accessibility Testing
- Service Virtualization
- Digital Assurance
- Cloud Migration Testing
- IoT Assurance
- Drone Assurance
- Storm Readiness Testing
- Real-Time Systems
- Test Environment Management
- Testing of AI
- Google Cloud
- Mobile and Web Dev
- DevOps Transformation
- Serverless Cloud Native Development
- Cloud Transformation and Migration Strategy
- Business AI
- Modeling Optimization
- Learning Platform Development
- Video Encoding Streaming And Player Development
- Instructional Design
- Content Remediation Services
- Retail & Consumer Goods
- Banking & Financial Services
- Media & Entertainment
Managed Testing Services
Managed crowd testing, project-based testing, strategic consultancy, global delivery, risk-based testing, test.predictor, test.consolidator.
- Keysight Technologies
- Podcast: The Testing Show
- Technical Hub
- Case Studies
- Categories & Tags
- Diversity & Inclusion
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.

Let's make your job easier
Sign up to get insightful content.

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

Select the drive with the partition (volume) to resize.
Select the partition and click the Properties button.

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

Confirm the new size of the partition.

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.

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

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.

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

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 :

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 :

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 :

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.

(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.
- Windows 11 build 25163 out with new Taskbar Overflow feature
- How to enable new Taskbar Search button on Windows 11
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
VIDEO
COMMENTS
At the DISKPART prompt, type create partition primary size=10000 (The size parameter refers to the size in megabytes. In this case, 10000 equals
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
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 shrink a basic volume using a command line · Open a command prompt and type diskpart . · At the DISKPART prompt, type list volume . · At the
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
Procedure: · Disk ### Status Size Free Dyn Gpt ——– ————- ——- ——- — — · Extends the volume or partition with focus, and its file system, into free (unallocated)
Download Free AOMEI Partition Assistant Now https://www.aomeitech.com/llyy/download/aomei-partition-assistant.
To increase the drive partition size with diskpart, use these steps: ... Quick note: Identify the total size of the drive with the partition you
Shrink partition · Open Start. · Search for Create and format hard disk partitions and click the top result to open the Disk Management console.
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
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