Subject: OS(630004) UNIT-4 PATEL GROUP OF INSTITUTIONS

tealackingΤεχνίτη Νοημοσύνη και Ρομποτική

8 Νοε 2013 (πριν από 3 χρόνια και 10 μήνες)

93 εμφανίσεις

Subject:

OS(630004)



UNIT
-
4

PATEL GROUP OF INSTITUTIONS


DESIGN BY:

ASST.

PROF.VIKAS KATARIYA 8980936828

Page
1


UNIT
-
4

(
I/O Management and Disk Scheduling
)


Q. Explain various Categories
of I/O Devices
.

Ans:


Three Categories:



Human readable



Machine readable



Communications


Human readable

Suitable for communicating with the computer user.





Devices used to commun
icate with the user



Printers and terminals



Video display



Keyboard



Mouse etc


Machine readable



Used to communicate with electronic equipment



Disk drives



USB keys



Sensors



Controllers



Actuators


Communication



Used to communicate with remote devices



Digital li
ne drivers



Modems

---------------------
-----------------------------------------------------------------------------
-------------------

Q. Explain
Differences in I/O Devices

with their Data Rate, Application, Transfer
Rate.?

Ans:

Devices differ in a number

of areas



Data Rate



Application



Complexity of Control



Unit of Transfer



Data Representation



Error Conditions

Subject:

OS(630004)



UNIT
-
4

PATEL GROUP OF INSTITUTIONS


DESIGN BY:

ASST.

PROF.VIKAS KATARIYA 8980936828

Page
2


Data Rate



May be massive difference between the data transfer rates of devices


Application



Disk used to store files requires file management softw
are



Disk used to store virtual memory pages needs special hardware and software to
support it



Terminal used by system administrator may have a higher priority

Complexity of control



A printer requires a relatively simple control interface.



A disk is much mo
re complex.



This complexity is filtered to some extent by the complexity of the I/O module that
controls the device
.

Unit of transfer



Data may be transferred as



a stream of bytes or characters (e.g., terminal I/O)




or in larger blocks (e.g., disk I/O).


Data representation

Different data encoding schemes are used by different devices,

including differences in
character code and parity conventions


Subject:

OS(630004)



UNIT
-
4

PATEL GROUP OF INSTITUTIONS


DESIGN BY:

ASST.

PROF.VIKAS KATARIYA 8980936828

Page
3


Error Conditions



The nature of errors differ widely from one device to another.



Aspects include:




the way in

which they are reported,



their consequences,



the available range of responses

----------------------------------------------------------------------------------------------------
----------------


Q. Describe brief
Evolution of the I/O Function
?

Ans:


1.

Th
e processor directly controls a peripheral device.



This is seen in simple microprocessor
-
controlled devices.

2.

A controller or I/O module is added.



The processor uses programmed I/O without interrupts.




With this step, the processor becomes somewhat divorce
d from the specific
details of external device interfaces.


3.

Now interrupts are employed.




The processor need not spend time waiting for an I/O operation to be
performed, thus increasing efficiency.

4.


The I/O module is given direct control of memory via DMA.





It can now move a block of data to or from memory without involving the
processor, except at the beginning and end of the transfer.


5.


I/O module is enhanced to become a separate processor, with a specialized
instruction set tailored for I/O.




CPU direct
s the I/O processor to execute an I/O program in main memory.




The I/O processor fetches and executes these instructions without processor
intervention.




Allowing the processor to specify a sequence of I/O activities and to be
interrupted only when the en
tire sequence has been performed.

6.


The I/O module has a local memory of its own and is, in fact, a computer in its own
right.




A large set of I/O devices can be controlled, with minimal processor
involvement.


Commonly used to control communications with i
nteractive terminals. The
I/O processor takes care of most of the tasks involved in controlling the
terminals.


Direct Memory Address



Processor delegates I/O operation to the DMA module
.



DMA module transfers data directly to or form memory
.



When complete D
MA module sends an interrupt signal to the processor
.

Subject:

OS(630004)



UNIT
-
4

PATEL GROUP OF INSTITUTIONS


DESIGN BY:

ASST.

PROF.VIKAS KATARIYA 8980936828

Page
4






DMA Configurations:

Single Bus




The DMA mechanism can be configured in a variety of ways.

Some possibilities are shown here In the first example, all modules share the same system
bus.

Subject:

OS(630004)



UNIT
-
4

PATEL GROUP OF INSTITUTIONS


DESIGN BY:

ASST.

PROF.VIKAS KATARIYA 8980936828

Page
5




The DM
A module, acting as a surrogate

(substitutes)

processor, uses programmed
I/O to exchange data between memory and an I/O module through the DMA
module.



This is clearly inefficient: As with processor
-
controlled programmed I/O, each
transfer of a word consum
es two bus cycles (transfer request followed by transfer).

-
-
----------------------------------------------------------------------------------------------------------

Q. What do you mean by File Allocation with respect to Secondary Storage

Management?
Dis
cuss Chained and Indexed allocation for file?

Q. What are typical operations that may be performed on a directory?

Q. Write a short note on different File Organization and Access methods.

Ans:

Files:



Files are the central element to most applications



file

as an input to applications



file as an output for long
-
term storage and for later access



Desirable properties of files:



