0% found this document useful (0 votes)
27 views41 pages

Unit 5

The document provides an overview of mass-storage structures, disk attachment methods, and disk scheduling algorithms. It discusses various types of mass-storage devices, their access times, and the advantages and disadvantages of internal and external disk attachments. Additionally, it details several disk scheduling algorithms, including FCFS, SSTF, SCAN, C-SCAN, LOOK, and C-LOOK, highlighting their operational principles and performance metrics.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views41 pages

Unit 5

The document provides an overview of mass-storage structures, disk attachment methods, and disk scheduling algorithms. It discusses various types of mass-storage devices, their access times, and the advantages and disadvantages of internal and external disk attachments. Additionally, it details several disk scheduling algorithms, including FCFS, SSTF, SCAN, C-SCAN, LOOK, and C-LOOK, highlighting their operational principles and performance metrics.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 41

Unit V

Topic Covered

Overview Mass-Storage Structure, Disk Structure, Disk Attachment,


Disk Scheduling, Swap-Space Management, RAID Structure Protection:
Protection Goals of Protection, Principles of Protection, Domain of
Protection Access Matrix, Implementation of Access Matrix, Security:
Security Problem, Program Threats, System and Network Threats Case
Study: Windows Operating system, Linux Operating System
List of Mass-Storage in Computer
1. Hard disk
2. USB flash drive
3. Floppy disk
4. SD card
5. SSD
6. Magnetic Strip
7. Tapes
8. DVD
Mass-Storage Structure
Magnetic Disks

A magnetic Disk is a type of


secondary memory that is a flat
disc covered with a magnetic
coating to hold information. It is
used to store various programs and
files. The polarized information in
one direction is represented by 1,
and vice versa. The direction is
indicated by 0.
Magnetic Disks
Access time
The access time of a record on a disk includes three components
such as seek time, latency time, and data transfer time.
•Seek time − The time required to arrange the read/write head at
the desired track is called seek time. For example, suppose that
the read/write head is on track 2 and the record to be read is on
track 5, then the read/write head must move from track 2 to track
5. The average seeks time on a modern disk is 8 to 12 ms.
•Rotational delay or latency time − The time required to
position the read/write head on a specific sector when the head
has already been placed on the desired track is called rotational
delay. The rotational delay is based on the speed of rotation of the
disk. On average the latency will be half of one revolution time.
The average latency time on modern disks is 4.2 to 6.7ms.
•Data transfer time − Data transfer time is the actual time
needed to send the data.
Disk Attachment in Operating
System
Disk attachment is the process of connecting a storage device, such as a hard disk drive or
solid-state drive, to a computer system. This process is essential for the proper functioning of
an operating system as it allows the system to read and write data to the storage device. Disk
attachment can be either internal or external, and there are several methods of attachment,
including SATA, SCSI, and SAS.

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. The purpose of disk attachment is
to enable the computer system to read and write data to the storage device.
Types of disk attachment

1. Internal disk attachment

2. External disk attachment

3. Network Attached Storage

4. Storage Area Network


Internal disk attachment
Internal disk attachment refers to the process of connecting a storage device directly to the motherboard of a
computer system. This type of attachment 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.
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.
External disk attachment
External disk attachment refers to the process of connecting a storage device to a computer system via an
external port, such as USB, Thunderbolt, or FireWire. This type of attachment is typically used for storage
devices that are intended to be portable, such as external hard drives or USB flash drives.
Advantages
• Portability − External storage devices 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 − External storage devices are located outside the computer system, making them easy to
access for upgrades or repairs.
• Expandability − External storage devices can be easily added or removed from a computer system, allowing
for more storage space as needed.
Disadvantages
• Slower data transfer speeds − External disk attachments typically provide slower data transfer speeds
compared to internal attachment methods, such as SATA.
• Limited power management − External storage devices may not be as easily managed by the operating
system'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.
Network Attached Storage
Network-attached storage (NAS) 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 − NAS devices are designed to be user-friendly, and they can be easily configured
and managed using a web-based interface.
• Cost-effective − NAS devices 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 − NAS devices 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.
Disadvantages
• Limited performance − NAS devices may not offer the same level of performance as other storage
architectures, such as SANs, especially for high-performance applications.
• Limited scalability − NAS devices may be limited in terms of scalability, especially for larger enterprise
environments.
• Network dependency − NAS devices rely on network connectivity, which can be a potential point of failure or
a bottleneck for storage access.
Storage Area Network

