0% found this document useful (0 votes)
7 views38 pages

Module 7

The document discusses various aspects of storage management in operating systems, including disk structure, attachment methods, and performance parameters. It covers topics such as physical and logical disk organization, internal and external disk attachment, and the importance of disk scheduling algorithms. Additionally, it highlights the advantages and disadvantages of different storage architectures and technologies.

Uploaded by

satyam.stark77
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views38 pages

Module 7

The document discusses various aspects of storage management in operating systems, including disk structure, attachment methods, and performance parameters. It covers topics such as physical and logical disk organization, internal and external disk attachment, and the importance of disk scheduling algorithms. Additionally, it highlights the advantages and disadvantages of different storage architectures and technologies.

Uploaded by

satyam.stark77
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Operating Systems

Storage Management, Protection and Security

Dr. Pradeep K V
Associate Professor (Sr.)
School of Computer Science and Engineering
VIT - Chennai

Dr. Pradeep K V Operating Systems 1/ 38


Contents...!

Disk Structure in OS
Disk Attachment in OS
Disk Scheduling and its Algorithms
System Threats
System Security
Security Policy and Mechanism
Access Verses Authentication
System Protection
Access Matrix
Capability based System
OS Performance, Scaling
Future Direction in Mobile OS.

Dr. Pradeep K V Operating Systems 2/ 38


Disk Structure I

Disk structure in operating system refers to the physical and logical


arrangement of data on a hard disk drive.
The physical structure - consists of one or more surfaces, each of which
contains several tracks, each of which is divided into sectors.
The logical structure - is divided into partitions, which are treated by the
OS as separate disks.

Dr. Pradeep K V Operating Systems 3/ 38


Disk Structure II

Disk management techniques used in OS include partitioning, formatting,


and creating a file system.
The low-level (physical) format divides the disk into sectors before storing
data so that the disk controller can read and write.
The “Created File System” (Logical Format) stores the data structure of
the first file system on the disk and contains free space and allocated
space.
For efficiency, most file systems group blocks into clusters.
Data is stored on a hard disk drive in binary code, using 1s and 0s .
The information is spread out on the magnetic layer of the disk(s) and is
read or written by the read heads that ‘float’ above the surface
To store data on a magnetic HDD, the disk is divided into tracks(- circular
paths on the disk surface). Each track is further divided into sectors.
Sectors are the smallest physical storage units on a disk. They are the unit
of information transfer and are mapped with a logical block on the disk.
A group of sectors makes a cluster(Blocks).

Dr. Pradeep K V Operating Systems 4/ 38


Disk Structure III

Figure: Physical Structure of disk

Dr. Pradeep K V Operating Systems 5/ 38


Disk Structure IV

Platters: The disks that make up the hard disk drive. Each platter has an
upper and lower oxide-coated surface.
Read/Write Heads: The heads that float above the surface of the platters
and read and write data as the platters spin around. There is at least one
head per surface.
Tracks: The concentric circles on the surface of the platters. Each track is
divided into sectors.
Sectors: The smallest physical storage units on the disk. Sectors are the
unit of information transfer and are mapped with a logical block on the
disk.
Cylinders: The set of tracks that have the same track value on all
platters. A cylinder is made up of rings on the upper and lower surfaces of
all of the platters.
Spindle: Help to connects all the platters and is connected to a motor.
The motor of the spindle rotates with a constant speed, causing the disk
platter to spin at a constant speed.
Arm Assembly: It holds the read/write heads. The arm assembly is
moved in or out to position a head on a desired track.

Dr. Pradeep K V Operating Systems 6/ 38


Disk Structure V

Disk - Logical Structure - It refers to the way data is organized and stored on
the disk. The main components are:
Master Boot Record (MBR): It contains a small program to load and
start the active (or bootable) partition from the hard disk drive. The MBR
contains information about all four primary partitions on the hard disk
drive such as the starting sector, ending sector, size of the partition, etc.
DOS Boot Record (DBR): is the first sector of a partition and contains
the boot loader code that is executed when the partition is booted.
File Allocation Table (FAT): is a table that keeps track of which clusters
are free and which are in use. It is used by the file system to locate files on
the disk.
Root Directory: is the top-level directory on a disk. It contains all the
files and directories that are stored directly on the disk.
Clusters: is a group of sectors that are allocated to a file. Clusters are
used by the file system to read and write data.