Long
-
term existence



Controlled sharing between processes



Structure that is convenient for particular applications

FileStructure:

Fi
elds and Records



Fields



Basic element of data



e.g., student’s last name



Contains a single value



Characterized by its length and data type



Records



Collection of related fields



e.g., a student record



Treated as a unit


File and Database



File



Collection of
similar records



Treated as a single entity
and may be referenced by name




Access control restrictions usually apply at the file level




Database



Collection of related data



Explicit relationships exist among elements




Consists of one or more files

File Orga
nization:

Subject:

OS(630004)



UNIT
-
4

PATEL GROUP OF INSTITUTIONS


DESIGN BY:

ASST.

PROF.VIKAS KATARIYA 8980936828

Page
6




The basic operations that a user or application may perform on a file are performed
at the record level



The file is viewed as having some structure that organizes the records




File organization refers to the logical structuring of records



Determi
ned by the
way
in which files are accessed (access method)


Criteria for File Organization:



Important criteria include:



Short access time



Ease of update



Economy of storage



Simple maintenance



Reliability


The Sequential File:




Fixed format used for records



Records are of the same length



same number of fixed
-
length fields in a particular order



Only the values of fields need to be stored




Field name and length are attributes of the file structure




Key field



Uniquely identifies the record



Records are stored i
n key sequence



Optimal for batch applications if they involve the processing of all the records



Easily stored on tape and disk



Poor performance for interactive applications



considerable processing and delay due to the sequential search of the file for
a k
ey match


Indexed Sequential File:



An index is added to support random access

Subject:

OS(630004)



UNIT
-
4

PATEL GROUP OF INSTITUTIONS


DESIGN BY:

ASST.

PROF.VIKAS KATARIYA 8980936828

Page
7




An index record contains a key field and a pointer into the main file



The index is a sequential file



For searching



Search the index to find the highest key value that is equal t
o or
precedes the desired key value



Search continues in the main file at the location indicated by the
pointer




Consider searching a particular key value in a sequential file with 1 million records



without index



requires on average one
-
half million record

accesses



with an index containing 1000 entries with the keys in the index evenly
distributed over the main file



requires on average 500 accesses to the index file + 500 accesses to
the main file



An overflow file is added



A new record is added to the overf
low file and is located by following a
pointer from its predecessor record



The indexed sequential file is occasionally merged with the overflow file in
batch mode




Greatly reduces the time required to access a single record, without sacrificing the
sequen
tial nature.



Indexed File:



Records are accessed only through their indexes



no restriction on the placement of records



allows variable
-
length records



Uses multiple indexes for different key fields



An exhaustive index contains one entry for every record
in the main file



A partial index contains entries to records where the field of interest exists

Subject:

OS(630004)



UNIT
-
4

PATEL GROUP OF INSTITUTIONS


DESIGN BY:

ASST.

PROF.VIKAS KATARIYA 8980936828

Page
8


















Directory Elements
:



Basic Information



File name: must be unique



File type: e.g., text, binary



File organizat
ion



Address Information



Volume: device on which file is stored



Starting address: e.g., cylinder, track on disk



Size used: in bytes, words or blocks



Size allocated: maximum size of the file



Access Control Information



Owner: able to grant/deny access to
other users and to change these
privileges



Access information: e.g., user’s name and password for each authorized user



Permitted actions: controls reading, writing, executing, transmitting over a
network



Usage Information



Date Created, Identity of Creato
r, Date Last Read Access, Identity of Last
Reader, Date Last Modified
.





Hierarchical, or Tree
-
Structured Directory
:



Master directory with user directories underneath it



Each user directory may have subdirectories and files as entries



Each directory and su
bdirectory can be organized as a sequential file

Subject:

OS(630004)



UNIT
-
4

PATEL GROUP OF INSTITUTIONS


DESIGN BY:

ASST.

PROF.VIKAS KATARIYA 8980936828

Page
9




Naming
:



The tree structure allows users to find a file by following a path from the root or
master directory down various branches until the file is reached



The series of directory names, culminating in t
he file name itself, constitutes a
pathname

for the file

Duplicate filenames are possible if they have different pathnames




Usually an interactive user or a process is associated with a current or
working
directory



Files are referenced relative to the wo
rking directory unless an explicit full
pathname is used




Subject:

OS(630004)



UNIT
-
4

PATEL GROUP OF INSTITUTIONS


DESIGN BY:

ASST.

PROF.VIKAS KATARIYA 8980936828

Page
10


File Sharing
:



In multiuser system,
there is almost always a requirement for allowing files to be
shared among a number of users




Two issues



Access rights

Management of simultaneous access


Blocks

and records
:



Records are the logical unit of access of a structured file



Blocks are the unit for I/O with secondary storage



For I/O to be performed, records must be organized as blocks.



Three methods of blocking are common



Fixed length blocking



Variable

length spanned blocking



Variable
-
length unspanned blocking



Fixed Blocking
:



Fixed
-
length records are used, and an integral number of records are stored in a
block



Unused space at the end of a block is
internal fragmentation



Common for sequenti
al files with fixed
-
length records




Directory management:



At this layer, symbolic file names are converted to identifiers that either
reference the file directly or indirectly through a file descriptor or index
table.

Subject:

OS(630004)



