6.file Management
6.file Management
File Management
6.0.Introduction
• File
• --A file is a method collection of related information that is recorded on secondary
storage such as magnetic disks,magnetic tapes and optical disks.
• --Commonly files represent programs and data .data files may be
numeric ,alphabetic ,alphanumeric or binary.
• --In general a file is sequence of Bits, bytes lines or records whose meaning is
Defined by the files creator and user .The information in a file is defined by its
creator .
• -Many different types of information may be stored in a file source program,object
programs, executable programs ,numeric data ,text ,payroll records ,graphic
images, sound recording and so on.
• A file has a certain defined structure according to its types. A text file is a sequence
of character organized into lines .A source file is sequence of subroutine and
functions each of which is further organized as declaration followed by executable
statement .
• An object file is a sequence of bytes organized into blocks understandable by the
systems linker .An executable file is a series of code sections that the loader can be
bring into memory and execute.
6.1.1.Concept
• 1.The operating system extracts from the physical properties of its storage device
to define a logical storage unit called as a file. files are mapped by the operating
system on to the physical devices.
• 2.The information in a file is a defined by its creator. Many different types of
information may be stored in a file like source programs, object programs,
executable programs ,numeric data, text, payroll records, graphic images, sound
recording and so on.
• 3. A file has a certainly find the structure according to its types.
• 4. Text to file is a sequence of characters organized into lines; a source file is a
sequence of subroutines and functions each of which is further organized as a
declaration followed by executable statements.
• 5. An object file is a sequence of bytes organized into blocks understandable by the
system’s linker.
• 6. An executable file is a series of code sections that the loader can bring into
memory and execute. file is defined as “collection of related data or A file is a
“collection of data or information”.
6.1.2.File Attributes
• 1.Name
• Every file carries a name by which the file is recognized in the file system. One directory cannot have two
files with the same name.
• 2.Identifier
• Along with the name, Each File has its own extension which identifies the type of the file. For example, a
text file has the extension .txt, A video file can have the extension .mp4.
• 3.Type
• In a File System, the Files are classified in different types such as video files, audio files, text files,
executable files, etc.
• 4.Location
• In the File System, there are several locations on which, the files can be stored. Each file carries its location
as its attribute.
• 5.Size
• The Size of the File is one of its most important attribute. By size of the file, we mean the number of bytes
acquired by the file in the memory.
• 6.Protection
• The Admin of the computer may want the different protections for the different files. Therefore each file
carries its own set of permissions to the different group of Users.
• 7.Time and Date
• Every file carries a time stamp which contains the time and date on which the file is last modified.
• 8.Creator or owner:
• A creator is a user or a person who has created that file and the owner is a person who owns that file
internally.
6.1.3.File Operations
• A file is a collection of logically related data that is recorded on the secondary storage in the
form of sequence of operations. The content of the files are defined by its creator who is
creating the file. The various operations which can be implemented on a file such as read,
write, open and close etc. are called file operations.
• 1.Create a file:
--Two Steps are necessary to create a file. First space in the file system must be found
for the file. Second an entry for the new file must be made in the directory. The
directory entry records the name of the file and the location in the file system.
• 2.Writing a file:
--To write a file ,we make a system call specifying both the name of the file and the
information to be returned to the file.Given the name of the file, the system searches the
directory to find the location of the file then the write pointer must be updated whenever a
write occurs.
• 3.Reading a file:
--To read from a file we use system call that specifies the name of the file and where the next
block of the file should be put.System needs to be keep read pointer to location in the file
where the next read is to take place. once the read has taken place the read pointer is
updated.
• 4.Reposioning within a file:
--The directory is a searched for the appropriate entry and the current file position
is said to a given value. Repositioning within a file does not need to involve any
actual I/O. This file operation is known as a file seeks.
• 5.Deleting a file:
• --Deleting the file will not only delete all the data stored inside the file it is also
used so that disk space occupied by it is freed. In order to delete the specified file
the directory is searched. When the directory entry is located, all the associated
file space and the directory entry is released.
• 6.Truncating a file:
• --Truncating is simply deleting the file except deleting attributes. The file is not
completely deleted although the information stored inside the file gets replaced.
6.1.4.File Types
File
ExchangeManagement Exchange F
bytes System blocks
File System
•
Files Disk
1. Users create and store data in a computer system for later reteieval and manipulation.the
computer system normally stores data in storage device such as a disks so that the data
survive power disconnection.
2. The software layer is a called the file management system and sometimes it is called file
system.
3. The file management system provide an abstraction of software objects called files. collection
of files comprises a file system.
4. file system organizes of particular Storage Area as a collection of “access unit” called blocks
and these blocks collectively store of single file system.
5. Figure shows file system software architecture the file system structure must be designed in a
such a way that the capacity of hard disk is optimally utiliszed without slowing the process of
retrieving the data from file .
The goal of the file system structure and as follows:
1. The required information should be retrieved with a single access to the
disk. If the required information is infeasible to retrieve with one access then it
should include as many few access to the disk as possible.
2. The related information on the disk should be grouped at a single place so
that it is easy to retrieve all the related information.
User Programs
Logical I/O
/(root)
File System
• n
Index
Levels
Main File
2
Index
1
Overflow file
• 1. An indexed sequential file is sequential file in which the records are indexed.An
index sequential file is an improvement over a sequential file.
• 2. Two features are added in this file namely, an index to the fire to support Random
Access and an overflow file.
• 3. Indexing of records provides the facility of searching the records randomly. An
indexed file is a simple sequential file that contains an index as its records.
• 4. Entries in index the files are made up of two fields the key field which is the same
as key field in the main file and a pointer pointing to some record in the main file.
• 5. To find a specific field in the main file the index is searched for the highest key
value which is equivalent to the desired value.
• 6. The pointer related to key field start searching the record at location it indicates.
• 7. The search continues in the main file at the location indicate by the pointer.
• Advantages
• 1. Variable length records are allowed.
• 2. very fast operation.
• 3. index the sequential file may be updated in sequential or random mode
• Disadvantages:
• 1. when a new record is added to the main file all the index files must be updated.
• 2.Consumes large memory space for maintaining index files.
• Indexed File Access:
• 1. Both the sequential and indexed sequential file searches the records on
the basis of key fields. if searching is required on the basis of other
attributes i.e. the based on some criteria such as the value in any field
then both these files become inadequate. the third form of file
organization scheme is that support this features is known as indexed file.
• 2. In indexed the file access method multiple indexes are maintained one
for each field of a record . Records are searched only through this indexes.
whatever may be in the field its pointer should exist in the related index
for searching.
• 3. Indexed files are used mostly in application where timeliness of
information is a critical and where data rarely processed exhaustively.
• 4.Examples are airline reservation system and inventory control system.
6.2.4.Direct File Access
• 1. Another method is direct access or relative access a file is made up of fixed
length logical records that allows programs to read and write records rapidly in no
particular order.
• 2. The direct file or hashed the file exploits the capability found on disks to access
directly any block of a known address.
• 3. Direct files are often used where very Rapid access is required, for fixed length
records are used and where records are always accessed one at a time.Examples are
directories, pricing tables,schedules and name lists.
• 4. In direct file access records and accessed directly by the physical addresses of
the location at which the records are stored in the disk.
• 5. The direct access method is the based on the disk model of a file since disk allow
random access to any file block. for Direct Access the file is viewed as a number of
sequential blocks of records .
• 6.A block is generally fixed the length of quantity defined by an Operating System
A block may be 512 bytes long, 1024 bytes long or some other length depending
upon the system.
• 7. The direct access is file allows arbitrary blocks to be read or written. Direct files
are used in those applications where speed is the main constraint for accessing.
• 8.hashing technique is usually used for accessing the records in the Direct Access
files.
• ---------------
Face 1
Register Swap In
User 1
2
User User 2
Space
• Backing Store:
• 1. swapping requires a backing store the backing store is a commonly of fast drum or disk.
• 2. It must be large enough to accommodate copies of all memory images for all users and must
provide Direct Access to this memory images.
• 3. All memory images are on the backing stores and which are ready to run.whenever CPU
scheduler decides to execute a process it calls the dispatcher.
• 4. The dispatcher checks to see whether that process is in memory, if not its swaps out process
currently in memory and swaps in the desired process.
• Secondary Storage Management:
• 1. Systems have several levels of storage, including primary storage, secondary storage ,and
catches storage. Instruction and data must be placed in a primary storage or cache to be
referenced by a running program.
• 2. Because of main memory is to small to accommodate all data and programs and its data are
lost when power is lost the computer system must provide secondary Storage for back up main
memory.
• 3. Secondary storage consists of tapes ,disks and other media designed to hold information
that will eventually be accessed in primary storage is ordinarily divided into bytes or words
consisting of a fixed number of bytes .Each location in storage has an address the set of all
addresses available to a program is called an address space.
• The three major activities of an operating system in regard to secondary storage management
are :
• 1.Managing the free space available on the secondary storage device.
• 2. Allocation of storage space when new files have to be written.
• 3. scheduling the request for memory access.
6.2.6.File Allocation Method
• 1. From the users point of view, a file is an abstract data type. it can be created, opened,
written, read, closed and deleted without any real concern for its implementation.
• 2. The implementation of a file is a problem for operating system. on a tape based system we
can map each file to a separate tape or several files on the same tape.
• 3. The main problem is how to allocate space to this file So that disk space is effectively
utilized and files can be quickly accessed.
• 4.The allocation methods define how the files are stored in the disk blocks.The main idea
behind allocation is effective utilization of file space and fast access of the files.
• 6.2.6.1.Contiguous File Allocation
1.If the blocks are allocated to the file in such a way that all the logical blocks of the file get
the contiguous physical block in the hard disk then such allocation scheme is known as
contiguous allocation.
• 2.In the image shown below, there are three files in the directory. The starting block and the
length of each file are mentioned in the table. We can check in the table that the contiguous
blocks are assigned to each file as per its need.
• 3.The contiguous file allocation method requires each file to occupy a set of contiguous
addresses on the disk addresses define a linear ordering on the disk .
• 4.Contiguous file allocation of a file is Defined by the disk address of the first block and its
length if the file is unblocks long and starts at location B then it occupies blocks b, b + 1, b + 2
and b + n – 1.
• 5.The directory entry for a file with contiguous allocation contains
• 1.Address of starting block
• 2.Length of the allocated portion.
• The file ‘mail’ in the following figure starts from the block 19 with length = 6 blocks.
Therefore, it occupies 19, 20, 21, 22, 23, 24 blocks.
Advantages
• 1.It is simple to implement.
• 2.We will get Excellent read performance.
• 3.Supports Random Access into files.
• Disadvantages
• 1.The disk will become fragmented.
• 2.It may be difficult to have a file grow.
• 6.2.6.2.Linked File Allocation(Chained File Allocation)
• 1.In this scheme, each file is a linked list of disk blocks which need not be contiguous. The
disk blocks can be scattered anywhere on the disk.
2.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.The file ‘jeep’ in following image shows how the blocks are randomly distributed. The last
block (25) contains -1 indicating a null pointer and does not point to any other block.
• Advantages:
• This is very flexible in terms of file size. File size can be increased easily since the system does
not have to look for a contiguous chunk of memory.
• This method does not suffer from external fragmentation. This makes it relatively better in
terms of memory utilization.
• Disadvantages:
• Because the file blocks are distributed randomly on the disk, a large number of seeks are
needed to access every block individually. This makes linked allocation slower.
• It does not support random or direct access. We can not directly access the blocks of a file. A
block k of a file can be accessed by traversing k blocks sequentially (sequential access ) from the
starting block of the file via block pointers.
• Pointers required in the linked allocation incur some extra overhead.
• 6.2.6.3. Indexed File Allocation
• 1.In this scheme, a special block known as the Index block contains the pointers to all the blocks
occupied by a file. Each file has its own index block.
• 2. The ith entry in the index block contains the disk address of the ith file block. The directory
entry contains the address of the index block as shown in the image:
• Advantages:
• This supports direct access to the blocks occupied by the file and therefore provides fast access
to the file blocks.
• It overcomes the problem of external fragmentation.
• Support both sequential and Direct Access to the file.
• no need for user to know size of the file in advance.
• Entire block is available for data as no space.
• Disadvantsges:
• 1.It required lot of space for keeping pointers so wasted space of memory.
• 2.Index of allocation is a more Complex and time consuming.
• 3. Overhead of index blocks is not feasible for very small file.
• 4. Overhead of index blocks is not feasible for very big file also, because it is
difficult to manage levels of indices
• 5. keeping index in memory required space.
6.3.Directory Structure
6.3.1.Concept Of Directory
• 1. To organize files in the computer system in a systematic manner the operating
system provides the concept of directories. A directory can be defined as a way of
grouping files together.
• 2. Millions of files present in the system need to be managed. Directories provide
the means to organize files in structure . Directory is itself a file that is owned by
the OS.
• 3. The directories are organized in hierarchical manner allowing users to create
subdirectories under their directories thus making the file system more logical and
organized.
• 4. A hierarchical file system is one that uses directories to organize files into a tree
structure.
• 5. A directory structure is the way and operating systems file system and its files
are displayed to the user . files are typically displayed in a hierarchical tree
structure.
• 6. Each entry in a directory contains information about a file. similar to file
operations such as a create , rename, update , insert , delete and search can be
performed on directories.
• 7. Based on the entries and its operations, structure for directories can be
organized in a different ways.
• 1) Single-level directory
1. 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. It is the simplest form of directory system is having one directory containing all the
files. sometimes it is called as a root directory .
3. In single level directory structure the entire files are contained in the same
directory. so unique name must be assigned to each file of the directory.
4. The single level directory structure appears as the list of files or sequential file
having file names serving as the key. single level directory structure was
implemented in order in older version of single user system.
5. The world's first supercomputer the CDC 6600 had only a single directory for all
files,even though it was used by many users at once.
Root
Directory
File1 File5
File 2 File4
File 3
• Advantages of single level directory structure
• 1.single level directory structure is easy to implement and maintain.
• 2. it is simple direct structure.
• 3. single level directory structure the operation like creation searching deletion
updating are very easy and faster
• Disadvantages:
• There may chance of name collision because two files can have the same name.
• Searching will become time taking if the directory is large.
• This can not group the same type of files together.
• 6.3.3.Two Level Directory Structure
• 1.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.
• 2.In the two-level directory structure, each user has their own user files directory
(UFD). The UFDs have similar structures, but each lists only the files of a single
user. System’s master file directory (MFD) is searched whenever a new user id is
created.
• 3.Two level directory structure used on a multi-user computer or on a simple
network of a personal computer that shared a common client server or a local area
network.
• A two level to increase as the tree of height 2:
• 1. The root of the tree is MFD.
• 2. its direct descendants are the UFDs.
• The two level directory structure is the most one used in UNIX and MS-DOS
• Advantages:
• The main advantage is there can be more than two files with same name, and
would be very helpful if there are multiple users.
• A security would be there which would prevent user to access other user’s files.
• Searching of the files becomes very easy in this directory structure.
• Disadvantages:
• As there is advantage of security, there is also disadvantage that the user cannot
share the file with the other users.
• Unlike the advantage users can create their own files, users don’t have the ability
to create subdirectories.
• Scalability is not possible because one use can’t group the same types of files
together.
6.3.4.Tree Structure Directory 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.
• This directory structure resembles a real tree upside down, where the root
directory is at the peak. This root contains all the directories for each user. The
users can create subdirectories and even store files in their directory.
• A user do not have access to the root directory data and cannot modify it. And, even
in this directory the user do not have access to other user’s directories. The
structure of tree directory is given below which shows how there are files and
subdirectories in each user’s directory.
• Advantages:
• This directory structure allows subdirectories inside a directory.
• The searching is easier.
• File sorting of important and unimportant becomes easier.
• This directory is more scalable than the other two directory structures
explained.
• Disadvantages:
• As the user isn’t allowed to access other user’s directory, this prevents the
file sharing among users.
• As the user has the capability to make subdirectories, if the number of
subdirectories increase the searching may become complicated.
• Users cannot modify the root directory data.
• If files do not fit in one, they might have to be fit into other directories.
6.4.Disk Organization And Disk Structure
• 1.In recent years, Processor and main memory speeds have increased more rapidly
than those of secondary storage devices, such as hard disks .As a result , Processes
requesting data on secondary storage tend to experience relatively long service
delays.
• 2.In modern computers most of the secondary storage is in the form of magnetic
disks . Hence , knowing the structure of a magnetic disk is necessary to understand
how the data in the disk is accessed by the computer.
• 6.4.1.Disk Organization
• 1. The main function of the file Management services provided by an operating
system is to store the information content of the file on a disk in such a manner
that it can be found quickly accessed when needed.
• 2. Information is invariably stored in 512 bite sector in concentric circular track of
decreasing radius The outermost track includes the first disk sector i.e.the sector
with an identifying number or sector address of zero and remaining sectors on the
track then have sector addresses ranging in a sequence from 1 upwards.
• 3. The number of sectors per track varies with the particular disc Technology being
used the last disk sector of the innermost this track on a recording surface is then
the last chapter on that recording surface and has a sector address of n-1 where n
is the storage capacity(in sectors)of one surface of the disk.
• 4. Sector numbers on successive surface are then logically number from n,2n,3n… upwards. finding
information on a disk is then, in principle a case of file management software keeping a record of
each file name and the sector address of the sector holding the information content of that file we
refer to the collection of this record AS file map the more fragmented or scattered are the files on a
days the less efficient they are access so different utility will attempt to organize the sector of each
file. Fig:Schematic Of Disk Organization.
Disk Concentric
head recording
tracks
• Partition table
• .
• .
Concentric
recording
tracks
• Disk head
assembly of eight
. moves in
heads
and out to
.
position on a
• cyclinder. Cyclinder=A set of
verticallyy Vertically
superimposed or
aligned tracks.one track from
each surface •
6.4.2.Physical Disk Structure
• 1. A magnetic disk is the most commonly used as secondary storage medium it offers highest
storage capacity and reliability.
• 2. whenever the data stored on the disk needs to be accused by the CPU it is first to move to
the main memory and then required operation is performed.
• 3. once the operation is performed in the modified data must be copied back to the disk.
• 4. The system is responsible for transferring the data between the disk and main memory as
and when required magnetic disk consists of a plate / platter which is made up of metal or
glass material and its surface is covered with magnetic material to store data on its surface.
• 5. If the data can be stored only one side of the platter the disk is single sided, and if
both sides are used to hold the data the disk is double sided.
• 6.when the disk is in used the spindle motor rotates the platter at constant speed at the
speed 60,90 or 120 revolutions per second .
• 7.The surface of a platter is divided into imaginary tracks and sectors.Tracks are
concentric circles where the data is stored and are numbered from the outermost to
the innermost ring ,starting with zero. There are about 50000 to 100,000 tracks per
platter and a disk generally has 1 to 5 platters.
• 8. Tracks are subdivided into sectors. A sector is just like an Arc that forms an angle
at the centre. it is the smallest unit of information that can be transferred to/ from the
disk.
• 9.Disk contains one read/write head for each surface of a platter which is used to
perform read and write operation. all the heads are attached to a single assembly
called as a disk arm.
• 10.The Assembly of disk platters mounted on a spindle together with the heads
mounted on a disk are is known hard disk assembly. all the read/write heads are on
the equal diameter track on different platters at one time. The track of equal diameter
on different platters from a cylinder.
• 11. Transfer of data between memory and disk drive is handled by this controller
which interfaces the disk drive to the computer system. some common interface used
for disk drive are SCSI(Small computer-system-Interface)ATA (Advanced
Technology Attachment),SATA(Serial ATA)PATA (Parrallel ATA ).
• The speed of the disc is a measured as two parts:
• 1. Transfer rate is the rate at which the data moves from the disk to the computer.
• 2.Random Access time is the sum of the same time and rotational latency.
• 3. the seek time is the time for disk and to move the head to the required cylinder
containing the desired track.
• 4. the rotational latency is the additional time for that is to rotate the desired sector
to the disk head.
• 5. The disk bandwidth is the total number of bytes transfer divided by the total
time between the first request of service and the completion of the last transfer.
• Logical Structure
Partition 1 Partition 2 Partition 3 Partition 4
(FAT) (FAT 32) (FAT 32) (FAT 32)
1.Tracks 2.Cyclinder 3.Sectors
6.4.3.Logical Data Structure
• 1. Basically we can divide the logical structure of the hard disk in the following biological
terms :
• 1.MBR(Master Boot Record)
• 2. DBR(DOS Boot Record)
• 3.FAT(File Allocation Tables)
• 4.Root Directory.
• 5. Data Area.
• Figure represent the conceptual arrangement of this logical terms forming the logical structure
of a hard disk.
• Master Boot Record
• 1. It contains a small program to load and start the active partition from the hard disk .
• 2.The MBR is created on the hard disk drive executing FDISK.EXE command of DOS.like
C:>FDISK.EXE/MBR
• 3. It is located at absolute sector zero or we can say at cylinder 0,head 0 and sector 1.(The
MBR).
• DBR(DOS Boot Record)
• 1. After the partition table the DOS boot record or sometimes called as DOS boot sector is the
second most important information on your hard disk.
• 2. It contains some important information about disk geometry like :Bytes per sector,sectors
per cluster, reserved sectors etc.
• 3. the DBR is created by the FORMAT command of DOS.
• FAT(File Allocation Table)
• 1. The FAT was introduced in 1977 to store data and has been modified a several
times to accommodate expanding needs.
• 2. It was a developed to fulfill the requirement of a fast and flexible system for
managing data on both removable and fixed media.
• 3.The FAT manages the disk area in a group of sectors called “CLUSTER”.
• Root Directory:
• 1. The root directory is like a table of contents for the information stored on the
hard disk drive.
• The directory area keeps the information about the file name and date and time of
the file creation, file attribute, file size and starting cluster of the particular file.
• The number of files that one can store on the root directory depends on FAT type
being used.
• Data Area OR Files Area:
• 1. The remainder of the volume after two directory is the data area.
• 2.The data area contains the actual data stored on the disc surface.
• 3. When we format a hard disk FORMAT command of DOS does not destroy or
overwrite the data on the data area. The FORMAT command only removes the
directory entry and FAT entries and it does not touch the actual data area. This
makes the recovery of accidentally formatted hard disk drive possible.
6.4.4.RAID(Redundant Array Of Independent Disks)
• 1. RAID ( Redundant Array of Independent Disk originally Redundant Array of
Inexpensive Disks) is a way of storing the same data in different places on multiple
hard disk to protect data in the case of drive failure.
• 2. RAID organizes multiple disks into a large, high performance logical disk.In
other words if you have three hard drives you can configure them to like one large
drive.
• 3.RAID is a set of physical disk drives, the operating system views it is a single
logical drive. Data are distributed across a physical drives in a way that enables
simultaneous access to data from multiple drives.
• 4. Redundant disk capacity is used to compensate for the increase in the portability
of a failure due to multiple drives. It improves the availability of data because there
is no single point of failure disk.
• 5.The two major goals when implementing disk arrays are data stripping for better
performance and redundancy for better reliability.
• 6.RAID is a data storage virtualization technology that combines multiple physical
disk drive components into single logical unit for the purpose of data
redundancy,performance improvement or both.
• Need Of RAID
• 1. Large disk arrays are highly vulnerable to disk failures.To
solve this problem you can see redundancy in the form of error
correcting codes to tolerate disk failures.
• 2.with this method a redundant disk array can retain data for a
much longer time than unprotected single disk.
• 3. with multiple disks and a RAID scheme a system can stay
up and running when a disk fails and during the time the
replacement disk is being installed and data restored.
• RAID Levels:
RAID Description
0(Striped Disk Array without Consistes of Striping,without mirroring or parity.
Fault Tolerance)
1(Mirroring and Duplexing) Consists Of data mirroring,without parity or striping
2(Hamming Code Error Consists of bit -level striping with dedicated Hamming-code
Correcting Code(ECC) Parity
3(Parallel Transfer with Consists of Byte level striping with dedicated Parity
Parity)
4(Independent Data Disk Consists of Block-level striping with dedicated Parity
With Shared Parity Disk)
5(Independent Data Disk Consists of Block-level striping with distributed Parity
With Distributed Parity
Blocks)
6(Independent Data Disk Consists of Block-level striping with double distributed Parity
With Two Independent
Parity Schemes)
0+1 Creates a second striped set to mirror a primary striped set.
1+0(RAID 10)(High Creates a striped set from a series of mirrored drives.
Reliability combined With
High Performance)
• 1. RAID 0 (striped disks)
• RAID 0 is taking any number of disks and merging them into one large volume. It will increase
speeds as you're reading and writing from multiple disks at a time. But all data on all disks is
lost if any one disk fails. An individual file can then use the speed and capacity of all the
drives of the array. The downside to RAID 0, though, is that it is NOT redundant. The loss of
any individual disk will cause complete data loss. This RAID type is very much less reliable
than having a single disk.
• There is rarely a situation where you should use RAID 0 in a server environment. You can use
it for cache or other purposes where speed is essential, and reliability or data loss does not
matter at all.
• Advantages of RAID 0
• Cost-efficient and straightforward to implement.
• Increased read and write performance.
• No overhead (total capacity use).
• Disadvantages of RAID 0
• Doesn't provide fault tolerance or redundancy.
• 2. RAID 1 (mirrored disks)
• It duplicates data across two disks in the array, providing full redundancy. Both disks are store
exactly the same data, at the same time, and at all times. Data is not lost as long as one disk
survives. The total capacity of the array equals the capacity of the smallest disk in the array.
At any given instant, the contents of both disks in the array are identical.
• RAID 1 is capable of a much more complicated configuration. The point of RAID 1 is primarily
for redundancy. If you completely lose a drive, you can still stay up and running off the other
drive.
• If either drive fails, you can then replace the broken drive with little to no downtime. RAID 1
also gives you the additional benefit of increased read performance, as data can read off any
of the drives in the array. The downsides are that you will have slightly higher write latency.
Since the data needs to be written to both drives in the array, you'll only have a single drive's
available capacity while needing two drives.
• Advantages of RAID 1
• Increased read performance.
• Provides redundancy and fault tolerance.
• Simple to configure and easy to use.
Disadvantages of RAID 1
• Uses only half of the storage capacity.
• More expensive (needs twice as many drivers).
• Requires powering down your computer to replace failed drive.
• 3.RAID 2-Bit-Level Striping with Dedicated Hamming-Code Parity
• RAID 2 is rarely used in practice today. It combines bit-level striping with error checking and
information correction. This RAID implementation requires two groups of disks – one for
writing the data and another for writing error correction codes. RAID 2 also requires a special
controller for the synchronized spinning of all disks.
• Instead of data blocks, RAID 2 stripes data at the bit level across multiple disks. Additionally, it
uses the Humming error ode correction (ECC) and stores this information on the redundancy
disk.
• Advantages of RAID 2
• Reliability.
• The ability to correct stored information.
• Disadvantages of RAID 2
• Expensive.
• Difficult to implement.
• Require entire disks for ECC.
• 3.RAID-3 - Bit-Level Striping with Dedicated Parity
• Like RAID 2, RAID 3 is rarely used in practice. This RAID implementation utilizes bit-level
striping and a dedicated parity disk. Because of this, it requires at least three drives, where
two are used for storing data strips, and one is used for parity.
• To allow synchronized spinning, RAID 3 also needs a special controller. Due to its
configuration and synchronized disk spinning, it achieves better performance rates with
sequential operations than random read/write operations.
• Advantages of RAID 3
• Good throughput when transferring large amounts of data.
• High efficiency with sequential operations.
• Disk failure resiliency.
• Disadvantages of RAID 3
• Not suitable for transferring small files.
• Complex to implement.
• Difficult to set up as software RAID.
• 4.RAID 4-Block-Level Striping with Dedicated Parity
• RAID 4 is another unpopular standard RAID level. It consists of block-level data striping across
two or more independent diss and a dedicated parity disk.
• The implementation requires at least three disks – two for storing data strips and one
dedicated for storing parity and providing redundancy. As each disk is independent and there
is no synchronized spinning, there is no need for a controller.
• RAID 4 configuration is prone to bottlenecks when storing parity bits for each data block on a
single drive. Such system bottlenecks have a large impact on system performance.
• Advantages of RAID 4
• Fast read operations.
• Low storage overhead.
• Simultaneous I/O requests.
• Disadvantages of RAID 4
• Bottlenecks that have big effect on overall performance.
• Slow write operations.
• Redundancy is lost if the parity disk fails.
• 5.RAID 5- Striping with Parity
• RAID 5 is considered the most secure and most common RAID implementation. It combines
striping and parity to provide a fast and reliable setup. Such a configuration gives the user storage
usability as with RAID 1 and the performance efficiency of RAID 0.
• This RAID level consists of at least three hard drives (and at most, 16). Data is divided into data
strips and distributed across different disks in the array. This allows for high performance rates due
to fast read data transactions which can be done simultaneously by different drives in the array.
• Parity bits are distributed evenly on all disks after each sequence of data has been saved. This
feature ensures that you still have access to the data from parity bits in case of a failed drive.
Therefore, RAID 5 provides redundancy through parity bits instead of mirroring.
• Advantages of RAID 5
• High performance and capacity.
• Fast and reliable read speed.
• Tolerates single drive failure.
• Disadvantages of RAID 5
• Longer rebuild time.
• Uses half of the storage capacity (due to parity).
• If more than one disk fails, data is lost.
• More complex to implement.
• Raid 6: Striping with Double Parity
• RAID 6 is an array similar to RAID 5 with an addition of its double parity feature. For this
reason, it is also referred to as the double-parity RAID.
• This setup requires a minimum of four drives. The setup resembles RAID 5 but includes two
additional parity blocks distributed across the disk. Therefore, it uses block-level striping to
distribute the data across the array and stores two parity blocks for each data block.
• Block-level striping with two parity blocks allows two disk failures before any data is lost. This
means that in an event where two disks fail, RAID can still reconstruct the required data.
• Its performance depends on how the array is implemented, as well as the total number of
drives. Write operations are slower compared to other configurations due to its double parity
feature.
• Advantages of RAID 6
• High fault and drive-failure tolerance.
• Storage efficiency (when more than four drives are used).
• Fast read operations.
• Disadvantages of RAID 6
• Rebuild time can take up to 24 hours.
• Slow write performance.
• Complex to implement.
• More expensive.
• Raid 10: Mirroring with Striping
• RAID 10 is part of a group called nested or hybrid RAID, which means it is a combination of
two different RAID levels. In the case of RAID 10, the array combines level 1 mirroring and
level 0 striping. This RAID array is also known as RAID 1+0.
• RAID 10 uses logical mirroring to write the same data on two or more drives to provide
redundancy. If one disk fails, there is a mirrored image of the data stored on another disk.
Additionally, the array uses block-level striping to distribute chunks of data across different
drives. This improves performance and read and write speed as the data is simultaneously
accessed from multiple disks.
• Advantages of RAID 10
• High performance.
• High fault-tolerance.
• Fast read and write operations.
• Fast rebuild time.
• Disadvantages of RAID 10
• Limited scalability.
• Costly (compared to other RAID levels).
• Uses half of the disk space capacity.
• More complicated to set up.