Disks File Systems-V10-18
Disks File Systems-V10-18
W hen working with any operating system, it’s important to understand how disks and
file systems are used. Disks must be formatted using a specific file system, and the file
system you choose can impact its performance and security. Windows operating systems
include several different tools used to manage disks, and if you know how to use these
tools, you can overcome most problems with any disk.
543
You can divide, or partition, a physical disk into multiple volumes. Each volume is identified
by a letter such as C, D, and so on. The operating system uses these letters as identifiers when
accessing data on the different volumes.
D:\
One One
physical disk physical disk C:\
E:\
Multiple volumes Single volume
from one disk from one disk
F:\
A logical question to ask is, “Why would you want multiple partitions?” It’s not neces-
sary, but some people like to have different partitions to organize their data. For example,
the operating system is on the C drive, and they create a second partition to store their data.
Then again, they could leave it as a single partition and create a folder named Data for their
files. It’s just a matter of preference.
MBR Partitions
The most common type of disk partitioning system in use is the Master Boot Record (MBR)
_______________
Key partitioning scheme. You can divide an MBR disk into two types of partitions:
Terms
■■ Primary partition. A primary partition is used for a single volume, such as the C vol-
ume or D volume. One of the primary partitions is marked as active, indicating that it
is bootable. During the startup process, the computer locates the active partition and
attempts to boot from it. You can have as many as four primary partitions on a disk.
Another benefit of GPT disks is that they are backward-compatible for applications that
are expecting an MBR disk. A GPT disk includes a table called a protective MBR that simulates
the MBR. Without this, older applications and disk utilities wouldn’t be able to read the disk
and might prompt the user to reformat it.
3. Right-click a disk and select Properties. Select the Volumes tab and look at the
Partition style as shown in the following graphic. The disk in the figure is an MBR disk.
You can convert an unpartitioned hard disk from MBR to GPT or from GPT to MBR from
within the Disk Management console. For example, if it is an MBR disk, you can right-click
the disk and select Convert To GPT. If it is a GPT disk, the option changes to Convert To MBR.
These options are dimmed if the disk has any partitions on it.
Recovery Partition
Many computer manufacturers and resellers include a recovery partition with systems they
_____________________________________________________
Key sell. This is another partition on the hard drive that a user can access, often by pressing a
Terms specific key when the system starts.
If the primary partition develops a problem, the recovery partition can be used to restore
the system to the exact state it was in when it was shipped. Users won’t have access to any
data or applications they added to their primary partition, but they will have a working sys-
tem again.
A recovery partition is often invisible to the system. It isn’t assigned a drive letter and <--
usually isn’t accessible with any applications other than the vendor’s recovery application.
If the primary partition is corrupted, such as from a virus, you can often use the recovery
partition to restore the system to its original condition. Many vendors don’t include media
to restore a system, so if the recovery partition is modified or deleted, users won’t be able
to recover it.
Unless you have a specific reason to do so, you should leave disks as basic instead of
dynamic. Of course, that prompts the question, “What’s a reason to upgrade a disk to
dynamic?”
Dynamic disks provide several benefits, such as the ability to create as many as 2,000 vol-
umes on a single disk. This is useful for users who want to get beyond the four-partition limit
of a basic MBR disk. You can also create striped, mirrored, and spanned volumes on dynamic
disks, which are discussed in the following sections.
If you convert the disk on any Windows-based system to dynamic disks, you can use
R AID- 0, but that is the only configuration that is universally supported. Only Windows 7
These limitations apply only to dynamic disks. Any system can support an external array
of disks. For example, you can buy external disk enclosures configured as RAID-0, RAID-1,
RAID-5, or RAID-10 and connect them with a USB, FireWire, or eSATA interface as described
in Chapter 4. Windows views the external array as a single physical disk that can be parti-
tioned as desired.
You can create mirrored volumes (RAID-1) on Windows 7–based systems, but this configu-
ration is not supported on Windows XP or Windows Vista. Windows XP and Windows Vista
do support dynamic disks using RAID-0 and spanned volumes, but not RAID-1.
Spanned Volumes
A spanned volume includes space on more than one physical disk, but it appears to the oper-
Key ating system as a single physical volume. For example, if you have a D volume used for data
Terms but it’s running out of space, you can add another physical disk and span the D volume to the
new disk. The D volume will now have the additional space available.
You cannot span a boot or system volume, but you can span other volumes, such as one
used for data. Chapter 11 describes the system and boot partitions in more depth. As a
reminder, the system partition is where the system boot files are located (typically C:\), and
Spanned volumes can be created only on dynamic disks. You can create a spanned volume
with the Disk Management graphical user interface (GUI) tool covered later in this chapter.
Quick Check
1. What type of disk is limited to only four partitions?
A file system is used to organize files and folders so that the operating system can access
the files. Files are commonly organized in folders (sometimes called directories), and the file
system allows users to browse through them to locate their files.
When you partition a hard drive, you are often prompted to choose a file system and
Key format it. The format process organizes the partition based on which file system you choose.
Terms It also deletes existing data, so you don’t want to reformat a disk unless you’re willing to lose
the data.
Several different file systems are available to format the hard drive with different charac-
teristics. It’s important to understand the differences between these file systems so that you
can choose the best one.
NTFS is the recommended file system for most situations. However, there are other
choices. The following sections describe the common file systems with a short discussion on
disk clusters.
Track
Cluster
(group of sectors)
Sector
File systems use a table to identify the location of files on a disk drive based on the clus-
ters. For example, a file named A+Notes.docx stored on a hard drive might start in a cluster
identified as 0x1357 and end at cluster 0x53A9. The operating system uses this information to
locate and retrieve the file from the disk.
Cluster sizes vary between file systems, but the size of a cluster is commonly 4,096 bytes
(or 4 KB). There aren’t many files that are only 4 KB in size, so files are stored in multiple
clusters.
Fragmentation <--
It’s best if the files are stored in contiguous clusters so that the hard drive can start reading
in one cluster and then continue reading until the entire file has been retrieved. For example,
a 10-MB file would ideally start in one cluster on the hard drive and use each of the clusters
after it until the entire file is stored on the drive. However, as a hard drive fills up, there isn’t
always enough space to store a file in contiguous clusters.
Instead, the file system divides or fragments a file and stores these fragments in different
locations on a hard drive. A 10-MB file might have 5 MB written in one area, 3 MB in another
area, and the last 2 MB in another area. When the file is read, the operating system retrieves
each of these fragments and puts the file back together.
Some fragmentation is common on a disk. However, when a disk is used more and more
often, fragmentation can become excessive. Instead of a file being divided into three frag-
ments, it could be divided into dozens of fragments. The system has to work harder and
harder to retrieve these fragments and put them back together.
Symptoms of a fragmented hard drive are as follows:
■■ Disk thrashing. The LED for the disk drive is constantly blinking, indicating heavy
activity. Additionally, you can hear the drive working as the read/write head is con-
stantly moving around the disk retrieving the different file fragments.
■■ Slow performance. The overall performance of the system slows down.
If you suspect a drive is highly fragmented, the best solution is to check it and defragment
it. You can do so with the Disk Defragmenter GUI or the defrag command-line tool, both
described later in this chapter.
If a system is slow and the hard drive LED shows constant activity, check for fragmentation.
You can often optimize the overall performance of a computer and increase its efficiency
by ensuring that disk drives are defragmented. You can use the defrag command or the
Disk Defragmenter GUI to defrag a volume. If you have these symptoms but the drive is
not defragmented, the system might need more physical memory.
FAT16 FAT32
If you ever try to copy or download a file larger than 4 GB to a FAT32 disk, you’ll get an
error that indicates you don’t have enough space. You could have a brand new, empty 16-GB
USB flash drive, but you’ll still get this error. The reason isn’t because you don’t have enough
space but because FAT32 can’t handle files greater than 4 GB. Convert the drive to NTFS, and
you won’t have this problem.
When creating FAT32 partitions from within Windows, you are limited to a maximum size
of 32 GB. It is possible to create larger FAT32 partitions by using other utilities or on other
operating systems, and Windows-based systems can recognize and use them.
You can format disks as FAT, FAT32, or NTFS from Windows-based systems such as
Windows 7. However, you can format disks as FAT only if they are smaller than 4 GB. If the disk
size is larger than 4 GB, you can select only FAT32 or NTFS.
Windows-based systems support exFAT (or FAT64), but this format isn’t widely supported
on non-Windows-based systems. If you’re formatting a disk larger than 32 GB, you’ll also see
exFAT as an option.
NTFS <--
New Technology File System (NTFS) is a secure file system, and when using Windows-based
Key systems, it is by far the best choice compared to any of the FAT versions. Microsoft recom-
Terms mends the use of NTFS with Windows operating systems, and newer operating systems
such as Windows 7 must be installed on NTFS. The install program won’t allow you to install
Windows 7 on a FAT volume.
NTFS provides better security, improved performance, and more features than any of the
FAT versions. Some of the features and capabilities include the following:
■■ File and folder permissions. You can assign permissions to control access to any files
and folders. Permissions are covered in more depth in Chapter 25.
■■ Encryption. Files and folders can be encrypted with the Encrypting File System (EFS)
to prevent unauthorized users from viewing the file contents.
■■ Compression. Files can be compressed so that they take up less space on a disk drive.
■■ Larger volumes. NTFS volumes can be as large as 2 TB on MBR disks or as large as
256 TB on GPT disks.
■■ Efficient. NTFS uses clusters within a hard drive more efficiently than any of the FAT
file systems.
■■ Built-in fault tolerance. NTFS can detect and recover from some disk-related errors
without any user intervention.
CDFS <--
The compact disc file system (CDFS) is the standard used to access files on optical discs. It is
Key formally defined in ISO 9660 and widely supported by different operating systems, including
Terms Windows, Linux and Unix systems, and the Mac OS.
Quick Check
1. What’s the maximum size of a FAT32 partition you can create on Windows?
2. NTFS.
1. This section lists the volumes and provides information about them, such as the type of
disk, the file system, the volumes‘ health, how big they are, and how much free space
they have.
2. Disk 0 is a basic disk, and this shows that it has a system-reserved partition, a C vol-
ume, and unallocated space. New partitions can be created from unallocated space.
3. Disk 1 is a dynamic disk, and it has one volume labeled as E and unallocated space that
can be used to create new volumes.
You lose access to all data after formatting a volume. However, data remnants remain on
the disk, so formatting isn’t a reliable way to ensure that data is removed. If the drive has
sensitive data, other tools should be used to remove the data.
Key A full format checks for bad sectors and marks them. If you perform a quick format origi-
Terms
nally but later want to check the sectors on a disk, you can use the chkdsk /r command to
check for and mark bad sectors.
You can format a disk from the command prompt with the format command or with the
Disk Management GUI. The basic command from the command prompt is:
format volume /fs:file-system
For example, to format the P drive with NTFS, use the following command:
format p: /fs:ntfs
The following steps show how to create and format a volume in Disk Management on a
Windows 7–based system:
1. Right-click the unallocated space and select New Simple Volume. Click Next.
2. The maximum size of the volume is automatically entered as the size of the new simple
volume. You can change this size or accept the default. Click Next.
3. On the Assign Drive Letter or Path page, you can assign a specific drive letter or accept
the default drive letter. Click Next.
4. On the Format Partition page, you can accept the default file system of NTFS or
change it to one of the FAT versions based on the size of the volume. If you want to
check the disk for bad sectors, deselect Perform A Quick Format. Your display will look
similar to the following graphic. Click Next.
Shrink a Volume
You can use these steps to shrink a volume in Windows Vista and Windows 7 by using Disk
Management:
1. Right-click the C drive (or another drive if desired) and select Shrink Volume.
2. The system will identify the maximum amount of space in MB that you can shrink the
drive to. You can accept the default or shrink it to a different size.
3. Click Shrink. When this is done, the amount of space you shrunk the drive by is identi-
fied as Unallocated space.
Extend a Volume
If you want to grow a disk by reclaiming unallocated space, you can do so by extending
the volume. The following steps show how to extend a volume on Windows 7 by using Disk
Management:
2. This will automatically select all of the unallocated space on the disk. You can change
this to a smaller size and leave some unallocated space if desired. Click Next.
3. Click Finished. The volume you created in the previous step will be extended to take
the additional space you specified.
You can use the following steps on a Windows 7 computer to create a mount point by
using Disk Management:
1. Right-click the unallocated space of a disk and select New Simple Volume. Click Next.
2. This will automatically select all of the unallocated space on the disk. You can change
this to a smaller size and leave some unallocated space if desired. Click Next.
4. Click Browse. Browse to the location of an empty folder. You can also select an existing
drive such as C and click New Folder and name your new folder. Click OK, and then
click Next.
5. Select the formatting options you want and click Next. Click Finish.
Disk Management doesn’t show that the new volume is a mount point. However, you
can see it if you launch Windows Explorer. Click Start, select Computer, and select the C
drive. Your display will look similar to Figure 16-4. In the figure, I named the mounted folder
MountPoint. You can also see that instead of a folder icon it has a shortcut icon with an arrow.
1. Right-click the disk in Disk Management, and select Convert to Dynamic Disk.
2. A dialog box will appear with the disk selected. Ensure that this is the disk you want to
convert and click OK.
4. Review the warning from Disk Management indicating that you will no longer be able
to use this system as a dual-boot system. Click Yes. After a moment, the disk will be
listed as a dynamic disk.
1. Right-click the unallocated space on a disk and select New Mirrored Volume.
Click Next.
2. The disk you clicked will be selected. Select a second disk from the list of available
disks and click Add.
3. The size will default to the maximum amount of space from either disk. You can
change the size if desired. Click Next.
6. If the disks are basic disks, you will be prompted to convert them to dynamic. Click Yes.
The system will create the mirrored volume.
You can use the following steps to create a striped volume on Windows 7 by using Disk
Management:
1. Right-click the unallocated space on a disk and select New Striped Volume. Click Next.
2. The disk you clicked will be selected. Select a second disk from the list of available
disks and click Add.
3. The size will default to the maximum amount of space from either disk. You can
change the size if desired. Click Next.
5. Select the desired format options and click Next. Click Finish.
Figure 16-5 shows Disk Management with three physical disks. Parts of disks 1 and 2 have
been created as a mirrored volume, and other parts have been made into a striped volume.
You would normally create either a single mirrored volume or a single striped volume using
two physical disks. However, the figure shows what each looks like when they are created.
You can see that only the mirrored volume (named My Mirror) provides fault tolerance. It
shows 50% overhead because only half of the drive space is available. In contrast, the striped
volume (named MyStripedVolume) includes two 750-MB disks and has about 1.43 GB of disk
space available.
The chkdsk command is a valuable command that you can use to identify and resolve prob-
Key lems with disks and RAID arrays. If you run it without using any switches, it will run a check on
Terms the current disk and report the results back. However, it does not attempt any repairs unless
one of the switches is used.
Two of the common switches used with the chkdsk command are listed in Table 16-3,
along with the sample command.
Switch Comments
/r Locates nd recovers readable information. This implies /f, so it also fixes errors on the
chkdsk /r disk.
If Windows Vista or Windows 7 detects a problem with a volume, it will often schedule
chkdsk to run the next time the system reboots.
If you attempt to run chkdsk or Check Disk to check a volume that is in use (such as the
C drive), Windows will indicate that it can’t check it while it is in use. You’ll be prompted to
schedule the disk check the next time the computer is booted. If you select Schedule disk, the
system will run the check when it reboots.
You can also check a disk from Windows Explorer with the following steps:
1. With Windows Explorer open, browse to the hard drive you want to check.
3. Click the Tools tab, and click Check Now. You’ll see a display similar to the following
graphic.
Key Both the chkdsk command-line tool and the Check Disk GUI will verify the integrity of the
Terms
physical disk and file system integrity. The chkdsk tool is also available from the command
prompt in safe mode and via the System Recovery tool in Windows Vista and Windows 7.
Convert <--
Whenever possible, it’s best to use NTFS instead of one of the versions of FAT. However,
Key you’re sure to come across some FAT volumes. If you want to convert a volume from FAT to
Terms NTFS, you can do so with the convert command. Converting a volume does not reformat it, so
it doesn’t result in the loss of data.
The basic syntax of the command is as follows:
convert volume /fs:ntfs
You specify the volume letter followed by a colon. For example, if you want to convert the
E drive from FAT32 to NTFS, you could use the following command:
convert e: /fs:ntfs
The convert utility allows you to convert a FAT file system to NTFS without losing any data.
However, if you want to revert an NTFS volume to FAT, you must reformat the volume, and
you’ll lose all the data on the drive.
Windows Vista and Windows 7 both include schedules to automatically check a drive for
fragmentation once a week. The schedule is included in the Windows Defrag menu within
the Task Scheduler’s Library of scheduled tasks. Unless these schedules have been disabled
through Task Scheduler, you don’t need to worry about defragmenting volumes on these
systems.
Another way to defragment a hard drive is with the defrag command from the command
prompt. The basic syntax is as follows:
defrag volume
For example, if you want to defrag the E drive, use the following command:
defrag e:
Table 16-4 shows two common switches you could use with the defrag command, along
with sample usage.
Switch Comments
/a Perform analysis of the drive. This provides a report but does not defrag the volume.
defrag e: /a
The system will calculate how much space can be saved by cleaning up the disk and allow
you to choose which files to delete. If you click OK, it will delete the selected files. If you want
to remove unneeded system files, you can click the Clean Up System Files button, and the
system will calculate how much space you can save, including unneeded system files.
C$, D$, E$, and so on This is created for each hard drive (C, D, E, and so on) on a system.
The UNC path for administrative shares is the same as other systems. For example, if a
computer is named after a user named Sally, the administrator can connect to Sally’s C drive
with the following UNC path: \\Sally\C$.
By default, administrative shares include a $ symbol to hide them. It’s also possible to add a
$ symbol to any share to hide it.
Local Shares
You can also share any folder on a disk by creating a share for it. The easiest way to do so is
from within the Computer Management console.
Figure 16-8 shows the Computer Management console opened to the Shared Folders,
Shares display on a Windows 7–based computer. It shows all the shares on this computer,
including one named APlusStudy, which is sharing the C:\data\A+Study folder.
You can create a share for any folder by right-clicking Shares and following the wizard to share it. <--
570 CHAPTER 16 Understanding Disks and File Systems