UNIT
-
4

PATEL GROUP OF INSTITUTIONS


DESIGN BY:

ASST.

PROF.VIKAS KATARIYA 8980936828

Page
11





Concerned with user operations
that affect the directory of files, such as add,
delete, and reorganize.

File system
:




This layer deals with the logical structure of files and with the operations
that can be specified by users, such as open, close, read, write.




Access rights are also ma
naged at this layer.

Physical organization:




Files and records must be converted to physical secondary storage
addresses, taking into account the physical track and sector structure of the
secondary storage device.




Allocation of secondary storage space a
nd main storage buffers is generally
treated at this layer as well.



I/O Buffering


To avoid deadlock, the user memory involved in the I/O operation must be locked in
main memory immediately before the I/O request is issued, even though the I/O
operation
is queued and may not be executed for some time.




If a block is being transferred from a user process area directly to an I/O
module, then the process is blocked during the transfer and the process may
not be swapped out.

To avoid these overheads and ineff
iciencies, it is sometimes convenient to perform
input transfers in advance of requests being made and to perform output transfers
some time after the request is made.



Block
-
oriented Buffering



A block
-
oriented device stores information in blocks that are

usually of fixed
size, and transfers are made one block at a time.



Generally, it is possible to reference data by its block number.



Disks and USB keys are examples of block
-
oriented devices.




Stream
-
Oriented Buffering



A stream
-
oriented device tr
ansfers data in and out as a stream of bytes, with
no block structure.



Terminals, printers, communications ports, mouse and other pointing
devices, and most other devices that are not secondary storage are stream
oriented.


No Buffer



Without a buff
er, the OS directly access the device as and when it needs


Subject:

OS(630004)



UNIT
-
4

PATEL GROUP OF INSTITUTIONS


DESIGN BY:

ASST.

PROF.VIKAS KATARIYA 8980936828

Page
12



Single Buffer



Operating system assigns a buffer in main memory for an I/O request


Block Oriented Single Buffer

For block
-
oriented devices,




Input transfers are made to the system buffer.




Whe
n the transfer is complete, the process moves the block into user space
and immediately requests another block.

Called reading ahead, or anticipated input;




it is done in the expectation that the block will eventually be needed.

Often this is a reasonable

assumption most of the time because data are usually
accessed sequentially.


Only at the end of a sequence of processing will a block be read in unnecessarily.


Stream
-
oriented Single Buffer

The single buffering scheme can be used in a line
-
at
-
a
-
time fas
hion or a byte
-
at
-
a
-
time fashion.




Line
-
at
-
a
-
time operation is appropriate for scroll
-
mode terminals
(sometimes called dumb terminals).




Byte
-
at
-
a
-
time operation is used on where each keystroke is significant, or
for peripherals such as sensors and contro
llers.


Double Buffer



Use two system buffers instead of one



A process can transfer data to or from one buffer while the operating system
empties or fills the other buffer
.


Subject:

OS(630004)



UNIT
-
4

PATEL GROUP OF INSTITUTIONS


DESIGN BY:

ASST.

PROF.VIKAS KATARIYA 8980936828

Page
13



Circular Buffer



Double buffering
may

be inadequate

(insufficient)

if the process

performs rapid
(
speedly)
bursts of I/O.



The problem can often be alleviated

( overcome)

by using more than two buffers.



When more than two buffers are used, the collection of buffers is itself referred to as
a circular buffer with each individual buffer

being one

unit in the circular buffer.



Buffer Limitations

Buffering is a technique that smoothes out peaks in I/O demand.

However, no amount of buffering will allow an I/O device to keep pace with a process
indefinitely when the average demand of the p
rocess is greater than the I/O device can
service.



Even with multiple buffers, all of the buffers will eventually fill up and the
process will have to wait after processing each chunk of data.

However, in a multiprogramming environment, when there is a var
iety of I/O
activity and a variety of process activity to service, buffering is one tool that can
increase the efficiency of the operating system and the performance of individual
processes.

_______________________________________________________________
__
____________________________________


Q. Explain various
Disk Scheduling

Techniques?

Ans:


Disk Performance Parameters

The actual details of disk I/O operation depend on the computer system, the operating
system, and the nature of the I/O channel and disk
controller hardware.

A general timing diagram of disk I/O transfer is shown in Figure 11.6.



Subject:

OS(630004)



UNIT
-
4

PATEL GROUP OF INSTITUTIONS


DESIGN BY:

ASST.

PROF.VIKAS KATARIYA 8980936828

Page
14




Positioning the
Read/Write Heads



When the disk drive is operating, the disk is rotating at constant speed.



To read or write, the head must be positioned at the

desired track and at the
beginning of the desired sector on that track.



Track selection involves moving the head in a movable
-
head system or
electronically selecting one head on a fixed
-
head system.


Disk Performance Parameters

Access Time

is the sum of




Seek Time
is the time it takes to position the head at the track.



Rotational delay
is the time it takes for the beginning of the sector to reach
the head

Once the head is in position, the read or write operation is then performed as the sector
moves unde
r the head;




this is the data transfer portion of the operation; the time required for the
transfer is the
transfer time
.



Disk Scheduling Policies


First
-
in, first
-
out (FIFO)



