This article introduces how to shrink partition with diskpart in Windows Server 2008 R2. Shrink system C drive and volume D via diskpart command line prompt.
How to shrink partition with diskpart in Server 2008
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, if you want to expand other partition after shrinking, Diskpart Extend command cannot help you.
Steps to shrink volume with diskpart in Windows Server 2008:
Step 1: Press Windows and R to open Run, type diskpart and 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 you want to shrink from this partition (in MB).
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.
All limitations of Diskpart Shrink command include:
- 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 at the end (on the right).
- OEM, ESP and Recovery partitions can't be shrunk.
- If you specified a minimum amount but there is not enough free space available, then diskpart cannot shrink this volume.
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), because diskpart cannot shrink beyond the point where these files are located, then there is no 25GB free space available.
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 contiguous 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.
Better than other third party tools, NIUBI Partition Editor provides innovative 1 Second Rollback, Virtual Mode, Cancel-at-well technologies to protect system and data, advanced file-moving algorithm to help resize partition 30% to 300% faster.