Dr. Pradeep K V Operating Systems 7/ 38


Disk Performance Parameters I

They are most helpful for getting to assess the overall performance of disk and
understand their capabilities in the respect of data transfer rates, access times,
and throughput.
Capacity: The total amount of data that can be stored on the disk,
typically measured in bytes (e.g., terabytes or petabytes).
Rotational Speed: For hard disk drives (HDDs), this parameter indicates
how quickly the disk platters rotate, usually measured in revolutions per
minute (RPM). A higher rotational speed generally leads to faster data
access times.
Latency: The average time it takes for the desired data sector to rotate
under the read/write heads after the seek operation is completed. It is
determined by the rotational speed of the disk and is measured in
milliseconds (ms).
Input/Output Operations per Second (IOPS): The number of reads or
write operations that can be performed by the disk in one second. IOPS is
an important measure of disk performance for tasks involving small,
random access operations.

Dr. Pradeep K V Operating Systems 8/ 38


Disk Performance Parameters II

Buffer Size/Cache: The amount of high-speed memory (cache) present


on the disk itself, used to temporarily store frequently accessed data. A
larger cache can improve disk performance by reducing the need to access
the physical disk for data. Access Time: The time it takes for the disk to
locate and retrieve data. Access time is the sum of seek time and
rotational latency time.
Seek Time: The time it takes for the read/write head to move to the
desired track on the disk.
Data Transfer Rate: The speed at which data can be read from or
written to the disk, typically measured in megabytes per second (MB/s).
Reliability: The ability of the disk to operate without failure over time.

Dr. Pradeep K V Operating Systems 9/ 38


Disk Attachment I

Definition...!
Disk attachment refers to the process of physically connecting a storage
device, such as a hard disk drive or solid-state drive, to a computer system. It
enables the computer system to read and write data to the storage device.

Types of Disk Attachment


Internal disk attachment
External disk attachment
Network Attached Storage
Storage Area Network

Dr. Pradeep K V Operating Systems 10/ 38


Disk Attachment II

Internal Disk Attachment

It refers to the process of connecting a storage device directly to the


motherboard of a computer system. It is typically used for storage devices that
are intended to be permanent components of the computer system, such as the
primary hard disk drive.

Advantages
Faster data transfer speeds : Internal disk attachment provides faster
data transfer speeds compared to external attachment methods, such as
USB or FireWire.
Better power management : Internal storage devices can be more easily
managed by the operating system’s power management features, allowing
for more efficient power usage.
More secure : Since internal storage devices are physically connected to
the motherboard, they are less likely to be accidentally disconnected or
removed.

Dr. Pradeep K V Operating Systems 11/ 38


Disk Attachment III

Disadvantages
Limited expansion : Internal disk attachment limits the number of
storage devices that can be connected to a computer system. This can be
problematic for users who require a large amount of storage space.
The difficulty of access : Since internal storage devices are located inside
the computer system, accessing them for upgrades or repairs can be more
difficult and time-consuming.
Higher cost : Internal storage devices can be more expensive than external
devices due to their higher performance and reliability requirements.

Dr. Pradeep K V Operating Systems 12/ 38


Disk Attachment IV
Exgternal Disk Attachment It refers to the process of connecting a storage
device to a computer system via an external port, such as USB, Thunderbolt,
or FireWire. They are used for external hard drives or USB flash drives.

Advantages
Portability : They can be easily transported and used on multiple
computer systems, making them ideal for users who require access to their
data on the go.
Ease of access : They are located outside the computer system, making
them easy to access for upgrades or repairs.
Expandability : They can be easily added or removed from a computer
system, allowing for more storage space as needed.
Disadvantages
Slower data transfer speeds : They provide slower data transfer speeds
compared to internal attachment methods, such as SATA.
Limited power management : They may’t be as easily managed by the
OS’s power management features, leading to less efficient power usage.
Less secure : External storage devices can be accidentally disconnected or
removed, leading to potential data loss or corruption.
Dr. Pradeep K V Operating Systems 13/ 38
Disk Attachment V

Network Attached Storage : It is a type of storage architecture where storage


devices are connected to a network and provide file-level access to multiple
clients or users.

NAS devices are typically dedicated devices that contain one or more hard
drives or solid-state drives, and they are connected to the network using
standard Ethernet or Wi-Fi connections.

