Shrinking a volume in Windows Server 2008

I’m getting ready to work at the Microsoft booth at the Storage Network World next week in Dallas, TX and I learned about this great little feature in Windows Vista and Windows Server 2008 (currently in Release Candidate 0 state): you can now shrink a volume. 

The scenario for this is quite common: you created a few volumes and you tried to estimate what the ideal size of the volume would be. And you guessed it wrong :-(. Windows Server 2003 already allows you to increase the size of a volume to use the entire partition, which covers the scenario where you underestimated your storage needs. Now you can also shrink a volume to free up partition space for other uses, in case you initially allocated too much space to a volume.

The main tool here is the DISKPART command line utility.  Below is an example of how you would do this, starting with a 50MB simple volume on a 100MB partition that get extended and then shrunk by 25MB.

 Microsoft Windows [Version 6.0.6001]
Copyright (c) 2006 Microsoft Corporation.  All rights reserved.

C:\Users\Administrator>diskpart

Microsoft DiskPart version 6.0.6001
Copyright (C) 1999-2007 Microsoft Corporation.
On computer: WS2008RC0N1

DISKPART> list volume

  Volume ###  Ltr  Label        Fs     Type        Size     Status     Info
  ----------  ---  -----------  -----  ----------  -------  ---------  --------
  Volume 0     C                NTFS   Partition     64 GB  Healthy    System
  Volume 1     G   Extra        NTFS   Partition     50 MB  Healthy
  Volume 2     F   FS1          NTFS   Partition     48 MB  Healthy
  Volume 3     H   FS2          NTFS   Partition     48 MB  Healthy
  Volume 4     E   Witness      NTFS   Partition      8 MB  Healthy
  Volume 5     D                       DVD-ROM         0 B  No Media

DISKPART> select volume 1

Volume 1 is the selected volume.

DISKPART> extend

DiskPart successfully extended the volume.

DISKPART> list volume

  Volume ###  Ltr  Label        Fs     Type        Size     Status     Info
  ----------  ---  -----------  -----  ----------  -------  ---------  --------
  Volume 0     C                NTFS   Partition     64 GB  Healthy    System
* Volume 1     G   Extra        NTFS   Partition    100 MB  Healthy
  Volume 2     F   FS1          NTFS   Partition     48 MB  Healthy
  Volume 3     H   FS2          NTFS   Partition     48 MB  Healthy
  Volume 4     E   Witness      NTFS   Partition      8 MB  Healthy
  Volume 5     D                       DVD-ROM         0 B  No Media

DISKPART> shrink desired=25 minimum=10

DiskPart successfully shrunk the volume by:   25 MB

DISKPART> list volume

  Volume ###  Ltr  Label        Fs     Type        Size     Status     Info
  ----------  ---  -----------  -----  ----------  -------  ---------  --------
  Volume 0     C                NTFS   Partition     64 GB  Healthy    System
* Volume 1     G   Extra        NTFS   Partition     75 MB  Healthy
  Volume 2     F   FS1          NTFS   Partition     48 MB  Healthy
  Volume 3     H   FS2          NTFS   Partition     48 MB  Healthy
  Volume 4     E   Witness      NTFS   Partition      8 MB  Healthy
  Volume 5     D                       DVD-ROM         0 B  No Media

DISKPART> exit

Leaving DiskPart...

C:\Users\Administrator>

You can also use the command “SHRINK QUERYMAX” to figure out how much you can shrink on a specific volume.
The “Disk Management” tool under “Storage” in Windows Server 2008’s “Server Manager” also allows you do this using a GUI.

If you SAN storage vendor supports it, you might also be also to shrink an actual LUN after freeing up space using this Windows Server 2008 new feature.

More information about the SHRINK command in DISKPART at:
https://technet2.microsoft.com/windowsserver2008/en/library/ec87cc7c-9846-465e-a10d-4ee10db4f4e61033.mspx

Download a copy of Windows Server 2008 RC0 yourself and start playing with this new feature. The download is available (since September 25th) from:
https://www.microsoft.com/downloads/details.aspx?FamilyId=0818D425-CD47-4279-BE8D-24ABA14530A3