Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
30 views20 pages

RAID, IOMan, Buffer

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 20

Parity Stored in strip wise

Disadv : Suppose if disk 3 fails


Parity stored in block-wise
Disadv : Suppose if disk 3 fails
A disk stores only one parity
Disk will store 2 parity so N+2
IO Management
Buffering

The buffer is an area in the main memory used to store or hold the data temporarily. In other words,
buffer temporarily stores data transmitted from one place to another, either between two devices or
an application. The act of storing data temporarily in the buffer is called buffering.

In operating systems, buffering is a technique which is used to enhance the performance of I/O
operations of the system.

In a computer system, data is stored on several devices like hard discs, magnetic tapes, optical discs
and network devices. In the case, when a process requires to read or write data from one of these
storage devices, it has to wait while the device retrieves or stores the data. This waiting time could
be very high, especially for those devices which are slow or have a high latency.

This problem can be addressed by buffering. Buffering provides a temporary storage area, called
buffer. Buffer can store data before it is sent to or retrieved from the storage device.
Time at which In operation performed we can not perform Move operation
File Concept
A file is a named collection of related information that is recorded on secondary storage such as
magnetic disks, magnetic tapes and optical disks. In general, a file is a sequence of bits, bytes, lines or
records whose meaning is defined by the files creator and user.

Different types of files are:

Executable file

In an executable file, the binary code that is loaded in the memory for execution is stored. It
is stored in an exe type file.

Source file

The source file has subroutines and functions that are compiled later.

Text file

A text file is a sequence of characters.

Image file

An image file is a sequence of visual information, for example, vector art.


File Attributes

Some of the common file attributes are:

1. Only the user can edit the name they have assigned to a file.
2. A unique number tag is given to every file. It cannot be read by the user and is used
by the file system to identify the file.
3. The time, date, and user identification are maintained to access the information about
which date the file was created, edited, or last accessed.
4. The type of the file is easily identified.
5. The size of the file in bits, bytes, or Kilobytes.
6. Access control can be defined by the user, as to who can access the files to read,
write, edit or delete the information stored in them.

Directory
A directory is a container that is used to contain folders and files. It organizes files and folders in a
hierarchical manner.

Directory can be defined as the listing of the related files on the disk. The directory may store some
or the entire file attributes.

There are several logical structures of a directory, these are given below.

1) Single-level directory:

The single-level directory is the simplest directory structure. In it, all files are contained in
the same directory which makes it easy to support and understand.
2) Two-level directory:

As we have seen, a single level directory often leads to confusion of files names among
different users. The solution to this problem is to create a separate directory for each user.

3) Tree Structure/ Hierarchical Structure:

Tree directory structure of operating system is most commonly used in our personal
computers. User can create files and subdirectories too, which was a disadvantage in the
previous directory structures.
4) Acyclic Graph Structure:

File in one directory can be accessed from multiple directories. In this way, the files could be shared
in between the users.

File Access Methods

File access methods in OS are nothing but techniques to read data from the system's memory.
There are various ways in which we can access the files from the memory like:

• Sequential Access
• Direct/Relative Access, and
• Indexed Sequential Access.

1. Sequential Access

The operating system reads the file word by word in sequential access method of file
accessing.

A pointer is made, which first links to the file's base address. If the user wishes to read the
first word of the file, the pointer gives it to them and raises its value to the next word.
2. Direct (or Relative) Access

A Direct/Relative file access mechanism is mostly required with the database systems.

In the majority of the circumstances, we require filtered/specific data from the database, and
in such circumstances, sequential access might be highly inefficient.

The direct access mechanism requires the OS to perform some additional tasks but eventually
leads to much faster retrieval of records as compared to the sequential access.

3. Indexed Sequential Access

The indexes, similar to a book's index (pointers), contain a link to various blocks present in
the memory.

This method is practically similar to the pointer to pointer concept in which we store an
address of a pointer variable containing address of some other variable/record in another
pointer variable.
Primary index blocks contain the links of the secondary inner blocks which contains links to
the data in the memory.

File Allocation Methods


The allocation methods define how the files are stored in the disk

There are three main disk space or file allocation methods.

• Contiguous Allocation
• Linked Allocation
• Indexed Allocation

The main idea behind these methods is to provide:

• Efficient disk space utilization.


• Fast access to the file blocks.

1. Contiguous Allocation

In this scheme, each file occupies a contiguous set of blocks on the disk.

The directory entry for a file with contiguous allocation contains

• Address of starting block


• Length of the allocated portion.
2. Linked List Allocation

In this scheme, each file is a linked list of disk blocks which need not be contiguous.

The directory entry contains a pointer to the starting and the ending file block. Each block
contains a pointer to the next block occupied by the file.

3. Indexed Allocation

In this scheme, a special block known as the Index block contains the pointers to all the
blocks occupied by a file.

The directory entry contains the address of the index block.

File protection

File protection in an operating system refers to the various mechanisms and techniques used
to secure files from unauthorized access, alteration, or deletion

These are the following operations that can be controlled:

1. Delete
2. Append : To write new info at the end of the file
3. Execute : To load into memory
4. Read
5. Write

Approach for protection

A list is created called the access-control list(ACL) which enlists the names of users and the
type of access granted to them.

However, it is very long as all the users need to be listed down. We have to know in advance
for all the user who are going to access Files

To resolve this situation and condense the length of access-control list, the following
classifications are used:

1. Owner: The user who created the file.


2. Group: The set of users sharing the same file.
3. Universe: All the other users.

You might also like