The simplest form of scheduling is first
-
in
-
first
-
out (FIFO) scheduling, which

processes items from the queue in sequential order.



This strategy has the advantage of being fair, because every request is honored and
the requests are honored in the order received.


STEPS:



Handle I/O requests sequentially.



Fair to all processes.



Appr
oaches random scheduling in performance if there are many
processes/requests.



Suffers from global zigzag effect.



Subject:

OS(630004)



UNIT
-
4

PATEL GROUP OF INSTITUTIONS


DESIGN BY:

ASST.

PROF.VIKAS KATARIYA 8980936828

Page
15




45+85+146+85+108+110+59+2=640 Cylinders

Total Head Movement= 640 Cylinders

--------------------------------------------------------------
----------------------------------------------------

2. SSTF (
Shortest Service Time First

)


Select the disk I/O request that requires the least movement of the disk arm from its
current position.


Thus, we always choose to incur the minimum seek time.



Al
ways choosing the minimum seek time does not guarantee that the average
seek time over a number of arm movements will be minimum.



However, this should provide better performance than FIFO.

Because the arm can move in two directions, a random tie
-
breaking
algorithm may be used
to resolve cases of equal distances.



STEPS:




Selects the request with the minimum seek time from the current head position.



Also called Shortest Seek Distance First (SSDF)


It’s easier to compute distances.



It’s biased in favor of
the middle cylinders requests.



SSTF scheduling is a form of SJF scheduling; may cause starvation of some requests

Subject:

OS(630004)



UNIT
-
4

PATEL GROUP OF INSTITUTIONS


DESIGN BY:

ASST.

PROF.VIKAS KATARIYA 8980936828

Page
16





Total Head Movements:

12+2+30+23+84+24+2+59=236 Cylinders

------------------------------------------------------------------------------
------------------------------


3.
Elevator
(Lift)
Algorithms



Algorithms based on the common elevator principle.




Four combinations of Elevator algorithms:




Service in both directions or in only one direction.


Go until last cylinder or until last I/O re
quest.

Subject:

OS(630004)



UNIT
-
4

PATEL GROUP OF INSTITUTIONS


DESIGN BY:

ASST.

PROF.VIKAS KATARIYA 8980936828

Page
17


















3.
SCAN




The disk arm starts at one end of the disk, and moves toward the other end,
servicing requests until it gets to the other end of the disk, where the head
movement is reversed and servicing continues.



It moves in both dir
ections until both ends.

Tends to stay more at the ends so more fair to the extreme cylinder requests.

Subject:

OS(630004)



UNIT
-
4

PATEL GROUP OF INSTITUTIONS


DESIGN BY:

ASST.

PROF.VIKAS KATARIYA 8980936828

Page
18





Total Head Movements: 16+23+14+65+2+31+24+2+59=236 Cylinders

----------------------------------------------------------------------------------------
------------------------

4.
C
-
SCAN

(
Circular

Elevator)



The head moves from one end of the disk to the other, servicing requests as it goes.
When it reaches the other end, however, it immediately returns to the beginning of
the disk, without servicing any r
equests on the return trip.



Treats the cylinders as a circular list that wraps around from the last cylinder to the
first one.



Provides a more uniform wait time than SCAN; it treats all cylinders in the same
manner.

Subject:

OS(630004)



UNIT
-
4

PATEL GROUP OF INSTITUTIONS


DESIGN BY:

ASST.

PROF.VIKAS KATARIYA 8980936828

Page
19




Total head Movements:12+2+31+24+2+59
+75+199+23=427 Cylinders

-------------------------------------------------------------------------------------------------------------------

5.
Look



The disk arm starts at the first I/O request on the disk, and moves toward the last
I/O request on the othe
r end, servicing requests until it gets to the other extreme
I/O request on the disk, where the head movement is reversed and servicing
continues.



It moves in both directions until both last I/O requests; more inclined to serve the
middle cylinder requests
.


Total Head Movements:
16+23+51+2+31+24+2+59+16= 224 Cylinders

------------------------------------------------------------------------------------------------------------

C
-
Look

(Circular Look)



Look version of C
-
Scan.



Arm only goes as far as the last r
equest in each direction, then reverses direction
immediately, without first going all the way to the end of the disk.



In general, Circular versions are more fair but pay with a larger total seek time.



Scan versions have a larger total seek time than the

corresponding Look versions.

Subject:

OS(630004)



UNIT
-
4

PATEL GROUP OF INSTITUTIONS


DESIGN BY:

ASST.

PROF.VIKAS KATARIYA 8980936828

Page
20




Total Head Movements: 16+23+169+59+2+24+31+2=326 Cylinders

-----------------------------------------------------------------------------------------------------------------

Performance Compared

Comparison of Disk Schedulin
g Algorithms


Disk Scheduling Algorithms

Subject:

OS(630004)



UNIT
-
4

PATEL GROUP OF INSTITUTIONS


DESIGN BY:

ASST.

PROF.VIKAS KATARIYA 8980936828

Page
21





Q. Explain various
RAID

Model?

Ans:

Disks have high failure rates and hence there is the risk of loss of data and l
ots of downtime
for restoring and disk replacement. To improve disk usage many techniques have been
implemented. One such technology is RAID(
redundant array of inexpensive disks)
. Its
organization is based on disk striping which uses a group of disks as on
e storage unit.

