4. Creating and Attaching Virtual Hard Disks
Windows 7 also allows you to create and attach virtual hard disks
(VHDs). You can create a virtual hard disk by completing the following
steps:
In Disk Management, select the Create VHD option on the Action
menu.
In the “Create and Attach Virtual Hard Disk” dialog box, click
Browse. Use the Browse Virtual Disk Files dialog box to select the
location where you want to create the .vhd file
for the virtual hard disk, and then click Save.
In the “Virtual hard disk size” list, enter the size of the
disk in MB, GB, or TB.
Specify whether the size of the VHD dynamically expands to its
fixed maximum size as data is saved to it or uses a fixed amount of
space regardless of the amount of data stored on it.
Click OK to create the VHD.
The VHD is attached automatically and added as a new disk in
Disk Manager. To initialize the disk for use, right-click the disk
entry in the Graphical view and then select Initialize Disk.
In the Initialize Disk dialog box, the disk is selected for
initialization. By default, the disk partition style is set to MBR
(Master Boot Record) if the total disk size is less than 2 TB. If
you want to use the GPT (GUID Partition Table) style, select the
related option. Click OK.
After initializing the disk, right-click the unpartitioned
space on the disk and create a volume of the appropriate type. After
you create the volume, the VHD is available for use.
You can work with a VHD in much the same way as you work with
other disks. Your computer can boot off a VHD. You can write data to and
read data from a VHD. Additionally, you are able to take a VHD offline
or put a VHD online by right-clicking the disk entry in the Graphical
view and selecting Offline or Online, respectively. You can detach a VHD
if you no longer want to use it by right-clicking the disk entry in the
Graphical view, selecting Detach VHD, and then clicking OK in the Detach
Virtual Hard Disk dialog box.
You can create VHDs using other programs. If you created a VHD
using another program or have a detached VHD that you want to attach,
you can do so by completing the following steps:
In Disk Management, select the Attach VHD option on the Action
menu.
In the Attach Virtual Hard Disk dialog box, click Browse. Use
the Browse Virtual Disk Files dialog box to select the location
where you want to create the .vhd file for the
virtual hard disk, and then click Open.
If you want to attach the VHD in read-only mode, select
Read-only.
Click OK to attach the VHD.
5. Formatting Volumes
Formatting a volume creates a filesystem that you can use
to store your data. If you format an existing volume that you’ve already
used, you will permanently delete any existing data. You can format a
volume by following these steps:
In Disk Management’s Graphical view, right-click the volume
that you want to format and then select Format. This displays the
Format dialog box shown in Figure 8.
In the “Volume label” text box, type a text label for the
volume.
Use the “File system” list to set the filesystem type. The
options you have depend on the size of the volume and type of
device, but they include FAT, FAT32, and NTFS.
The “Allocation unit size” list sets the cluster size for
the filesystem. A cluster is a logical grouping of file sectors. In
most cases, you’ll want the “Allocation unit size” list to be set to
Default. This allows Windows 7 to optimize the cluster size based on
the volume size.
The “Perform a quick format” checkbox allows Windows 7 to
format the volume without checking the partition for errors.
Although this option can save you a few minutes, it’s usually better
to allow Disk Management to check for errors and mark any bad
sectors it finds on the disk so that they aren’t used.
The “Enable file and folder compression” checkbox turns on
compression for the disk. Built-in compression is available only for
NTFS. If you select this option, files and folders on the volume are
compressed automatically.
Click OK to continue. Because formatting a volume destroys any
existing data, Disk Management displays a warning. Click OK to start
formatting the volume or Cancel to cancel.
6. Changing Drive Letters
Assigning a drive letter to a volume is the fastest and
easiest way to access and work with a volume. On most systems, the drive
letter B and drive letters E through Z are available, with drive letter
A reserved for a floppy disk, C assigned to the primary disk, and D
assigned to the CD/DVD drive. If your computer has a secondary hard
disk, a secondary CD/DVD drive, or both, you may find that drive letter
E or the drive letters E and F are already assigned as well.
To prevent potential startup problems, you should rarely if ever
change the drive letter for the system and boot volumes. However, you
can change the drive letters for other volumes at any time. To change a
drive letter, follow these steps:
In Disk Management’s Graphical view, right-click the volume
that you want to work with and then select Change Drive Letter and
Path. This displays the “Change Drive Letter and Paths for” dialog
box shown in Figure 9.
To change the drive letter, select the current drive letter
and then click Change. In the Change Drive Letter or Path dialog
box, choose a different letter to assign to the drive. Only those
drive letters that aren’t currently assigned will be
available.
NOTE
Although volumes can have multiple drive letters or be
mounted to file paths instead of drive letters, I recommend that
you avoid these options. You’ll prevent possible confusion and it
always will be clear how your drives are accessed.
Click OK to save your settings, then click Yes when you are
warned about the effects that changing a drive letter may have on
installed applications.
7. Changing Volume Labels
The volume label is a text descriptor
for a volume that is displayed when the volume is accessed in Windows
Explorer and other Windows programs. If your computer has multiple
volumes, giving each volume a descriptive label will help you easily
navigate between volumes. For example, you might have a volume named
Documents and a volume named Archive.
To change or set a volume label, follow these steps:
In Disk Management’s Graphical view, right-click the volume
that you want to work with and then select Properties.
On the General tab of the Properties dialog box, use the Label
field to type a new label for the volume.
8. Converting a Volume to NTFS
Windows 7 provides the Convert utility for converting FAT
or FAT32 volumes to NTFS. Convert is a command-line utility that
requires administrator privileges to run. When you convert a volume,
Convert preserves the file and folder structure and no data is
lost.
Windows 7 does not provide a utility for converting NTFS to FAT or
FAT32. The only way to go from NTFS to FAT or FAT32 is to delete the
volume and then recreate the volume with FAT or FAT32 as the filesystem
format.
You can convert any volume to NTFS, including the active, boot,
and system volumes. If you try to convert the boot or system volume,
Windows 7 displays a prompt asking whether you want to schedule the
volume to be converted the next time you start your computer. If you
choose Yes, you can restart the system to begin the conversion process.
In most cases, it will take several restarts to convert the boot or
system volume. Don’t interrupt the conversion process and don’t attempt
to shut down your computer during the conversion process.
Convert needs a block of free space that’s approximately equal to
25 percent of the total space used on the drive. For example, if the
drive stores 5 GB of data, Convert needs about 500 MB of free space. If
there isn’t enough free space, Convert will not convert the volume and
will instead tell you that you need to free up disk space.
You can convert a volume by following these steps:
Click Start→All Programs→Accessories.
Right-click Command Prompt and then select Run As
Administrator.
At the command prompt, use the following syntax to convert the
volume:
convert volume /FS:NTFS
where volume is the drive letter
followed by a colon (:). For example, if you wanted to convert the H
volume to NTFS, you would use the following command:
convert H: /FS:NTFS
Type the volume name when prompted. This confirms that you are
converting the correct volume.
9. Deleting Volumes
Occasionally, you may need to delete volumes that you no
longer need. You might also need to delete a volume if you want to
extend or reconfigure another volume on the same disk drive. Because
deleting a volume erases all data on the volume, you will want to copy
or move all data on the volume and then verify the copy or move prior to
deleting the volume.
NOTE
You can’t delete the system or boot volume. However, Windows 7
will let you delete an active volume if it isn’t also designated as
boot, system, or both. Always check to ensure that the volume that you
are deleting doesn’t contain important data or files.
You can delete a volume by following these steps:
In Disk Management’s Graphical view, right-click the volume
that you want to delete and then select Delete Volume.
When prompted to confirm that you want to delete the volume,
click Yes.