Diskpart is a command line tool integrated from Windows XP, it has many commands such as shrink, extend and convert. If you want to create new volume, you can shrink an allocated partition with Diskpart shrink command to release free space. However, because of many restrictions, diskpart is not the best tool to help resize server partition. This article introduces how to shrink volume in Server 2008 R2 with diskpart command.
How to shrink partition with diskpart in Server 2008
I'll explain the restrictions of diskpart in next section. Firstly, let's see how this inbuild tool works.
Steps to shrink volume with diskpart in Windows Server 2008 R2:
Step 1: Press Windows and R together on the keyboard, type diskpart and click OK or press "Enter".
Step 2: Type list volume and press Enter in the command prompt window. Then you'll see all single partitions with other information including file system, type, size and status.
Step 3: Type select volume C and press Enter. C is the drive letter or number of the volume that you want to shrink.
Step 4: Type shrink desired=10240 and press Enter. 10240 is the amount of space that I shrink from this partition (in MB). Replace with proper value in your server.
In a short while, diskpart report successfully shrunk the volume by 10GB.
Repeat from STEP 2 to shrink drive D, but diskpart report error - The volume cannot be shrunk because the file system does not support it.
Limitations to shrink volume with diskpart command
Type help shrink in diskpart command line window and press Enter, then you'll see what shrink command is used for, and the syntax on the top.
At the end, you'll see the restrictions of diskpart shrink command.
Limitations of diskpart command to Server 2008 R2 partition:
- Only the partitions that are formatted as NTFS or without file system (RAW) can be shrunk via diskpart.
- Unallocated space shrunk a volume can only be made on the right.
- OEM, ESP and Recovery partitions can't be shrunk.
- It cannot shrink volume beyond the point where unmovable files are located.
Explanation about the last restriction: for example there is 25GB free space in system partition C, if there are "unmovable" files in this drive, you cannot shrink with desired 25GB (or even 20GB).
As I said in the beginning, you cannot extend a volume by shrinking other one with Diskpart command. This is because:
- Diskpart extend command can only combine unallocated space to the left adjacent NTFS partition.
- Diskpart shrink command can only make unallocated space on the right.
For example: after shrinking partition D with diskpart, unallocated space is produced on the right of D, so this space cannot be extended to the nonadjacent drive C or the right partition E.
There are same limitations while shrinking volume with Server 2008 Disk Management.
Better way than diskpart to shrink and extend partition
With server partition software, there are no such limitations. Comparing with Diskpart command tool, NIUBI Partition Editor is able to:
- Shrink and extend NTFS and FAT32 partitions.
- Make unallocated space on either side while shrinking a partition.
- Shrink a volume to minimum size (if you want), because it can move these unmovable files.
- Combine unallocated space to either contiguous partition by 1 step.
- Move unallocated space and combine to any nonadjacent partition in the same disk.
- Merge, copy, convert, defrag, hide, wipe, scan partition and much more.
Download NIUBI Partition Editor and follow the steps in the video to shrink partition in Windows Server 2008 R2:
Better than other third party tools, NIUBI Partition Editor provides innovative 1 Second Rollback, Virtual Mode, Cancel-at-will and Hot Clone technologies to protect system and data, advanced file-moving algorithm to help resize partition 30% to 300% faster.