Windows 7 / Getting Started

Shrinking Partitions

With Windows Server 2008, you can shrink volumes on both basic and dynamic disks using either Disk Management or DiskPart. This is handy if you create a partition that's too large and you want to shrink it so you have more space for other partitions. In shrinking a volume, you convert areas of allocated but unused space to free space by removing them from an existing volume.

As with extending volumes, several limitations apply to shrinking volumes. First, you can shrink simple and spanned volumes only if they are formatted and the file system is NTFS. You can't shrink striped volumes. You can't shrink volumes that are formatted with FAT or FAT32. You can, however, shrink volumes that have not been formatted. If a volume is heavily fragmented, you may have to defragment the volume to free up additional space before shrinking.

Using Disk Management, you can shrink a simple or spanned volume by following these steps:

  1. Open Disk Management. Right-click the volume that you want to shrink and then select Shrink Volume. This option is available only if the volume meets the previously discussed criteria.
  2. In the field provided in the Shrink dialog box, enter the amount of space to shrink. The Shrink dialog box provides the following information:
    Total Size Before Shrink In MB Lists the total capacity of the volume in MB. This is the formatted size of the volume.
    Size Of Available Shrink Space In MB Lists the maximum amount by which the volume can be shrunk. This doesn't represent the total amount of free space on the volume; rather, it represents the amount of space that can be removed, not including any data reserved for the master file table, volume snapshots, page files, and temporary files.
    Amount of Space To Shrink In MB Lists the total amount of space that will be removed from the volume. The initial value defaults to the maximum amount of space that can be removed from the volume. For optimal drive performance, you'll want to ensure that the drive has at least 10 percent of free space after the shrink operation.
    Total Size After Shrink In MB Lists what the total capacity of the volume in MB will be after the shrink. This is the new formatted size of the volume.
  3. Click Shrink to shrink the volume.

By using DiskPart, you can shrink partitions using the command line. To shrink an NTFS-formatted partition, invoke DiskPart by typing diskpart at the command prompt. List the disks on the computer by typing list disk. After you check the free space of each disk, select the disk by typing select disk N, where N is the disk you want to work with. Next, list the partitions on the selected disk by typing list partition. Select the last partition in the list by typing select partition N, where N is the partition you want to work with.

Now that you've selected a partition, you can shrink it. To determine the maximum amount of space by which you can shrink the disk, type shrink querymax. To shrink the partition the maximum amount, type shrink. To shrink the partition a set amount, type shrink desired=N, where N is the amount of space to remove in megabytes. For example, if you want to remove 2000 megabytes from the partition, type shrink desired=2000.

Listing-3 shows an actual DiskPart session in which you shrink a disk. You can use this as an example to help you understand the process of shrinking disks. Here you determine that there are 4 GB of space available for shrinking on the selected partition and then shrink the partition by 3 GB.

Listing-3 Shrinking disks
C:\> diskpart

    Microsoft DiskPart version 5.2.3790
    Copyright (C) 1999-2001 Microsoft Corporation.
    On computer: CORPSVR02

    DISKPART> list disk

     Disk ###  Status   Size   Free   Dyn  Gpt
     --------  -------- -----  -----  ---  ---
     Disk 0    Online   56 GB  5 GB    *    *
     Disk 1    Online   29 GB  0 B
     Disk 2    Online   37 GB  19 GB
     
    DISKPART> select disk 2

    Disk 2 is now the selected disk.

    DISKPART> list partition

     Partition ###  Type       Size      Offset
     -------------  ---------  -------   -------
     Partition 1    Primary    37 GB     32 KB

    DISKPART> select partition 1

    Partition 1 is now the selected partition.

    DISKPART> shrink querymax

    The maximum number of reclaimable bytes is: 4 GB

    DISKPART> shrink desired=3000

    DiskPart successfully shrunk the partition by: 3000 MB

    DISKPART> exit

    Leaving DiskPart...

    C:\>

Deleting a Partition, Logical Drive, or Volume

Deleting a partition, logical drive, or volume removes the associated file system and all associated data. When you delete a logical drive, the logical drive is removed from the associated extended partition and its space is marked as free. When you delete a partition or volume, the entire partition or volume is deleted and its space is marked as Unallocated. If you want to delete an extended partition that contains logical drives, however, you must delete the logical drives before trying to delete the extended partition.

In Disk Management, you can delete a partition, logical drive, or volume by rightclicking it and then choosing Delete Partition, Delete Logical Drive, or Delete Volume, as appropriate. When prompted to confirm the action, click Yes.

[Previous] [Contents] [Next]