Advantages
Easy to set up and manage : are designed to be user-friendly, and they
can be easily configured and managed using a web-based interface.
Cost-effective : are typically less expensive than other storage
architectures, such as Storage Area Networks (SANs), and they can offer
high-capacity storage for a relatively low cost.
Centralized storage : provide a centralized storage location that can be
accessed by multiple users or devices on the network, which can be useful
for sharing files and backing up data.

Dr. Pradeep K V Operating Systems 14/ 38


Disk Attachment VI

Disadvantages
Limited performance : may not offer the same level of performance as
other storage architectures, such as SANs, especially for high-performance
applications.
Limited scalability : may be limited in terms of scalability, especially for
larger enterprise environments.
Network dependency : rely on network connectivity, which can be a
potential point of failure or a bottleneck for storage access.

Dr. Pradeep K V Operating Systems 15/ 38


Disk Attachment VII

Storage Area Network It is a specialized network that provides block-level


access to storage devices, such as hard disk drives (HDDs), solid-state drives
(SSDs), or tape libraries.

SANs are designed to provide high-speed, low-latency storage access for servers
or hosts, and they can be used to build complex storage infrastructures for
enterprise data centers.
Advantage
SANs offer several advantages over other storage architectures.
They can provide high-speed, lowlatency access to storage devices, which
can be critical for high-performance applications such as databases or
virtualized environments.
Disadvantage
SANs can also be complex and expensive to implement and maintain, and
they may require specialized skills and expertise to configure and manage.
They also require a dedicated network infrastructure, which can add to the
overall cost and complexity of the storage infrastructure.

Dr. Pradeep K V Operating Systems 16/ 38


Disk Attachment VIII

Dr. Pradeep K V Operating Systems 17/ 38


Disk Attachment Methods I

SATA : Serial ATA (SATA) is a standard for connecting storage devices to a


computer system. SATA uses a serial connection and is commonly used for
connecting internal hard disk drives and solid-state drives.

Advantages
Faster data transfer speeds : SATA provides faster data transfer speeds
compared to older parallel ATA (PATA) standards.
Higher storage capacity : SATA supports larger storage devices than
PATA, allowing for more data to be stored on a single device.

Disadvantages
Limited cable length : SATA cables are limited in length, which can be
problematic for larger computer systems.
The limited number of devices : SATA only supports a limited number
of devices per controller, which can be problematic for users who require a
large amount of storage space.

Dr. Pradeep K V Operating Systems 18/ 38


Disk Attachment Methods II

SCSI : Small Computer System Interface (SCSI) is a standard for connecting


storage devices to a computer system. SCSI uses a parallel connection and is
commonly used for connecting highperformance storage devices, such as hard
disk drives and solid-state drives.

Advantages
High data transfer speeds : SCSI provides high data transfer speeds
compared to older standards, such as PATA.
Support for multiple devices : SCSI supports a large number of devices
per controller, making it ideal for users who require a large amount of
storage space.

Disadvantages
Higher cost : SCSI devices can be more expensive than other attachment
methods due to their higher performance and reliability requirements.
Limited compatibility : SCSI devices may not be compatible with all
computer systems, which can be problematic for users who require a
high-performance storage solution.

Dr. Pradeep K V Operating Systems 19/ 38


Disk Attachment Methods III

SAS : Serial Attached SCSI (SAS) is a standard for connecting storage devices
to a computer system. SAS uses a serial connection and is commonly used for
connecting high-performance storage devices, such as hard disk drives and
solid-state drives.

Advantages
High data transfer speeds : provides high data transfer speeds compared
to older standards, such as PATA.
Support for multiple devices : SAS supports a large number of devices
per controller, making it ideal for users who require a large amount of
storage space.

Disadvantages
Higher cost : SAS devices can be more expensive than other attachment
methods due to their higher performance and reliability requirements.
Limited compatibility : SAS devices may not be compatible with all
computer systems, which can be problematic for users who require a
high-performance storage solution.

Dr. Pradeep K V Operating Systems 20/ 38


Disk Attachment Methods IV

Importance of Disk Attachment in OS