A Storage Area Network (SAN) 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.
Disk Scheduling
• The operating system is responsible for using hardware efficiently — for the disk drives, this
means having a fast access time and disk bandwidth.
• Access time has two major components
• Seek time is the time for the disk are to move the heads to the cylinder containing the
desired sector.
• Rotational latency is the additional time waiting for the disk to rotate the desired sector
to the disk head.
• Minimize seek time
• Seek time  seek distance
• Disk bandwidth is the total number of bytes transferred, divided by the total time between
the first request for service and the completion of the last transfer.
Disk Scheduling Algorithm' is an algorithm that keeps and manages input and output
requests arriving for the disk in a system. As we know, for executing any process memory
is required. When it comes to accessing things from a hard disk, the process becomes very
slow as a hard disk is the slowest part of our computer. There are various methods by
which the process can be scheduled and can be done efficiently.
FCFS Disk Scheduling Algorithm
It stands for 'first-come-first-serve'. As the name suggests, 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’.
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.
head starts at position 50 and moves to request 82.
After serving them the disk arm moves towards
the second request which is 170 and then to the
request 43 and so on. In this algorithm,, the disk
arm will serve the requests in arriving order. In
this way, all the requests are served in arriving
order until the process executes.

Seek time= "(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.
SSTF disk scheduling algorithm
Shortest seek time first

As the name suggests, 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. Suppose a
disk has 200 tracks (0-199). The request sequence(82,170,43,140,24,16,190) are shown in the
given figure and the head position is at 50.
The disk arm searches for the request which will
have the least difference in head movement. So,
the least difference is (50-43). Here the difference
is not about the shortest value but it is about the
shortest time the head will take to reach the
nearest next request. So, after 43, the head will be
nearest to 24, and from here the head will be
nearest to request 16, After 16, the nearest
request is 82, so the disk arm will move to serve
to request 82 and so on.

Seek Time = (50-43) + (43-24) + (24-16) + (82-16) + (140-82) + (170-140) + (190-170) = 208
•Advantages:
• In this algorithm, disk response time is less.
• More efficient than FCFS.
•Disadvantages:
• Less speed of algorithm execution.
• Starvation can be seen.
SCAN
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".
• Example: Suppose a disk has 200 tracks (0-199). The request
sequence(82,170,43,140,24,16,190) is shown in the given figure and the head position is
at 50. The 'disk arm' will first move to the larger values.
Explanation: In the above image, we
can see that the disk arm starts from
position 50 and goes in a single
direction until it reaches the end of the
disk i.e.- request position 199. After
that, it reverses and starts servicing in
the opposite direction until reaches the
other end of the disk. This process
keeps going on until the process is
executed. Hence, the Calculation of
Advantages: 'Seek Time' will be like: (199-50) +
• Implementation is easy. (199-16) =332
• 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.
C-SCAN disk scheduling algorithm
It stands for "Circular-Scan". This algorithm 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.
After reaching the end of the disk it reverses its direction and again starts to move to the other end of
the disk but while going back it does not serve any requests.
Example: Suppose a disk having 200 tracks (0-199). The request sequence(82,170,43,140,24,16,190)
are shown in the given figure and the head position is at 50.
Explanation: In the above figure, the disk arm starts from
position 50 and reached the end(199), and serves all the
requests in the path. Then it reverses the direction and moves
to the other end of the disk i.e.- 0 without serving any task in
the path.
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 will be =
(199−50)+(199−0)+(43−0)=391=(199−50)+(199−0)+(43−0)
=391

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.
LOOK
LOOK Algorithm is similar to the SCAN disk scheduling algorithm except for the difference
that the disk arm in spite of going to the end of the disk goes only to the last request to be
serviced in front of the head and then reverses its direction from there only. Thus it prevents
the extra delay which occurred due to unnecessary traversal to the end of the disk.
Example a disk having 200 tracks (0-199). The request sequence(82,170,43,140,24,16,190)
are shown in the given figure and the head position is at 50.
Explanation: The disk arm is starting from 50 and
starts to serve requests in one direction only but in
spite of going to the end of the disk, it goes to the
end of requests i.e.-190. Then comes back to the last
request of other ends of the disk and serves them.
And again starts from here and serves till the last
request of the first side. Hence, Seek time =(190-50)
+ (190-16) =314
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
C-LOOK
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.
Example: Suppose a disk having 200 tracks (0-199). The request
sequence(82,170,43,140,24,16,190) are shown in the given figure and the head position is at
50.
Explanation: The disk arm starts from 50 and starts to
serve requests in one direction only but in spite of
going to the end of the disk, it goes to the end of
requests i.e.-190. Then comes back to the last request
of other ends of a disk without serving them. And
again starts from the other end of the disk and serves
requests of its path. Hence, Seek
Time =(190−50)+(190−16)+(43−16)=341=(190−50)+
(190−16)+(43−16)=341
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.
RAID (Redundant Array of Independent Disks)

RAID (redundant array of independent disks) is a way of storing the same data in different
places on multiple hard disks or solid-state drives (SSDs) to protect data in the case of a
drive failure.

