4. Shrinking and Extending Volumes
With certain limitations, Windows SBS 2011 also enables you to
shrink and extend volumes after you have created them, with no loss of
data. When you right-click a volume and select Shrink Volume, a Shrink dialog box appears, as shown in Figure 14.
The dialog box enables you to specify how much disk space you want to free up by shrinking
the volume, based on the amount of data currently stored there. The
space freed by the shrink process is added to any contiguous
unallocated space located just after the shrinked drive.
Volume shrinking is subject to the following limitations:
-
You cannot shrink volumes formatted with any of the FAT file systems; you can shrink only NTFS volumes.
-
You cannot shrink striped, mirrored, or RAID-5 volumes.
-
To shrink a volume, the amount of free space on the volume must be at least equal to the amount of space you want to reclaim.
When you right-click a volume and select Extend volume, the Extend Volume Wizard appears. The wizard consists of a Select Disks page (see Figure 15),
just like the one you see when creating a non-simple volume. This is
because you can conceivably extend a simple volume onto one or more
additional disks, creating a spanned volume in the process.
The ability to extend volumes is subject to the following limitations:
-
You cannot extend volumes formatted with any of the FAT file systems; you can only shrink NTFS volumes.
-
To extend a volume on a basic disk into noncontiguous space on the same disk, you must convert it to a dynamic disk.
-
You cannot extend mirror or RAID-5 volumes.
-
You can extend a boot volume or system volume only into contiguous space on the same disk; you cannot extend them onto other disks.
Note
In this context, the term contiguous space refers to unallocated space immediately following the volume you want to extend.
In addition to the graphical interface that the Disk Management
snap-in provides, Windows Server 2008 R2 also includes a command-line
utility called Diskpart.exe that can perform all the same tasks, and a
few that Disk Management cannot, such as creating a fourth primary
partition on a basic disk.
Diskpart.exe has two operational modes: a script mode and an interactive
mode. To use script mode, you create scripts containing multiple
Diskpart commands and execute them from the command line using the
following syntax:
diskpart /s scriptfile
To use interactive mode, you run Diskpart.exe from the command line
without any parameters. This runs the program and generates a
DISKPART> prompt, as shown in Figure 16.
To use Diskpart in interactive mode, you execute commands from the DISKPART> prompt. Typically, you use various commands to specify what storage resource you want to manage and then use other commands to work with that resource.
For example, to create a new partition on a basic disk, you must
first specify the disk where you want to create the partition. The list disk command displays a list of the disks on the system, as shown in Figure 17.
To work with a particular disk, you use a command like select disk 4,
which shifts the focus of the program to that disk. It executes all
your commands from this point on disk 4, until you change the focus. In
the same way, you can change the focus of the program to a specific
partition or volume on the current disk.
Once you have selected a disk, you can create a partition using a command like the following:
create partition primary size=10000
This command creates a 10 GB primary partition on the currently selected disk. Using other commands, such as add, convert, delete, extend, format, and shrink, you can manipulate disks, partitions, and volumes, just as you can from the Disk Management snap-in.
Note
The Disk Management snap-in is somewhat informal about disk terminology, often confusing the terms partition and volume.
Diskpart.exe is more precise. You cannot create a volume on a basic
disk using Diskpart, nor can you create a partition on a dynamic disk.