Data storage : Disk attachment is necessary for storing data on a
computer system. Without disk attachments, it would be impossible to
save files or install software on the computer.
Performance : Disk attachment plays a critical role in system
performance. Faster and more efficient disk attachment technologies, such
as Serial Attached SCSI (SAS), can improve the speed and responsiveness
of the system.
Scalability : As data storage needs increase, disk attachment technologies
provide scalability by allowing additional disks to be added to the system.
This can be particularly important for businesses and organizations that
need to store large amounts of data.
Redundancy : Disk attachment technologies can provide redundancy and
failover capabilities to ensure that data remains accessible even in the
event of disk failure.
Data protection : Disk attachment technologies can provide data
protection features such as RAID (Redundant Array of Independent Disks)
to protect against data loss due to disk failure.

Dr. Pradeep K V Operating Systems 21/ 38


Disk Scheduling Algorithms I

Disk scheduling is done by OS to schedule I/O requests arriving for the disk.
Disk scheduling is also known as I/O Scheduling.

Improtance of Disk Scheduling :


Multiple I/O requests may arrive by different processes and only one I/O
request can be served at a time by the disk controller. Thus other I/O
requests need to wait in the waiting queue and need to be scheduled.
Two or more requests may be far from each other so this can result in
greater disk arm movement.
Hard drives are one of the slowest parts of the computer system and thus
need to be accessed in an efficient manner.

Key Terms associated with Disk Scheduling :


Seek Time: As we know, the data may be stored on various blocks of
disk. To access these data according to the request, the disk arm moves
and finds the required block. The time taken by the arm in doing this
search is known as "Seek Time".

Dr. Pradeep K V Operating Systems 22/ 38


Disk Scheduling Algorithms II

Rotational Latency: The required data block needs to move at a


particular position from where the read/write head can fetch the data. So,
the time taken in this movement is known as "Rotational Latency". This
rotational time should be as less as possible so, the algorithm that will
take less time to rotate will be considered a better algorithm.
Transfer Time: When a request is made from the user side, it takes some
time to fetch these data and provide them as output. This taken time is
known as "Transfer Time".
Disk Access Time: It is defined as the total time taken by all the above
processes. Disk access time = (seek time + rotational latency time +
transfer time)
Disk Response Time: The disk processes one request at a single time.
So, the other requests wait in a queue to finish the ongoing process of
request. The average of this waiting time is called "Disk Response Time".
Starvation: Starvation is defined as the situation in which a low-priority
job keeps waiting for a long time to be executed. The system keeps
sending high-priority jobs to the disk scheduler to execute first.

Dr. Pradeep K V Operating Systems 23/ 38


Disk Scheduling Algorithms III

Figure: Types of Disk Scheduling

Dr. Pradeep K V Operating Systems 24/ 38


Disk Scheduling Algorithms IV

FCFS - Disk Scheduling : It stands for ’first-come-first-serve’. Here, the


request that comes first will be processed first and so on. The requests coming
to the disk are arranged in a proper sequence as they arrive. Since every
request is processed in this algorithm, so there is no chance of ’starvation’.

For Example : Suppose a disk having 200 tracks (0-199). The request
sequence (82, 170, 43, 140, 24, 16, 190) of the disk is shown as in the given
figure and the head start is at request 50.

Dr. Pradeep K V Operating Systems 25/ 38


Disk Scheduling Algorithms V

"Seek time" will be calculated by adding the head movement differences of all
the requests:

i.e., "|(82 - 50)| + |(170 - 82)| + |(170 - 43)| + |(140 - 43)| +


|(140 - 24)| + |(24 - 16)| + |(190 - 16)|" = 642.

Advantages:
Implementation is easy.
No chance of starvation.

Disadvantages:
’Seek time’ increases.
Not so efficient.

Dr. Pradeep K V Operating Systems 26/ 38


Disk Scheduling Algorithms VI

SSTF - Disk Scheduling : It stands for ’Shortest seek time first’. Here, it
searches for the request having the least ’seek time’ and executes them first.
This algorithm has less ’seek time’ as compared to the FCFS Algorithm.

For Example : Suppose a disk having 200 tracks (0-199). The request
sequence (82, 170, 43, 140, 24, 16, 190) of the disk is shown as in the given
figure and the head start is at request 50.

Hence, Calculation of Seek Time = |(50 - 43)| + |(43 - 24)| + |(24 - 16)| +
|(82 - 16)| + |(140 - 82)| + |(170 - 140)| + |(190 - 170)| = 208

Dr. Pradeep K V Operating Systems 27/ 38


Disk Scheduling Algorithms VII