Disk striping is a way of increasing the disk transfer rate up to a factor of N, by splitting
files across N different disks. Instead of saving all the data from a given file on one disk.

Logical disk data/blocks can be written on two or mo
re separate physical disks.

RAID (redundant array of independent disks; originally
redundant array of inexpensive
disks
) is a way of storing the same data in different places (thus, redundantly) on multiple
hard disk
s. By placing data on multiple disks,
I/O

(input/output) operations can overlap in
a balanced way, improving per
formance. Since multiple disks increase the mean time
between failures (
MTBF
), storing data redundantly also increases
fault tolerance
.

A RAID appears to the operating system to be a single logical hard disk. RAID employs the
technique of
disk stri
ping
, which involves partitioning each drive's storage space into units
ranging from a sector (512 bytes) up to several megabytes. The stripes of all the disks are
interleaved and addressed in order.

Subject:

OS(630004)



UNIT
-
4

PATEL GROUP OF INSTITUTIONS


DESIGN BY:

ASST.

PROF.VIKAS KATARIYA 8980936828

Page
22


RAID is the
organization of multiple disks

into a large
, high performance logical disk.
Disk arrays stripe data across multiple disks and
access them in parallel

to achieve:



Higher data transfer rates on large data accesses

and



Higher I/O rates on small data accesses
.

There are 2 important concepts to be un
derstood in the design and implementation
of disk arrays:

1.

Data striping, for improved performance.

2.

Redundancy for improved availability.


Disadvantages due to Redundancy



Every time there is a write operation, there is a change of data. This change also,
has
to be reflected in the disks storing redundant information. This
worsens the
performance of writes

in redundant disk arrays significantly compared to the
performance of writes in non redundant disk arrays

RAID level 0


Striping



This level refers to di
sk arrays with striping at the level of blocks but without any
redundancy(such as mirroring or parity bits).

In a RAID 0 system data are split up in blocks that get written across all the drives in the
array. By using multiple disks (at least 2) at the sam
e time, this offers superior I/O
performance. This performance can be enhanced further by using multiple controllers,
ideally one controller per disk.


Subject:

OS(630004)



UNIT
-
4

PATEL GROUP OF INSTITUTIONS


DESIGN BY:

ASST.

PROF.VIKAS KATARIYA 8980936828

Page
23


Advantages



RAID 0 offers great performance, both in read and write operations. There is no
overhead ca
used by parity controls.



All storage capacity is used, there is no disk overhead.



The technology is easy to implement.

Disadvantages

RAID 0 is not fault
-
tolerant. If one disk fails, all data in the RAID 0 array are lost. It should
not be used on mission
-
cr
itical systems.

Ideal use

RAID 0 is ideal for non
-
critical storage of data that have to be read/written at a high speed,
such as on a Photoshop image retouching station.

RAID level 1


Mirroring

This type is also known as
disk mirroring

and consists of at
least two drives that duplicate
the storage of data

Data are stored twice by writing them to both the data disk (or set of data disks) and a
mirror disk (or set of disks) . If a disk fails, the controller uses either the data drive or the
mirror drive for
data recovery and continues operation. You need at least 2 disks for a
RAID 1 array.


Subject:

OS(630004)



UNIT
-
4

PATEL GROUP OF INSTITUTIONS


DESIGN BY:

ASST.

PROF.VIKAS KATARIYA 8980936828

Page
24


RAID 1 systems are often combined with RAID 0 to improve performance. Such a system is
sometimes referred to by the combined number: a RAID 10 system.

Advantages



RAID 1
offers excellent read speed and a write
-
speed that is comparable to that of a
single disk.



In case a disk fails, data do not have to be rebuild, they just have to be copied to the
replacement disk.



RAID 1 is a very simple technology.

Disadvantages



The main

disadvantage is that the effective storage capacity is only half of the total
disk capacity because all data get written twice.



Software RAID 1 solutions do not always allow a hot swap of a failed disk (meaning
it cannot be replaced while the server keeps

running). Ideally a hardware controller
is used.

RAID level 2:
it is also known as
memory style error correcting code (ECC)

organization.



Memory systems have long detected certain errors by using parity bits. Each byte in
memory system may have a parity

bit associated with it that records. The idea of
ECC can be used directly in disk arrays via stripping of bytes across disk. For
example the first bit of each byte can be stored in disk 1, the second bit in disk 2, and
so on until the eight bit is stored
in disk 8. The error correction bits are stored in
further disks. If one of disk fails the remaining bits of the byte and the associated
error correction bits can be read from other disks and used to reconstruct the
damaged data.

If a single component fa
ils, several of the parity components will have inconsistent
values, and the failed component is the one held in common by each incorrect
subset. The lost information is recovered by reading the other components in a
subset, including the parity component,

and setting the missing bit to 0 or 1 to
create proper parity value for that subset. Thus, multiple redundant disks are
needed to identify the failed disk, but only one is needed to recover the lost
information.

RAID level 3

(Bit
-
Interleaved Parity Organ
ization)

Subject:

OS(630004)



UNIT
-
4

PATEL GROUP OF INSTITUTIONS


DESIGN BY:

ASST.

PROF.VIKAS KATARIYA 8980936828