RAID works by placing data on multiple disks and allowing input/output (I/O) operations
to overlap in a balanced way, improving performance. Because using multiple disks
increases the mean time between failures, storing data redundantly also increases fault
tolerance.

RAID arrays appear to the operating system (OS) as a single logical drive.
Standard
RAID levels
RAID 0. This
configuration has striping
but no redundancy of
data. It offers the best
performance, but it does
not provide fault
tolerance.
•RAID 1. Also known as disk
mirroring, this configuration
consists of at least two drives
that duplicate the storage of
data. There is no striping. Read
performance is improved, since
either disk can be read at the
same time. Write performance
is the same as for single disk
storage.
•RAID 2. This configuration
uses striping across disks,
with some disks storing
error checking and
correcting (ECC)
information. RAID 2 also
uses a dedicated
Hamming code parity, a
linear form of ECC. RAID 2
has no advantage over RAID
3 and is no longer used.
RAID
Description Operation Advantages Disadvantages Recovery
mode

If one or more drives fails, this results in


RAID 0 Striped disks Data is split evenly between two or more disks. Large size and the fastest speed. No redundancy.
array failure.

A single drive failure will not result in Speed and size is limited by the
RAID 1 Mirrored disks Two or more drives have identical data on them. Only one drive is needed for recovery.
data loss. slowest and smallest disk.

Striped set with Data is split evenly between two or more disks, High speeds for sequential read/write Poor performance for multiple
RAID 3 A single drive failure will rebuild.
dedicated parity plus a dedicated drive for parity storage. operations. simultaneous instructions.

Striped disks with Data is split evenly between three or more disks. Large size, fast speed, and The total array size is reduced by
RAID 5 A single drive failure will rebuild.
distributed parity Parity is split between disks. redundancy. parity.

Larger size and higher speed than


1+0; Striped set of Four or more drives are made into two mirrors
RAID 10 RAID-1, and more redundancy than No parity. Only one drive in a mirrored set can fail.
Mirrored Subset that are striped.
RAID-0.

Just a Bunch Of Any number of drives are accessed Hardware RAID may have better
JBOD Software RAID modes can be used. N/A
Disks independently by the operating system. performance.

Spanning or Data is written on one drive until it is full, and then


Big Creates a very large and simple array. No redundancy. N/A
Concatenation the next drive(s) until it or they are full.

Two drives have identical data, plus one drive is


Seamless operation when one drive Spare drive is not accessible to
Clone RAID 1 + Spare used for rebuilding in case of a primary array Only one drive is needed for recovery.
fails in a RAID-1 array. the user.
failure.
Swap-Space Management

Swap-space management helps the computer's operating system(os) pretend that it has more RAM than
it actually has. It is also called a swap file. Swap space resides in the Normal file system and Separate
disk partition.

Swap space, like virtual memory, is a type of secondary memory. It is used by the operating system
when there is no physical memory available for further process execution.

When the operating system requires memory, but the RAM is full, it shifts inactive pages from RAM to
swap memory. If these pages are ever needed again, the OS can relocate them from swap space to RAM.
It has a slower access time than RAM and is stored on disc memory. Swap space is a component of
virtual memory.

Swap space's principal role is to substitute disc space for RAM when real RAM becomes full and extra
space is required.
Protection and Security in Operating
System
Protection and security Are implemented to prevent interface with the use of files. Both logical and
physical.

There are two terms

1. Protection : All kinds threats are comes under the protection mechanism, Providing mechanism
for controlling the access to prog, process, user to resource.

2. Security : It deals with external threats(for security purpose firewalls, encryption are used.) There
are two types of threads
• Internal (Threats to information are internal)
• External (External user trying to access the resources called External threats)
Protection Goals of Protection
Need of protection OS :

• To ensure data safety, process and program safety against illegal user access, or even
program access, we need protection.

• It is to ensure that programs, resources and data are accessed only according to the systems’
policies.

• It is also to ensure that there are no access rights’ breach, no unauthorized access to the
existing data, no virus or worms.

• There can be security threats such as unauthorized reading, writing, modification or


preventing the system to work properly for the authorized users themselves.
Protection Goals of Protection
Goals of Protection :

• Protection is a method of safeguarding data and processes against malicious and intentional
intrusion. For that purpose, we have protection policies that are either designed by the system itself
or specified by the management itself or are imposed by the programmers individually to protect
their programs with extra safety.

• It also gives a multiprogramming OS the sense of safety that is required by its users to share
common space like files or directories.

• The policies bind how the processes are to access the resources present in the computer system,
resources like CPU, memory, software and even the OS. Both the OS designer and the application
programmer are responsible for this. However, these policies always change from time to time.
Access Matrix in OS
An access matrix in operating system is used to define each process’s rights for each object executing in
the domain. It helps in the protection of a system and specifies the permissions/rights for every process
executing in the domain. The access matrix in os is represented as a two-dimensional matrix.

