Hard Drives
Hard Drives
Hard Drives
❏ Every computer must have a hard disk drive (commonly called a hard drive,
hard disk, or abbreviated HDD).
❏ Your operating system is stored on the hard drive. Of course any other file can be
saved there too.
❏ It is the main location where people save data. Having adequate hard disk
storage for your needs is important.
What’s a HDD?
❏ A Hard Disk Drive (HDD for short) is a type of storage commonly used as the
primary storage system for both laptop and desktop computers.
❏ It functions like any other type of digital storage device by writing bits of data and
then recalling them later.
❏ It stands to mention that an HDD is what’s referred to as “non-volatile”, which
simply means that it can save data without a source of power.
❏ This feature, coupled with their large storage capacity and their relatively low cost
are the reasons why HDDs are used so frequently in home computers.
❏ While HDDs have come a long way from when they were first invented, the basic
way that they operate has stayed the same.
RPM:
RPM (Revolutions Per Minute) - Within a hard disk case are round platters (the actual
disks) that are attached to a spindle that spins. The disks are written to or read from
while spinning. One revolution is how many times the platters make a complete rotation.
Disks in a HDD literally rotate thousands of times per minute. The greater the RPM, the
faster data is read or written. 7200 RPM is typically what you will see in home computer
hard drives.
Form Factor:
The form factor of a hard drive is the actual physical size of the case the platters are in.
The main sizes are 3.5in and 2.5in.
Cache Memory:
A small amount of memory, usually 8, 16, or 32MB, is set aside for the most frequently
accessed files. When one of these files is selected, it is retrieved from the cache. This
reduces access time since the system does not have to search the drive for the data.
Parallel ATA (PATA), originally AT Attachment, also known as ATA or IDE is the
standard interface for IBM computers.
It was first developed by Western Digital and Compaq in 1986 for compatible hard
drives and CD or DVD drives.
The connection is used for storage devices such as hard disk drives, floppy disk
drives, and optical disc drives in computers.
Two ATA motherboard sockets on the left, with an ATA connector on the right.
History
The first version of what is now called the ATA/ATAPI interface was developed by
Western Digital under the name Integrated Drive Electronics (IDE).
Together with Control Data Corporation (the hard drive manufacturer) and Compaq
Computer (the initial customer), they developed the connector, the signaling protocols
and so on, with the goal of remaining software compatible with the existing ST-506 hard
drive interface.
The first such drives appeared internally in Compaq PCs in 1986.and were first
separately offered by Conner Peripherals as the CP342 in June 1987.
The term Integrated Drive Electronics refers not just to the connector and interface
definition, but also to the fact that the drive controller is integrated into the drive,
as opposed to a separate controller on or connected to the motherboard.
The interface cards used to connect a parallel ATA drive to, for example, a PCI slot are
not drive controllers: they are merely bridges between the host bus and the ATA
interface.
All of these low-level details of the mechanical operation of the drive were now
handled by the controller on the drive itself.
This also eliminated the need to design a single controller that could handle many
different types of drives, since the controller could be unique for the drive.
The host need only to ask for a particular sector, or block, to be read or written, and
either accept the data from the drive or send the data to it.
The interface used by these drives was standardized in 1994 as ANSI standard
X3.221-1994, AT Attachment Interface for Disk Drives. After later versions of the
standard were developed, this became known as "ATA-1".
2. Partitioning :
Partitioning means divisions.
Partitioning is the process of dividing the hard-disk into one or more regions.
The regions are called partitions.
It can be performed by the users and it will affect the disk performance.
3. High-level Formatting :
❏ High-level formatting is the process of writing.
❏ Writing on a file system, cluster size, partition label, and so on for a
newly created partition or volume.
❏ It is done to erase the hard-disk and again installing the operating
system on the disk-drive.
Figure – Steps of High-level Formatting
Firstly High-level formatting clears the data on hard-disk, then it will
generate boot information, then it will initialize FAT. After this it will go to
label logical bad sectors when partition has existed.
Formatting done by the user is the high-level formatting.
Generally, It does not harm the hard-disk.It can be done easily with the
Administrator, Windows snap-in Disk Management tool, diskpart, etc.
We can use such a format to fix some problems like errors in the file system,
corrupted hard-drive and develop bad sectors.
Example :-
How to Format a Disk or Drive in Windows 10
Format is the process of preparing a data storage device such as a hard disk
drive, solid-state drive, or USB flash drive for initial use to accept Windows files.
You can select to use a FAT, FAT32, exFAT, NTFS, or ReFS file system when
formatting.
● Full format - Files are erased (not overwritten) from the volume
that you are formatting and the drive is scanned for bad sectors.
The scan for bad sectors is the reason why the Full format takes
twice as long as the Quick format.
● Quick format - Files are erased (not overwritten) from the volume
that you are formatting, but does not scan the disk for bad sectors.
Only use this option if your hard disk has been previously formatted
and you are sure that your hard disk is not damaged.
This tutorial will show you different ways on how to format a disk or drive in
Windows 10.
When you format a disk or drive, it will erase all data on the disk or drive.
Contents
2 Right click or press and hold on the drive (ex: "D") you want to format,
click/tap on Format, and go to step 4 below. (see screenshot below)
3 Select the drive (ex: "D") you want to format, click/tap on the "Drive
Tools" Manage tab, click/tap on the Format button in the ribbon, and go
to step 4 below. (see screenshot below)
4 Select the supported File system (FAT, FAT32, exFAT, NTFS, or
ReFS) you want to use for this drive. (see screenshot below)
5 Select the supported Allocation unit size (aka: "cluster size") you want
to use for this drive. Usually it is best to use the default allocation size.
(see screenshot below)
6 Type a Volume label you want for the drive. (see screenshot below)
7 Check or uncheck the Quick Format box depending on if you want to do
a Quick or Full format of this drive. (see screenshot below)
8 Click/tap on Start, when ready to format this drive. (see screenshot
below)
10 When format is complete, click/tap on OK. You can now also close the
Format dialog. (see screenshot below)
OPTION TWO
Format Disk or Drive in Disk Management
1 Right click on the Start button to open the Win+X menu, and click/tap
on Disk Management (diskmgmt.msc).
2 Right click or press and hold on the disk or partition/volume (ex: "D")
you want to format, and click/tap on Format. (see screenshot below)
3 Type a Volume label you want for the drive. (see screenshot below)
2 Type the commands below one at a time into the command prompt, and
press Enter after each command. Make note of the volume number (ex:
"4") of the drive letter (ex: "D") you want to format. (see screenshot
below)
diskpart
AND
list volume
3 Type the command below into the command prompt, and press Enter. (see
screenshot above)
4 Type the command below you want to use into the elevated PowerShell,
and press Enter. (see screenshot below)
(Quick format)
format fs=<FileSystemType> label="<FriendlyNamel>" quick
OR
(Full format)
format fs=<FileSystemType> label="<FriendlyName>"
If the new drive letter you assign is not available, you will get an
error message indicating so in the command prompt. You will just
need to repeat this step to assign an available drive letter.
EIDE also provides faster access to the hard drive, support for Direct
Memory Access (DMA), and support for additional drives, including
CD-ROM and tape devices through the AT Attachment Packet Interface.
When updating your computer with a larger hard drive (or other drives), an
EIDE "controller" can be added to your computer in one of its card slot.
To access larger than 528 Mbyte drives, EIDE (or the basic input/output
system that comes with it) uses a 28-bit Logical Block Address (LBA) to
specify the actual cylinder, head, and sector location of data on the disk.
The 28 bits of the LBA provide enough information to specify unique sectors
for a device up to 8.4 GB in size.
5.5 SCSI Technology
2 channels.
Ease EIDE is commonly an Configuring SCSI can be more
Faster Today, the latest EIDE All the fastest drives are often
SCSI.
SCSI Supported devices include hard disks, optical disc drives, tape
drives, printers, scanners.
❏ Partitioning a drive is when you divide the total storage of a drive into different
pieces. These pieces are called partitions.
❏ Once a partition is created, it can then be formatted so that it can be used on a
computer.
❏ When partitions are made, you specify the total amount of storage that you would
like to allocate to that partition from the total size of the drive.
❏ For example, if you have an 80 GB drive, then it would be possible to make one
partition consisting of the entire 80 GB of available storage.
❏ Alternatively,you could make two partitions consisting of a 20 GB partition that
will be used for the operating system and programs and a 60 GB partition set
aside for data, music, and images.
❏ To store data and applications on a hard disk, users should partition it at first.
When we create a partition, the physical parameters of the hard disk have been
set, and the hard disk master boot record (generally referred to the mbr) and the
❏ After that, they can store different directories and files into different partitions.
❏ The more partitions, the more different storage places.
❏ Thus, users can store files into different partitions. But, users may encounter
some unexpected troubles and difficulties if they divide their hard disk into many
partitions.
❏ Space management, access permissions and directory searching ways depend
on the file system saved on the partition.
❏ Therefore, when users change something (like converting FAT16 to FAT32 files
system), they have to carefully consider the size of the partition.
❏ Disk partitions can be seen as a simple technique for logical volume
management predecessor.
❏ However, no matter how many partitions users divide the disk into and no matter
which type of disk is used (either SCSI hard drives or IDE hard disk), they should
set the primary partition as the active partition. Thus, they can boot the system
from this hard disk.
Reason for Partitioning Hard Disk
In general, each notebook users bought only contains a drive C.
1. When the system needs to be restored, the entire drive C (it is the system
disk) will be formatted. Thus, all information saved in the system disk will be
lost.
2. Saving massive information on system partition will slow down the
computer.
3. Different types of data should be saved in different partitions.
4. After disk partitioning, the size of the cluster will be smaller. Cluster is the
smallest storage unit, and the operating system determines that a cluster can
only store the contents of a file. Therefore, space occupied by a file can only
be an integer multiple of the cluster. If the file size is smaller than cluster size,
it still takes up a cluster. So well, using small clusters can help promote disk
space use ratio.
But the master boot record can contain up to 4 partitions records. To solve this
Each of these logical partitions is assigned with a drive letter alone, and can be used
Information about the Logical Partition is stored in the extended partition, while the
primary partition and extended partition information is store in the MBR of hard disk.
This means no matter how many partitions the disk contains, the master boot record
partition.
Types
After the hard disk is partitioned, there will be three kinds of partitions, namely
Primary partition is a relatively simple partition which is usually located in the top of
It provides a master boot program to check the correctness of the hard disk partition
The system cannot boot from the hard disk if this program is damaged, but the disk
can be read and written after we boot the computer from floppy or CD-ROM.
Extended Partition
partition can be divided into multiple logical partitions. Thus, users are allowed to
create multiple partitions. Here is an example of where the disk contains one primary
For DOS systems (DOS, Windows 9x), only the primary partition is bootable and is,
therefore, the only one on which the operating system can be started.
5.8 Logical Drives
A logical drive is a drive space that is logically created on top of a
physical hard disk drive.
Within the extended partition, you can create any number of logical drives.
When you have an extended partition on the hard disk, the entry for that partition in the
Partition Table (at the end of the Master Boot Record) points to the first disk sector in
the extended partition.
The first sector of each logical drive in an extended partition also has a Partition Table,
The last logical drive has only its own partition entry listed.
The Partition Table entry is the only information on the first side of the first cylinder of
each logical drive in the extended partition.
The entry for partition 1 in each Partition Table contains the starting address for data
on the current logical drive. And the entry for partition 2 is the address of the sector
that contains the Partition Table for the next logical drive.
The Total Sectors field is the total size of the logical drive defined in the Partition 2
entry.
5.9 FAT and Root Directory
❏ The File Allocation Table (FAT) file system is a simple file system originally
❏ The file allocation table resides at the beginning of the volume. To protect the
volume, two copies of the table are kept, in case one becomes damaged.
❏ The file allocation tables and the root folder must be stored in a fixed location
so that the files needed to start the system can be correctly located.
❏ A volume formatted with the FAT file system is allocated in clusters. The default
cluster size is determined by the size of the volume. For the FAT file system, the
❏ File Allocation Table: Contains cluster status and pointer to next cluster in
chain
Boot Sector, FAT, Root Directory, and Files
●
File tyui.jpg:
● File mes.doc:
The table describes the fields in the Partition Boot Sector for a volume formatted with
the FAT file system.
The Table describes BIOS Parameter Block and Extended BIOS Parameter Block
Fields.
To protect the volume, two copies of the table are kept, in case one becomes
damaged.
In addition, the file allocation tables must be stored in a fixed location so that the files
needed to start the system can be correctly located.
The file allocation table contains the following types of information about each cluster
on the volume (see example below for FAT16):
● Unused (0x0000)
● Cluster in use by a file
● Bad cluster (0xFFF7)
● Last cluster in a file (0xFFF8-0xFFFF)
There is no organization to the FAT folder structure, and files are given the first
available location on the volume. The starting cluster number is the address of the
first cluster used by the file. Each cluster contains a pointer to the next cluster in the
file, or an indication (0xFFFF) that this cluster is the end of the file. These links and
end of file indicators are shown below.
This illustration shows three files. The file File1.txt is a file that is large enough to use
three clusters.
The second file, File2.txt, is a fragmented file that also requires three clusters.
A small file, File3.txt, fits completely in one cluster. In each case, the folder structure
points to the first cluster of the file.
The only difference between the root folder and other folders is that the root folder is
on a specified location on the disk and has a fixed size .
Folders have a set of 32-byte Folder Entries for each file and subfolder contained in
the folder.
There is no organization to the FAT folder structure, and files are given the first
available location on the volume. The starting cluster number is the address of the
first cluster used by the file. Each cluster contains a pointer to the next cluster in the
file, or an indication (0xFFFF) that this cluster is the end of the file.
The information in the folder is used by all operating systems that support the FAT file
system. In addition, Windows NT can store additional time stamps in a FAT folder
entry. These time stamps show when the file was created or last accessed.
Normally, only the operating system controls the settings of these bits.
❏ FATs Compared
1. MKDIR
There are multiple ways to create or add a folder, subfolder, directory,
and subdirectory on a computer. The methods depend on the
operating system or where the directory is being created. Select a link
below for steps on how to create a directory and folder in each major
operating system.
To create a directory in MS-DOS or the Windows command line (cmd),
You can also create multiple new directories in the current directory
with the md command. In the next example, we are creating three new
directory.
If you want to create a directory with spaces, you need to surround the
that directory, you can use the command below. This example moves
2. CHDIR
Chdir (change directory) is a command used to switch directories in
MS-DOS.Used to change from one directory to another you specify.
The command can be used without the drive designator (d:) if you
were changing to a different directory on the current drive.
Chdir syntax
CHDIR [drive:][path]
CHDIR[..]
CD [drive:][path]
CD[..]
Chdir examples
chdir
chdir\
chdir..
C:\Windows> directory.
chdir Windows
directory tree.
with /S.
Syntax
Removes (deletes) a directory.
RMDIR [drive:]path
RD [drive:]path
rmdir. If you want to delete directories that are full, use the
deltree command or if you're using Windows 2000 or later, use
rmdir c:\test
4. TREE
The tree command allows the user to view an easy-to-read list
of files and folders.
tree syntax
TREE [Drive:[[Path] [/F] [/A]
ath
directory.
tree
directory.
tree /F
The command above uses the tree command with the /F switch.
are located in each directory, the tree listing could be quite long.
5. ATTRIB
The attrib command allows an MS-DOS and Windows command
line user to change the attributes of a file or files. For example,
you could make a file hidden using the attrib command.
Attrib is an external command that is available for the
following Microsoft operating systems attrib.exe.
1. R – This command will assign the “Read-Only” attribute to your selected files or
folders.
2. H – This command will assign the “Hidden” attribute to your selected files or
folders.
3. A – This command will prepare your selected files or folders for “Archiving.”
4. S – This command will change your selected files or folders by assigning the
“System” attribute.
“Attrib” Syntax
You will need to know the proper syntax to use for the “attrib” tool before you get
started.
In this syntax, you will need to know what the different switches and parameters
represent.
1. The + and – indicate whether you will activate or deactivate the attribute
specified.
2. The attributes you can use are those explained above.
3. The “/S” signifies that you want to search the entire path specified including
subfolders for a particular file.
4. The “/D” signifies that you want to include any process folders as well.
5. The pathname indicates the location of your target folder or file. The proper
syntax for path files is shown below.
Clear “Hidden and System” attributes with a single command to make your files or
folders normal.
For this example, we will first create a file in your “Documents” directory called
“sample.txt.” First, open up the directory and right-click somewhere in the window, move
your mouse to the “New” section, click on “Text File,” and name the document “sample.”
Now go to your CMD window. We will change the file’s properties so that it is both a
system file, and hidden. Do this by entering the following command.
attrib +h +s C:\Users\Martin\Documents\sample.txt
Remember to substitute the “Martin” section of the path parameter with your
computer’s username.
Once you have done this, you will notice that the file has disappeared from your
documents folder. Now that we want to remove the System and Hidden file attributes
from “sample.txt,” we will need to use the following simple command.
attrib –h –s C:\Users\Martin\Documents\sample.txt
Note that if you try to enter the file name without a path, you will receive an error. You
must remember to add the entire path to your command. Now, if you go back to your
“Documents” directory, you will see the file in the list.
Scenario 2 – Make all text files in your “Downloads” folder read-only system files.
Now we will create a few sample text files in the “Downloads” directory and we will edit
them using the “attrib” tool so that they all become read-only system files.
Once you have your sample text files created, it is time to use CMD to write a command
that will change the attributes of all text files in a specified directory to “Read-Only and
System.” For this, we will need to use wildcards to select all the text files. You can do
this by using the command below. Remember to substitute the “Martin” section with
your computer’s username.
attrib +r +s C:\Users\Martin\Downloads\*.txt
Now you can open your downloads folder, right-click on one of the text files and then
select properties. You will note that the file attributes have been changed. To remove
these settings simply use the same command, but replace the plus signs with minus
signs.
attrib -r -s C:\Users\Martin\Downloads\*.txt
6. MIRROR
The MIRROR command saves disk storage information that can be used to recover
accidentally erased files.
The command is available in MS-DOS version 5. It is available separately for versions 6.2 and
later on Supplemental Disk.
Type: External
Syntax:
Purpose: Used to store information about a disk`s file allocation table, boot
record, and root directory .
Discussion
The MIRROR command is used to save information that can be used later for file
recovery using the UNDELETE and UNFORMAT commands. MIRROR creates a
duplicate or MIRROR of this important information in case the original information
becomes unreadable.
For each drive you specify, MIRROR creates a read-only file named MIRROR .
FIL on the disk`s root directory. The file contains all the information that could be
used later to recover deleted or damaged files, or even to rebuild the file
structure of the entire disk.
Options
/1 - Specifies that MIRROR should keep only one-data information file, based on
the latest information about the drive you specified.
[d:]path - Specifies the drives for which information will be saved and used later
for file recovery.
/partn
v Used to save a copy of the drive`s partition table on a diskette in drive A.
When using the MIRROR command, do not specify a network drive or a drive
that has been previously specified using the JOIN, ASSIGN, or SUBST
command.
If you do not use the /1 option and MIRROR finds a file on the disk named
MIRROR.FIL, that file will be renamed MIRROR.BAK and a new file named
MIRROR.FIL will be created.
Examples
mirror c:d:
7. UNFORMAT
The unformat command is used to restore a formatted drive to its
original state.
Unformat is an external command that is available for the following
Microsoft operating systems as unformat.com.
Unformat syntax
Restores a disk erased by the FORMAT
RECOVER command.
ve
:
/J Verifies that the mirror files agree with the system
/L Lists all file and directory names found, or, when used
AR
TN
Unformat examples
unformat c:
c: if it was formatted.
8. PATH
Path syntax
Displays or sets a search path for executable files.
PATH [[drive:]path[;...]]
PATH ;
Type PATH ; to clear all directory names stored in your PATH variable.
This command will force Windows to search only in the current directory
Path examples
path
example of the output you may receive when utilizing this command. As
shown in the example below, there are multiple directories in the path
separated by a semicolon.
path=c:\windows\command
5.11Fragmentation
These spaces in RAM are divided either on the basis of fixed partitioning(the
size of partitions are fixed before the process gets loaded into RAM) or
dynamic partitioning (the size of the partition is decided at the run time
according to the size of the process).
As the process gets loaded and removed from the memory these spaces get
broken into small pieces of memory that can't be allocated to the coming
processes. This problem is called fragmentation. In this blog, we will study
how these free space and fragmentations occur in memory. So, let's get
started.
Fragmentation
Fragmentation is an unwanted problem where the memory blocks cannot be
allocated to the processes due to their small size and the blocks remain
unused. It can also be understood as when the processes are loaded and
removed from the memory they create free space or holes in the memory and
these small blocks cannot be allocated to new upcoming processes and results
● Internal Fragmentation
● External Fragmentation
Internal Fragmentation
In this fragmentation, the process is allocated a memory block of size more
than the size of that process. Due to this some part of the memory is left
Example: Suppose there is fixed partitioning (i.e. the memory blocks are of
fixed sizes) is used for memory allocation in RAM. These sizes are 2MB, 4MB,
4MB, 8MB. Some part of this RAM is occupied by the Operating System (OS).
Now, suppose a process P1 of size 3MB comes and it gets memory block of
size 4MB. So, the 1MB that is free in this block is wasted and this space can’t
internal fragmentation.
How to remove internal fragmentation?
This problem is occurring because we have fixed the sizes of the memory
allocated only that much amount of space which is required by the process. So,
External Fragmentation
In this fragmentation, although we have total space available that is needed
by a process still we are not able to put that process in the memory because
Example: Suppose in the above example, if three new processes P2, P3, and P4
come of sizes 2MB, 3MB, and 6MB respectively. Now, these processes get
So, now if we closely analyze this situation then process P3 (unused 1MB)and
P4(unused 2MB) are again causing internal fragmentation. So, a total of 4MB
(1MB (due to process P1) + 1MB (due to process P3) + 2MB (due to process P4))
4MB still we can’t allocate this memory to the process. This is called external
fragmentation.
How to remove external fragmentation?
This problem is occurring because we are allocating memory continuously to
to the processes.
be reduced by merging all the free memory together in one large block. This
used for allocating space according to the needs of the new processes.
Hard drives were also rather expensive at the time, costing roughly 10 USD per
megabyte. For the users who bought disk compression applications, the software
proved to be in the short term a more economic means of acquiring more disk space as
opposed to replacing their current drive with a larger one.
A good disk compression utility could, on average, double the available space
with negligible speed loss. Disk compression fell into disuse by the late 1990s, as
advances in hard drive technology and manufacturing led to increased capacities and
lower prices.
Standalone hardware
Some of the initial disk compression solutions were hardware-assisted and utilized add-on
compressor/decompressor coprocessor cards in addition to a software driver. Known
solutions include:
● Stacker XT/8 and Stacker AT/16 from Stac Electronics
● Expanz! and Expanz! Plus from InfoChip Systems
● DiskDoubler dd2000 from Datran Corporation
● MRCI (Microsoft Real-Time Compression Interface) from Microsoft
Standalone software
With increasing PC processor power software-only solutions began to reach or even
outperform the performance of hardware-assisted solutions in most scenarios. These
compression utilities were sold independently. A user had to specifically choose to install
and configure the software.
A disk cache is a cache memory that is used to speed up the process of storing
and accessing data from the host hard disk. It enables faster processing of
reading/writing, commands and other input and output process between the hard
disk, the memory and computing components.
A disk cache is also referred to as a disk buffer and cache buffer.A disk cache is a
mechanism for improving the time it takes to read from or write to a hard disk.
Today, the disk cache is usually included as part of the hard disk. A disk cache
can also be a specified portion of random access memory (RAM).
The disk cache holds data that has recently been read and, in some cases,
adjacent data areas that are likely to be accessed next. Write caching is also
provided with some disk caches.A disk cache is an integrated part of the hard
disk and is a standard feature of most hard disk drives.
The size of disk cache ranges from 128 MB in standard disks to 1 GB in solid
state disks.Typically, a disk cache stores the most recent and frequently used
programs and data.
When a user or program requests data, the operating system first reviews the
disk cache. If the data is found, the OS and memory quickly deliver the data to the
program.
A disk cache can also be soft disk cache when it’s implemented on the RAM
rather than the host/native hard disk.