Page
25


On RAID 3 systems, data blocks are subdivided (striped) and written in parallel on two or
more drives. An additional drive stores parity information. You need at least 3 disks for a
RAID 3 array.


Since parity is used, a RAID 3 stripe set can wit
hstand a single disk failure without losing
data or access to data.



Unlike memory systems, disk controllers can detect whether a sectors has
been read correctly, so a single parity bit can be used for error correction as
well as for detection. The idea is

as follows: if one of the sectors is damaged,
we know exactly which sector it is and we can figure out whether any bit in
the sector is a 1 or a 0 by computing the parity of the corresponding bits
from sectors in the other disks. If the parity of remainin
g bits is equal to the
stored parity the missing bit is 0; otherwise it is 1.

Advantages



RAID
-
3 provides high throughput (both read and write) for large data transfers.



Disk failures do not significantly slow down throughput.

Disadvantages



This technology
is fairly complex and too resource intensive to be done in software.



Performance is slower for random, small I/O operations.


Subject:

OS(630004)



UNIT
-
4

PATEL GROUP OF INSTITUTIONS


DESIGN BY:

ASST.

PROF.VIKAS KATARIYA 8980936828

Page
26


RAID level 4: Block
-
Interleaved Parity ORGANIZATION


The block
-
interleaved, parity disk array is similar to the bit
-
interleaved, p
arity disk array
except that data is interleaved across disks of arbitrary size rather than in bits. The size of
these blocks is called the striping unit. Read requests smaller than the striping unit access
only a single data disk.

Uses block


level stri
ping, as in RAID 0, and in addition keeps a parity block on a separate
disk for corresponding block from N other disks. If one of the disks fails, the parity block
can be used with the corresponding blocks from the other disks to restore the blocks of the
failed disk.

RAID level 5



RAID level 5 : Block
-
Interleaved Distributed
-
Parity

RAID level 5 differs from
level 4 by spreading data and parity among N+1 disks. Rather than storing data in N
disks and parity in one disk. For each block one of the disks store
s the parity and the
others store data. A parity block can not store parity for blocks in the same disk,
because a disk failure would result in loss of data as well as of parity, and hence the
loss would not be recoverable.




The block
-
interleaved distrib
uted
-
parity disk array eliminates the parity disk
bottleneck present in the block
-
interleaved parity disk array by distributing the
parity uniformly over all of the disks. An additional, frequently overlooked
advantage to distributing the parity is that it

also distributes data over all of the
disks rather than over all but one. This allows all disks to participate in servicing
read operations in contrast to redundancy schemes with dedicated parity disks in
which the parity disk cannot participate in servic
ing read requests. Block
-
interleaved distributed
-
parity disk array have the best small read, large write
performance of any redundancy disk array. Small write requests are somewhat
inefficient compared with redundancy schemes such as mirroring however, due

to
the need to perform read
-
modify
-
write operations to update parity. This is the
major performance weakness of RAID level 5 disk arrays.

Advantages

Read data transactions are very fast while write data transaction are somewhat slower
(due to the parity
that has to be calculated).

Disadvantages



Disk failures have an effect on throughput, although this is still acceptable.



Like RAID 3, this is complex technology.

Subject:

OS(630004)



UNIT
-
4

PATEL GROUP OF INSTITUTIONS


DESIGN BY:

ASST.

PROF.VIKAS KATARIYA 8980936828

Page
27




RAID Level 6 : P+Q redundancy


scheme

It is much like RAID level 5 but stores extra redundant

information to guard against
multiple disk failures. Instead of parity, error correcting codes such as the Reed


Solomon codes are used. 2 bits of redundant data are stored for every 4 bits of data
compares with 1 parity bit in level 5


and system can t
olerate two disk failures.

RAID level 10


Combining RAID 0 & RAID 1

RAID 10 combines the advantages (and disadvantages) of RAID 0 and RAID 1 in one single
system. It provides security by mirroring all data on a secondary set of disks (disk 3 and 4
in the
drawing below) while using striping across each set of disks to speed up data
transfers.


What about RAID levels 2, 4, 6 and 7?

Subject:

OS(630004)



UNIT
-
4

PATEL GROUP OF INSTITUTIONS


DESIGN BY:

ASST.

PROF.VIKAS KATARIYA 8980936828

Page
28


These levels do exist but are not that common, at least not in prepress environments. This
is just a simple introduction to RAI
D
-
system. You can find more in
-
depth information on
the pages of
wikipedia

or
ACNC
.

RAID is no substitute for back
-
up!

All RAID levels except RAID 0 offer protection from a single drive failure. A RAID 6 system
even survives 2 disks dying simultaneously. For complete security you do still need to
back
-
up the data
from a RAID system.



That back
-
up will come in handy if all drives fail simultaneously because of a power
spike.



It is a safeguard if the storage system gets stolen.



Back
-
ups can be kept off
-
site at a different location. This can come in handy if a
natural
disaster or fire destroys your workplace.



The most important reason to back
-
up multiple generations of data is user error. If
someone accidentally deletes some important data and this goes unnoticed for
several hours, days or weeks, a good set of back
-
ups
ensure you can still retrieve
those files.

Q.Write short notes on following:

(i) RAID

(ii) Clustering