Access Matrix is a security model of the protective state of a computer system. For each object, the
permissions for every process executing in the domain are specified using an access matrix.

Implementation of Access Matrix in OS


Four widely used access matrix implementations can be formed using these decomposition methods:
• Global Table
• Capability Lists for Domains
• Access Lists for Objects
• Lock and key Method
Protection and Security in Operating
System
• An access matrix in os is used to define each process’s rights for each object executing in the domain.

• An access matrix in an operating system helps in the protection of a system and is represented by a
two-dimensional matrix.

• We have also discussed the implementation of the access matrix in os with some methods in detail
with the help of examples.

• Domain switching can easily be supported by simply “switch” access to other domains using an
access matrix.

• Global table is not widely used as it has a drawback, due to several objects existing in the system
table size increases, and additional I/O is required.
Operating System - Security
Program Threats: Operating system's processes and kernel do the designated task as instructed. If a user
program made these process do malicious tasks, then it is known as:
• Program Threats. One of the common example of program threat is a program installed in a computer
which can store and send user credentials via network to some hacker. Following is the list of some well-
known program threats.
• Trojan Horse − Such program traps user login credentials and stores them to send to malicious user who
can later on login to computer and can access system resources.
• Trap Door − If a program which is designed to work as required, have a security hole in its code and
perform illegal action without knowledge of user then it is called to have a trap door.
• Logic Bomb − Logic bomb is a situation when a program misbehaves only when certain conditions met
otherwise it works as a genuine program. It is harder to detect.
• Virus − Virus as name suggest can replicate themselves on computer system. They are highly dangerous and
can modify/delete user files, crash systems. A virus is generatlly a small code embedded in a program. As
user accesses the program, the virus starts getting embedded in other files/ programs and can make system
unusable for user
Operating System - Security
System Threats:
System threats refers to misuse of system services and network connections to put user in trouble.
System threats can be used to launch program threats on a complete network called as program
attack. System threats creates such an environment that operating system resources/ user files are
misused. Following is the list of some well-known system threats.
• Worm − Worm is a process which can choked down a system performance by using system
resources to extreme levels. A Worm process generates its multiple copies where each copy uses
system resources, prevents all other processes to get required resources. Worms processes can even
shut down an entire network.
• Port Scanning − Port scanning is a mechanism or means by which a hacker can detects system
vulnerabilities to make an attack on the system.
• Denial of Service − Denial of service attacks normally prevents user to make legitimate use of the
system. For example, a user may not be able to use internet if denial of service attacks browser's
content settings.
Difference between Windows and Linux
Parameters Linux Windows

Linux is a Unix-based open-source and free-to-use operating Windows is a licensed operating system and a certain amount has to
Open Source
system. be paid to use Windows OS.

In Linux operating system, every entity is a file. In this OS, the In Windows operating system, the files are arranged in different disk
files are arranged in a tree-like structure that starts from the root drives like Drive C, Drive D, Drive E, etc. Backward slash (\) is
File System
directory. Forward slash (/) is used as a path separator between the used as a path separator between different directories in a Windows
directories in a Linux OS. OS.

In Linux operating system, there exist three types of users which In the Windows operating system, there exist four types of users
are Regular, Root (Administrative), and Service. A Regular user which are Administrator, Standard, Child, and Guest. An
does not have the access to files of different users. Root users have Administrator user has access to make changes in the system. A
User Type
the access to every restricted file, they have all the administrative Standard user has access to perform all the common operations.
access. A Service user in Linux OS can give permission or deny Child users have restricted access to the system. A Guest user can
permission to different resources. have access to the system temporarily or for a specific period.

In the Linux operating system, files with the same name and
File Name different casing can reside in the same folder. They are case- In the Windows operating system, files with the same name cannot
Convention sensitive, for example, sample, Sample, and SAmple can reside in reside in the same folder. They are not case-sensitive.
the same location.
Difference between Windows and Linux
Linux operating system is more efficient when Windows operating system is less efficient as
compared to the Windows operating system compared to the Linux operating system because
Efficiency
because of the fewer complexities involved and of being feature-rich which makes Windows a
because they are lightweight. heavy system software.
In Windows operating system, micro kernel is
In the Linux operating system, the
used where user services are placed in user space
Kernel traditional monolithic kernel is used for having
and kernel services are placed in kernel space
Type better overall performance but the monolithic
which contributes to the reduction of the overall
kernel consumes more running space.
size of the Kernel and OS.
In the Linux operating system, the home
directory is different for every user of the system. Windows operating system also provides the same
Home The directories and files of different users are feature of different home directories for different
Directory stored in their concerned home directory. For users of the system. The home directory in
example, a user named harry has the home Windows can be set as C:\documents or \setting.
directory as /home/harry/.

You might also like