Advantages:
In this algorithm, disk response time is less.
More efficient than FCFS.
Disadvantages:
Less speed of algorithm execution.
Starvation can be seen.

Dr. Pradeep K V Operating Systems 28/ 38


Disk Scheduling Algorithms VIII

SCAN - Disk Scheduling : In this algorithm, the head starts to scan all the
requests in a direction and reaches the end of the disk. After that, it reverses
its direction and starts to scan again the requests in its path and serves them.
Due to this feature, this algorithm is also known as the "Elevator Algorithm".

For Example : Suppose a disk having 200 tracks (0-199). The request
sequence (82, 170, 43, 140, 24, 16, 190) of the disk is shown as in the given
figure and the head start is at request 50. The ’disk arm’ will first move to the
larger values.

Dr. Pradeep K V Operating Systems 29/ 38


Disk Scheduling Algorithms IX

Hence, the Calculation of ’Seek Time’ : |(199 - 50)| + |(199 - 16)| = 332
Advantages:
Implementation is easy.
Requests do not have to wait in a queue.

Disadvantage:
The head keeps going on to the end even if there are no requests in that
direction
.

Dr. Pradeep K V Operating Systems 30/ 38


Disk Scheduling Algorithms X

C-SCAN - Disk Scheduling : It stands for "Circular-Scan". It is almost the


same as the Scan disk algorithm but one thing that makes it different is that
’after reaching the one end and reversing the head direction, it starts to
come back. The disk arm moves toward the end of the disk and serves the
requests coming into its path.

Advantages:
The waiting time is uniformly distributed among the requests.
Response time is good in it.
Disadvantages:
The time taken by the disk arm to locate a spot is increased here.
The head keeps going to the end of the disk.

For Example : Suppose a disk having 200 tracks (0-199). The request
sequence (82, 170, 43, 140, 24, 16, 190) of the disk is shown as in the given
figure and the head start is at request 50. The ’disk arm’ will first move to the
larger values.

Dr. Pradeep K V Operating Systems 31/ 38


Disk Scheduling Algorithms XI

After reaching 0, it will again go move towards the largest remaining value
which is 43. So, the head will start from 0 and moves to request 43 serving all
the requests coming in the path. And this process keeps going.

Hence, Seek Time : |(199 - 50)| + |(199 - 0)| + |(43 - 0)| = 391

Dr. Pradeep K V Operating Systems 32/ 38


Disk Scheduling Algorithms XII

LOOK - Disk Scheduling : In this algorithm, the disk arm moves to the ’last
request’ present and services them. After reaching the last requests, it reverses
its direction and again comes back to the starting point. It does not go to the
end of the disk, in spite, it goes to the end of requests.

For Example : Suppose a disk having 200 tracks (0-199). The request
sequence (82, 170, 43, 140, 24, 16, 190) of the disk is shown as in the given
figure and the head start is at request 50.

Hence, Seek time =|(190 - 50)| + |(190 - 16)| = 314


Dr. Pradeep K V Operating Systems 33/ 38
Disk Scheduling Algorithms XIII

Advantages:
Starvation does not occur.
Since the head does not go to the end of the disk, the time is not wasted
here.

Disadvantage:
The arm has to be conscious to find the last request.

Dr. Pradeep K V Operating Systems 34/ 38


Disk Scheduling Algorithms XIV

C-LOOK - Disk Scheduling : The C-Look algorithm is almost the same as the
Look algorithm. The only difference is that after reaching the end requests, it
reverses the direction of the head and starts moving to the initial position. But
in moving back, it does not serve any requests.

Advantages:
The waiting time is decreased.
If there are no requests till the end, it reverses the head direction
immediately.
Starvation does not occur.
The time taken by the disk arm to find the desired spot is less
.
Disadvantage:
The arm has to be conscious about finding the last request.

For Example : Suppose a disk having 200 tracks (0-199). The request
sequence (82, 170, 43, 140, 24, 16, 190) of the disk is shown as in the given
figure and the head start is at request 50.

Dr. Pradeep K V Operating Systems 35/ 38


Disk Scheduling Algorithms XV

Hence, Seek Time = |(190 - 50)| + |(190 - 16)| + |(43 - 16)| = 341

Dr. Pradeep K V Operating Systems 36/ 38


Security and Protection

Click Me

Click Me

Dr. Pradeep K V Operating Systems 37/ 38


Dr. Pradeep K V Operating Systems 38/ 38

You might also like