(iii) Security Threats


(i).
RAID : Mentioned Above.


(ii).
Clustering :

Data clustering is a method in which we make cluster of objects that are somehow
similar in characteristics. The criterion for checking the similarity is implementation
dependent.


Example to Elaborate the Idea of Clustering


In order to elaborate the concept a little bit, let us take the example of the library
system. In a library boo
ks concerning to a large variety of topics are available. They
are always kept in form of clusters. The books that have some kind of similarities
among them are placed in one cluster. For example, books on the database are kept
in one shelf and books on op
erating systems are kept in another cupboard, and so
on. To further reduce the complexity, the books that cover same kind of topics are
Subject:

OS(630004)



UNIT
-
4

PATEL GROUP OF INSTITUTIONS


DESIGN BY:

ASST.

PROF.VIKAS KATARIYA 8980936828

Page
29


placed in same shelf. And then the shelf and the cupboards are labeled with the
relative name. Now when a user wants a b
ook of specific kind on specific topic, he or
she would only have to go to that particular shelf and check for the book rather than
checking in the entire library.

Some Useful Key terms
:

Cluster

A cluster is an ordered list of objects, which have some co
mmon characteristics. The
objects belong to an interval [a , b], in our case [0 , 1] [1]

Distance Between Two Clusters

The distance between two clusters involves some or all elements of the two clusters. The
clustering method determines how the distance sh
ould be computed. [1]


Similarity

A similarity measure SIMILAR ( Di, Dj ) can be used to represent the similarity between the
documents. Typical similarity generates values of 0 for documents exhibiting no agreement
among the assigned indexed terms, and 1
when perfect agreement is detected.
Intermediate values are obtained for cases of partial agreement. [1]

TYPES OF CLUSTERING METHODS


1.

Partitioning Methods:

(i).
Make the first object the centroid for the first cluster.

(ii).
For the next object, calculate t
he similarity, S, with each existing cluster centroid,
using some similarity coefficient.

(iii).
If the highest calculated S is greater than some specified threshold value, add
the object to the corresponding cluster and re determine the centroid; otherwise
,
use the object to initiate a new cluster. If any objects remain to be clustered, return
to step 2.

2.

Hierarchical Agglomerative methods:

(i),
Find the 2 closest objects and merge them into a cluster

Subject:

OS(630004)



UNIT
-
4

PATEL GROUP OF INSTITUTIONS


DESIGN BY:

ASST.

PROF.VIKAS KATARIYA 8980936828

Page
30


(ii).
Find and merge the next two closest points, where a

point is either an individual
object or a cluster of objects.

(iii).
If more than one cluster remains , return to step 2

3.

The Single Link Method (SLINK):

The single link method is probably the best known of the hierarchical methods and
operates by joining,
at each step, the two most similar objects, which are not yet in
the same cluster. The name single link thus refers to the joining of pairs of clusters
by the single shortest link between them.

4.

The Complete Link Method (CLINK):

The complete link method is
similar to the single link method except that it uses the
least similar pair between two clusters to determine the inter
-
cluster similarity (so
that every cluster member is more like the furthest member of its own cluster than
the furthest item in any othe
r cluster ). This method is characterized b
y small,
tightly bound clusters.

Applications:



Similarity searching in Medical Image Database



Data Mining



Windows NT

Q. What are typical operations that may be performed on a directory?

Ans: Operations Performed
on a Directory :


Search
:
When a user or application references a file, the directory must be searched to find
the entry corresponding to that file.


Create file:
When a new file is created, an entry must be added to the directory.


Delete file:
When a fil
e is deleted, an entry must be removed from the directory.


List directory:
All or a portion of the directory may be requested. Generally, this request is
made by a user and results in a listing of all files owned by that user, plus some of the
attributes
of each file


Update directory:
Because some file attributes are stored in the directory, a change in one
of these attributes requires a change in the corresponding directory entry.


Subject:

OS(630004)



UNIT
-
4

PATEL GROUP OF INSTITUTIONS


DESIGN BY:

ASST.

PROF.VIKAS KATARIYA 8980936828

Page
31


Q. What is difference between passive and active security threats?

Ans:

Passive attack:



It is indirect attack.

The attacked host is completely unaware about this,

hence it is
called passive attack.

Like as,

the attacker is trying to observe the host.

So in passive attack a hacker intrudes your system, and waits for some valua
ble
information.

An example could be: A keylogger which sends the input given by the victim to
a hacker via a network(LAN or Internet whatever).


Active attack:



From the word active,

it is clear that it is nothing but direct attack.

In this case the
att
acked one gets aware of the attack.

Suppose,

someone installed a logic bomb to
your PC & after clicking on it,

your PC starts to be shutdown.



In an active attack a hacker tries to get the valuable information by using his
abilities rather than depending on

the stupidity of the victim.

An example could be: Using Brute force to crack the password of a system.

-----------------------------------------------------------------------------------------------------------


Q. What do you mean by File Allocation wit
h respect to Secondary Storage

Management? Discuss Chained and Indexed allocation for file?

Ans:


Chained Allocation
:


Typically, allocation is on an individual block basis.



Each block contains a pointer to the next block in the chain.

The file allocation
table needs just a single entry for each file, showing the starting block
and the length of the file.

Although pre

allocation is possible, it is more common simply to allocate blocks as needed.




The selection of blocks is now a simple matter: any free bloc
k can be added
to a chain.




There is no external fragmentation to worry about because only one block at
a time is needed.

This type of physical organization is best suited to sequential files that are to be processed
sequentially.




To select an individual

block of a file requires tracing through the chain to
the desired block.



Subject:

OS(630004)



UNIT
-
4

PATEL GROUP OF INSTITUTIONS


DESIGN BY:

ASST.

PROF.VIKAS KATARIYA 8980936828

Page
32





Indexed Allocation
:


This addresses many of the problems of contiguous and chained allocation.

In this case, the file allocation table contains a separate one
-
level index for
each file;




the index has one entry for each portion allocated to the file.

Typically, the file indexes are not physically stored as part of the file allocation table.




Rather, the file index for a file is kept in a separate block, and the entry for
the
file in the file allocation table points to that block.




Indexed Allocation Method


Allocation may be on the basis of either




fixed
-
size blocks or



variable
-
size portions

Allocation by blocks eliminates external fragmentation,




where

as allocation by var
iable
-
size portions improves locality.

In either case, file consolidation may be done from time to time.


File consolidation reduces the size of the index in the case of variable
-
size portions, but not
in the case of block allocation.

Subject:

OS(630004)



UNIT
-
4

PATEL GROUP OF INSTITUTIONS


DESIGN BY:

ASST.

PROF.VIKAS KATARIYA 8980936828

Page
33




----------------
--------------------------------------------------------------------------------------------------

Q.
Indicate various types of threats to security of computer systems and

networks.

Ans:

Security definition:



The NIST Computer Security Handbook defines
comp
uter security
as:



The protection afforded to an automated information system in order to
attain the applicable objectives of preserving the integrity, availability and
confidentiality of information system resources

Three key objectives are at the heart of

computer security
:

Confidentiality:
Covering two related concepts:



Data confidentiality:
Assures that private or confidential information is not
made available or disclosed to unauthorized individuals


Privacy:
Assures that individuals control or influe
nce what information related to
them may be collected and stored and by whom and to whom that information may
be disclosed

Integrity:

Also covers two related concepts:


Data integrity:
Assures that information and programs are changed only in a
specified a
nd authorized manner

Subject:

OS(630004)



UNIT
-
4

PATEL GROUP OF INSTITUTIONS


DESIGN BY:

ASST.

PROF.VIKAS KATARIYA 8980936828

Page
34



System integrity:
Assures that a system performs its intended function in an
unimpaired manner, free from deliberate or inadvertent unauthorized manipulation
of the system

Availability:
Assures that systems work promptly and service i
s not denied to authorized
users



Various Types of threats in Computer Security:

1. Errors and Omissions

Errors and omissions are an important threat to data and system integrity. These errors are caused
not only by data entry clerks processing hundreds
of transactions per day, but also by all types of
users who create and edit data. Users, data entry clerks, system operators, and programmers
frequently make errors that contribute directly or indirectly to security problems. In some cases,
the error is th
e threat, such as a data entry error or a programming error that crashes a system. In
other cases, the errors create vulnerabilities. Errors can occur during all phases of the systems
life cycle.

2. Fraud and Theft

Computer systems can be exploited for bo
th fraud and theft both by "automating" traditional
methods of fraud and by using new methods. For example, individuals may use a computer to
skim small amounts of money from a large number of financial accounts, assuming that small
discrepancies may not b
e investigated. Financial systems are not the only ones at risk. Systems
that control access to any resource are targets (e.g., time and attendance systems, inventory
systems, school grading systems, and long
-
distance telephone systems). Computer fraud and

theft can be committed by insiders or outsiders. Insiders (i.e., authorized users of a system) are
responsible for the majority of fraud.

3. Employee Sabotage

Subject:

OS(630004)



UNIT
-
4

PATEL GROUP OF INSTITUTIONS


DESIGN BY:

ASST.

PROF.VIKAS KATARIYA 8980936828

Page
35


Employees are most familiar with their employer's computers and applications, including
knowin
g what actions might cause the most damage, mischief, or sabotage. The downsizing of
organizations in both the public and private sectors has created a group of individuals with
organizational knowledge, who may retain potential system access (e.g., if sys
tem accounts are
not deleted in a timely manner). The number of incidents of employee sabotage is believed to be
much smaller than the instances of theft, but the cost of such incidents can be quite high.

4. Loss of Physical and Infrastructure Support

Th
e loss of supporting infrastructure includes power failures (outages, spikes, and brownouts),
loss of communications, water outages and leaks, sewer problems, lack of transportation
services, fire, flood, civil unrest, and strikes.

5. Malicious Hackers

T
he term malicious hackers, sometimes called crackers, refers to those who break into computers
without authorization. They can include both outsiders and insiders. Much of the rise of hacker
activity is often attributed to increases in connectivity in both

government and industry. One
1992 study of a particular Internet site (i.e., one computer system) found that hackers attempted
to break in at least once every other day. The hacker threat should be considered in terms of past
and potential future damage.
Although current losses due to hacker attacks are significantly
smaller than losses due to insider theft and sabotage, the hacker problem is widespread and
serious.


*************************************************************************************