Virtual Memory in Operating System
Virtual Memory in Operating System
Virtual memory is a memory management technique used by operating systems to give the
appearance of a large, continuous block of memory to applications, even if the physical
memory (RAM) is limited and not necessarily allocated in contiguous manner.
A program doesn’t need to be fully loaded in memory to run. Only the needed parts
are loaded.
Programs can be bigger than the physical memory available in the system.
Virtual memory creates the illusion of a large memory, even if the actual memory
(RAM) is small.
It uses both RAM and disk storage to manage memory, loading only parts of
programs into RAM as needed.
This allows the system to run more programs at once and manage memory more
efficiently.
Page and Frame: Page is a fixed size block of data in virtual memory and a frame is a fixed
size block of physical memory in RAM where these pages are loaded.
Think of a page as a piece of a puzzle (virtual memory) While, a frame as the spot
where it fits on the board (physical memory).
When a program runs its pages are mapped to available frames so the program can
run even if the program size is larger than physical memory.
2. Segmentation
Segmentation divides virtual memory into segments of different sizes. Segments that aren't
currently needed can be moved to the hard drive. Here,
The system uses a segment table to keep track of each segment's status, including
whether it's in memory, if it's been modified and its physical address.
Segments are mapped into a process's address space only when needed.
Applications of Virtual memory
Increased Effective Memory: It enables a computer to have more memory than the
physical memory using the disk space. This allows for the running of larger
applications.
Memory Isolation: Virtual memory allocates a unique address space to each process,
such separation increases safety and reliability based on the fact that one process
cannot interact with another.
Efficient Memory Management: Virtual memory also helps in better utilization of
the physical memories through methods that include paging and segmentation.
Simplified Program Development: For case of programmers, they can program ‘as
if’ there is one big block of memory and this makes the programming easier and more
efficient in delivering more complex applications.
Management of Virtual Memory
Here are 5 key points on how to manage virtual memory:
1. Adjust the Page File Size
Automatic Management: All contemporary OS including Windows contain the auto-
configuration option for the size of the empirical page file. But depending on the size
of the RAM, they are set automatically, although the user can manually adjust the
page file size if required.
Manual Configuration: For tuned up users, the setting of the custom size can
sometimes boost up the performance of the system. The initial size is usually advised
to be set to the minimum value of 1.
2. Place the Page File on a Fast Drive
SSD Placement: If this is feasible, the page file should be stored in the SSD instead
of the HDD as a storage device. It has better read and write times and the virtual
memory may prove beneficial in an SSD.
Separate Drive: Regarding systems having multiple drives involved, the page file
needs to be placed on a different drive than the OS and that shall in turn improve its
performance.
3. Monitor and Optimize Usage
Performance Monitoring: Employ the software tools used in monitoring the
performance of the system in tracking the amounts of virtual memory.
Regular Maintenance: Make sure there is no toolbar or other application running in
the background, take time and uninstall all the tool bars to free virtual memory.
4. Keep Virtual Memory Enabled
Even with large RAM (e.g., 16GB+), virtual memory should generally remain
enabled, as the OS relies on it for efficient memory management and system stability.
5. Optimize System Settings
System Configuration: Change some general properties of the system concerning
virtual memory efficiency. This also involves enabling additional control options in
Windows.
Regular Updates: Ensure that your drivers are run in their newest version because
new releases contain some enhancements and issues regarding memory management.
Benefits of Using Virtual Memory
Supports Multiprogramming & Larger Programs : Virtual
memory allows multiple processes to reside in memory at once by using demand
paging. Even programs larger than physical memory can be executed efficiently.
Maximizes Application Capacity : With virtual memory, systems can run more
applications simultaneously, including multiple large ones. It also allows only
portions of programs to be loaded at a time, improving speed and reducing memory
overhead.
Eliminates Physical Memory Limitations : There's no immediate need to upgrade
RAM as virtual memory compensates using disk space.
Boosts Security & Isolation : By isolating the memory space for each process,
virtual memory enhances system security. This prevents interference between
applications and reduces the risk of data corruption or unauthorized access.
Improves CPU & System Performance: Virtual memory helps the CPU
by managing logical partitions and memory usage more effectively. It allows for cost-
effective, flexible resource allocation, keeping CPU workloads optimized and
ensuring smoother multitasking.
Enhances Memory Management Efficiency : Virtual memory automates memory
allocation, including moving data between RAM and disk without user intervention. It
also avoids external fragmentation, using more of the available memory effectively
and simplifying OS-level memory management.
Limitation of Virtual Memory
Slower Performance: Virtual memory can slow down the system, because it often
needs to move data between RAM and the hard drive.
Risk of Data Loss: There is a higher risk of losing data if something goes wrong, like
a power failure or hard disk crash, while the system is moving data between RAM and
the disk.
More Complex System: Managing virtual memory makes the operating system more
complex. It has to keep track of both real memory (RAM) and virtual memory and
make sure everything is in the right place.
Data Indirect (via paging and Direct (CPU can access data
Access swapping) directly)
The operating system then loads the required pages from the disk
into memory and updates the page tables accordingly.
It is useful for executing huge programs that might not fit totally in
memory or for computers with limited physical memory.
If the program accesses a lot of pages that are not in memory right
now, it could also result in a rise in page faults and possible
performance overhead.
The page's new location in memory is then reflected in the page table.
Resuming The Program: The operating system picks up where it left off when
the necessary pages are loaded into memory.
Page Replacement: If there is not enough free memory to hold all the pages a
program needs, the operating system may need to replace one or more pages
currently in memory with pages currently in memory. on the disk. The page
replacement algorithm used by the operating system determines which pages are
selected for replacement.
Page Cleanup: When a process terminates, the operating system frees the
memory allocated to the process and cleans up the corresponding entries in the
page tables.
page fault occurs and no free page frame is available. In this case, one of the existing
3. If the page was modified (dirty), writing it back to disk before replacement.
The efficiency of a page replacement algorithm directly affects the page fault rate, which
This is the simplest page replacement algorithm. In this algorithm, the operating system
keeps track of all pages in the memory in a queue, the oldest page is in the front of the
queue. When a page needs to be replaced page in the front of the queue is selected for
removal.
Example 1: Consider page reference string 1, 3, 0, 3, 5, 6, 3 with 3-page frames. Find the
Initially, all slots are empty, so when 1, 3, 0 came they are allocated to the empty slots
Then 5 comes, it is not available in memory, so it replaces the oldest page slot i.e 1.
6 comes, it is also not available in memory, so it replaces the oldest page slot i.e 3 --->
1 Page Fault.
In this algorithm, pages are replaced which would not be used for the longest duration of time
in the future.
Initially, all slots are empty, so when 7 0 1 2 are allocated to the empty slots ---> 4
Page faults
0 is already there so ---> 0 Page fault. when 3 came it will take the place of 7 because
it is not used for the longest duration of time in the future---> 1 Page fault.
0 is already there so ---> 0 Page fault. 4 will takes place of 1 ---> 1 Page Fault.
Now for the further page reference string ---> 0 Page fault because they are already available
in the memory. Optimal page replacement is perfect, but not possible in practice as the
operating system cannot know future requests. The use of Optimal Page replacement is to set
frames. Find number of page faults using LRU Page Replacement Algorithm.
Least Recently Used - Page Replacement
Initially, all frames are empty. When 1, 3, 0 arrive, they are placed in empty frames,
When 5 arrives, it is not in memory, so it replaces the oldest page (1), resulting in 1
page fault.
When 6 arrives, it is not in memory, so it replaces the oldest page (3), resulting in 1
page fault.
Finally, when 3 arrives, it is not in memory, so it replaces the oldest page (0), resulting
in 1 page fault.
In this algorithm, page will be replaced which has been used recently. Belady's anomaly can
frames. Find number of page faults using MRU Page Replacement Algorithm.
Most Recently Used - Page Replacement
Initially, all frames are empty. When 7, 0, 1, 2 are loaded, there are 4 page faults.
a frame allocation algorithm. Frame allocation algorithms are used if you have multiple
processes; it helps decide how many frames to allocate to each process. There are various
constraint is supported by two reasons. The first reason is, as less number of frames
are allocated, there is an increase in the page fault ratio, decreasing the performance
of the execution of the process. Secondly, there should be enough frames to hold all
Frame allocation algorithms - The two algorithms commonly used to allocate frames to a
process are:
1. Equal allocation: In a system with x frames and y processes, each process gets equal
number of frames, i.e. x/y. For instance, if the system has 48 frames and 9 processes,
each process will get 5 frames. The three frames which are not allocated to any
much sense to give each process equal frames. Allocation of a large number of
frames to a small process will eventually lead to the wastage of a large number
2. Proportional allocation: Frames are allocated to each process according to the process
size. For a process pi of size si, the number of allocated frames is ai = (si/S)*m, where
S is the sum of the sizes of all the processes and m is the number of frames in the
system. For instance, in a system with 62 frames, if there is a process of 10KB and
another process of 127KB, then the first process will be allocated (10/137)*62 = 4
Advantage: All the processes share the available frames according to their
dynamically change depending on whether you have used global replacement or local
1. Local replacement: When a process needs a page which is not in the memory, it can
bring in the new page and allocate it a frame from its own set of allocated frames
only.
Advantage: The pages in memory for a particular process and the page fault
2. Global replacement: When a process needs a page which is not in the memory, it can
bring in the new page and allocate it a frame from the set of all frames, even if that
frame is currently allocated to some other process; that is, one process can take a
Advantage: Does not hinder the performance of processes and hence results in
Disadvantage: The page fault ratio of a process can not be solely controlled by
the process itself. The pages in memory for a process depends on the paging
Thrashing
Thrashing occurs when the operating system spends more time swapping pages between main
memory and disk than executing processes. This leads to excessive page faults and a
Storage Management:
Storage Management is defined as it refers to the management of the data storage
equipment's that are used to store the user/computer generated data. Hence it is a tool or set
of processes used by an administrator to keep your data and storage equipment’s safe. Storage
management is a process for users to optimize the use of storage devices and to protect the
integrity of data for any media on which it resides and the category of storage management
generally contain the different type of subcategories covering aspects such as security,
Storage management key attributes: Storage management has some key attribute which is
generally used to manage the storage capacity of the system. These are given below:
1. Performance
2. Reliability
3. Recoverability
4. Capacity
1. Storage management is a process that is used to optimize the use of storage devices.
benefit a corporation.
Advantage of storage management: There are some advantage of storage management which
agility.
Limited physical storage capacity: Operating systems can only manage the physical
storage space that is available, and as such, there is a limit to how much data can be
stored.
the system's performance can decrease due to increased disk access time,
Cost: Storing large amounts of data can be expensive, and the cost of additional
operating system must have robust security features in place to prevent unauthorized
Backup and Recovery: Backup and recovery of data can also be challenging,
Mass-Storage Structure
Introduction
Mass-storage structure refers to the storage devices used to store large amounts of data
Examples:
Hard Disk
SSD
Optical Disk
RAID
1. Disk Structure
Features
Transfer rate is the speed at which data flows between drive and computer.
o Seek time
o Rotational latency
Seek Time
Head Crash
Occurs when disk head touches disk surface and damages data.
Platter
Platter is a circular magnetic disk surface where data is permanently stored in a hard disk.
Track
Sector
Cylinder
Read/Write Head
Read/Write head is the device that reads data from the disk and writes data onto the disk.
Spindle
Spindle is the central rod that rotates the platters at high speed.
Disk Arm
Disk arm is the mechanical arm that moves the read/write head to different tracks on the
disk.
hard disk. These algorithms help determine the order in which disk read and write
The main goals of disk scheduling are to optimize the performance of disk operations,
reduce the time it takes to access data and improve overall system efficiency.
Multiple I/O requests may arrive by different processes and only one I/O request can
be served at a time by the disk controller. Thus other I/O requests need to wait in the
Two or more requests may be far from each other so this can result in greater disk arm
movement.
Hard drives are one of the slowest parts of the computer system and thus need to be
Seek Time: Time taken to move the disk arm to the track where data is located.
Rotational Latency: Time taken for the desired sector to rotate under the read/write
head.
Transfer Time: Time taken to actually read or write the data, depending on disk
Response Time: The time a request waits before its I/O operation starts.
Variance in Response Time: How much individual waiting times differ from the
average.
Maximize Throughput
Minimize Latency
Ensuring Fairness
There are several Disk Several Algorithms. We will discuss in detail each one of them.
C-SCAN
LOOK
C-LOOK
FCFS (First Come First Serve) is the simplest disk scheduling algorithm where requests
are processed in the order they arrive in the queue. It is easy to implement but may lead to
No starvation of requests
Problem-
Consider a disk queue with requests for I/O to blocks on cylinders 98, 183, 41, 122, 14, 124, 65, 67. The
FCFS scheduling algorithm is used. The head is initially at cylinder number 53. The cylinders are
numbered from 0 to 199. The total head movement (in number of cylinders) incurred while servicing these
requests is _______.
Solution-
(82-50)+(170-82)+(170-43)+(140-43)+(140-24)+(24-16)+(190-16) =642
Advantages of FCFS
No indefinite postponement
Disadvantages of FCFS
This algorithm services that request next which requires least number of head
Advantages-
Disadvantages-
The requests which are far from the head might starve for the CPU.
closest to the current disk arm position, minimizing seek time. It improves performance
compared to FCFS by reducing average response time and increasing system throughput.
Example: Problem-01:
Consider a disk queue with requests for I/O to blocks on cylinders 98, 183, 41, 122,
14, 124, 65, 67. The SSTF scheduling algorithm is used. The head is initially at
cylinder number 53 moving towards larger cylinder numbers on its servicing pass.
The cylinders are numbered from 0 to 199. The total head movement (in number of
Solution-
Total head movements incurred while servicing these requests
= (65 – 53) + (67 – 65) + (67 – 41) + (41 – 14) + (98 – 14) + (122 – 98) + (124 – 122) +
(183 – 124)
= 12 + 2 + 26 + 27 + 84 + 24 + 2 + 59
= 236
Problem-02:
Consider a disk system with 100 cylinders. The requests to access the cylinders occur in
following sequence-
Assuming that the head is currently at cylinder 50, what is the time taken to satisfy all
requests if it takes 1 ms to move from one cylinder to adjacent one and shortest seek time first
policy is used?
1. 95 ms
2. 119 ms
3. 233 ms
4. 276 ms
Solution-
= (50 – 34) + (34 – 20) + (20 – 19) + (19 – 15) + (15 – 10) + (10 – 7) + (7 – 6) + (6 – 4) +
(4 – 2) + (73 – 2)
= 16 + 14 + 1 + 4 + 5 + 3 + 1 + 2 + 2 + 71
= 119
= 119 x 1 msec
= 119 msec
(50-43)+(43-24)+(24-16)+(82-16)+(140-82)+(170-140)+(190-170) =208
Throughput increases
Can cause Starvation for a request if it has a higher seek time as compared to
incoming requests
The high variance of response time as SSTF favors only some requests
3. SCAN
The SCAN algorithm is a disk scheduling method where the disk arm moves in one
direction, servicing requests along the way, and then reverses direction at the end, similar
to an elevator. It provides better performance than simple algorithms but may cause
Example:
SCAN Algorithm
arm is at 50, and it is also given that the disk arm should move "towards the larger
value".
Therefore, the total overhead movement (total distance covered by the disk arm) is
calculated as
= (199-50) + (199-16) = 332
Problem-
Consider a disk queue with requests for I/O to blocks on cylinders 98, 183, 41, 122, 14,
124, 65, 67. The SCAN scheduling algorithm is used. The head is initially at cylinder
number 53 moving towards larger cylinder numbers on its servicing pass. The cylinders
are numbered from 0 to 199. The total head movement (in number of cylinders) incurred
Solution-
= (65 – 53) + (67 – 65) + (98 – 67) + (122 – 98) + (124 – 122) + (183 – 124) + (199 –
= 12 + 2 + 31 + 24 + 2 + 59 + 16 + 158 + 27
= 331
Alternatively,
Total head movements incurred while servicing these requests
= 146 + 185
= 331
High throughput
4. C-SCAN
C-SCAN (Circular SCAN) is an improvement over the SCAN algorithm where the disk
arm moves in one direction only. Instead of reversing, it jumps back to the beginning of
the disk and continues servicing requests, providing more uniform wait times.
Example:
Problem-
Consider a disk queue with requests for I/O to blocks on cylinders 98, 183, 41, 122, 14,
124, 65, 67. The C-SCAN scheduling algorithm is used. The head is initially at cylinder
number 53 moving towards larger cylinder numbers on its servicing pass. The cylinders
are numbered from 0 to 199. The total head movement (in number of cylinders) incurred
Solution-
= (65 – 53) + (67 – 65) + (98 – 67) + (122 – 98) + (124 – 122) + (183 – 124) + (199 –
= 12 + 2 + 31 + 24 + 2 + 59 + 16 + 199 + 14 + 27
= 386
Alternatively,
Total head movements incurred while servicing these requests
= 146 + 199 + 41
= 386
Circular SCAN
Problem-
Consider a disk queue with requests for I/O to blocks on cylinders 98, 183, 41, 122, 14,
124, 65, 67. The C-SCAN scheduling algorithm is used. The head is initially at cylinder
number 53 moving towards larger cylinder numbers on its servicing pass. The cylinders
are numbered from 0 to 199. The total head movement (in number of cylinders) incurred
= (65 – 53) + (67 – 65) + (98 – 67) + (122 – 98) + (124 – 122) + (183 – 124) + (199 –
= 12 + 2 + 31 + 24 + 2 + 59 + 16 + 199 + 14 + 27
= 386
Alternatively,
= 146 + 199 + 41
= 386
Suppose the requests to be addressed are- 82,170,43,140,24,16,190 and the Read/Write
arm is at 50, and it is also given that the disk arm should move "towards the larger
value".
So, the total overhead movement (total distance covered by the disk arm) is calculated as:
5. LOOK
LOOK is a disk scheduling algorithm similar to SCAN, but instead of moving the disk
arm to the end, it only goes up to the last pending request in that direction and then
Moves disk arm only up to the last request, not the disk end
Example:
Consider a disk queue with requests for I/O to blocks on cylinders 98, 183, 41, 122, 14,
124, 65, 67. The LOOK scheduling algorithm is used. The head is initially at cylinder
number 53 moving towards larger cylinder numbers on its servicing pass. The cylinders
are numbered from 0 to 199. The total head movement (in number of cylinders) incurred
= (65 – 53) + (67 – 65) + (98 – 67) + (122 – 98) + (124 – 122) + (183 – 124) + (183 – 41)
+ (41 – 14)
= 12 + 2 + 31 + 24 + 2 + 59 + 142 + 27
= 299
Alternatively,
= 130 + 169
= 299
LOOK Algorithm
arm is at 50, and it is also given that the disk arm should move "towards the larger
value".
So, the total overhead movement (total distance covered by the disk arm) is calculated as:
Advantages
Reduced Unnecessary Movement: The disk arm only goes as far as the last request
in each direction, avoiding travel to the disk’s physical end (unlike SCAN).
Faster Response: Less head movement leads to quicker service for requests.
Disadvantages of LOOK Algorithm:
6. C-LOOK
the last request in one direction and then jumping to the last request at the other end,
cylinders 98, 183, 41, 122, 14, 124, 65, 67. The C-LOOK scheduling
towards larger cylinder numbers on its servicing pass. The cylinders are
= (65 – 53) + (67 – 65) + (98 – 67) + (122 – 98) + (124 – 122) +
= 12 + 2 + 31 + 24 + 2 + 59 + 169 + 27
= 326
Alternatively,
= 130 + 169 + 27
= 326
Suppose the requests to be addressed are-82,170,43,140,24,16,190 and the Read/Write
arm is at 50, and it is also given that the disk arm should move "towards the larger value"
C-LOOK
So, the total overhead movement (total distance covered by the disk arm) is calculated as
Advantages:
Uniform Wait Time: Requests are serviced in a circular manner, so waiting times are
Reduced Head Movement: The arm only goes as far as the last request in one
store, organize and manage data on storage devices such as hard drives, SSDs and USB
drives.
File System
User Application: The programs or software that request file operations like read,
write, or delete.
Logical File System: Manages metadata, file names, directories, and access
permissions.
Virtual File System (VFS): Acts as a bridge, allowing different file systems to work
Physical File System: Handles the actual storage of data blocks on the disk.
Partition 1, Partition 2, Partition 3: Divisions of the storage device where files are
stored physically.
Note: It acts as a bridge between the operating system and the physical storage
A free space is created on the hard drive whenever a file is deleted from it.
To reallocate them to other files, many of these spaces may need to be recovered.
A key issue is how to efficiently allocate disk blocks to files to optimize space and
performance.
File Directories
The collection of files is a file directory and contains information about the files,
including attributes, location, etc. Much of this information, is managed by the operating
system.
Note: The directory is itself a file, accessible by various file management routines.
Naming: It becomes convenient for users as two users can have same name for
Grouping: Logical grouping of files can be done by properties e.g. all java programs,
Structures of Directory
Single-Level Directory: In this, a single directory is maintained for all the users.
Continuous Allocation
Indexed Allocation
Contiguous Allocation
In this scheme, each file occupies a contiguous set of blocks on the disk.
This means that given the starting block address and the length of the file
(in terms of blocks required), we can determine the blocks occupied by
the file. The directory entry for a file with contiguous allocation contains:
Address of starting block
b, b+1, b+2,......b+n-1.
Advantages
Both the Sequential and Direct Accesses are supported by this. For direct access, the
address of the kth block of the file which starts at block b can easily be obtained
as ( b+ k ).
This is extremely fast since the number of seeks are minimal because of contiguous
allocation of file blocks.
Disadvantages
This method suffers from both internal and external fragmentation. This makes it
inefficient in terms of memory utilization.
Increasing file size is difficult because it depends on the availability of contiguous
memory at a particular instance.
Linked Allocation
In this scheme, each file is a linked list of disk blocks which need not be contiguous. Here,
The disk blocks can be scattered anywhere on the disk. 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.
Example: 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.
Indexed Allocation
In this scheme, a special block known as the Index block contains the pointers to all the
blocks occupied by a file. Here,
Each file has its own index block.
The ith entry in the index block contains the disk address of the i th 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.
Disadvantages
For very small files, say files that expand only 2-3 blocks, the
indexed allocation would keep one entire block (index block) for the
pointers which is inefficient in terms of memory utilization. However,
in linked allocation we lose the space of only 1 pointer per block.
define how information is organized, retrieved, and modified. Choosing the right method
Sequential-Access
Direct Access
Sequential Access
A file access method where data is read or written in order, one record after another,
starting from the beginning. The file pointer moves forward automatically after each
operation.
Sequential Access Method
Data is accessed from one record right after another record in an order.
When we use the write command, it will allocate memory and move the pointer to the
It is less prone to data corruption as the data is written sequentially and not randomly.
using its address (block number). It supports random access without scanning previous
records.
The files can be immediately accessed decreasing the average access time.
In the direct access method, in order to access a block, there is no need of traversing
sophisticated algorithms and data structures to manage and locate records efficiently.
Higher Storage Overhead : Direct access methods often require additional storage for
maintaining data location information (such as pointers or address tables), which can
It is the other method of accessing a file that is built on the top of the sequential access
method. These methods construct an index for the file. The index, like an index in the
back of a book, contains the pointer to the various blocks. To find a record in the file, we
first search the index, and then by the help of pointer we access the file directly.
Slower Updates: Both data and index must be updated during insertions, deletions, or
modifications.
Relative record access is a file access method used in operating systems where records are
accessed relative to the current position of the file pointer. In this method, records are
located based on their position relative to the current record, rather than by a specific
Relative record access is a random access method that allows records to be accessed
Relative record access requires fixed-length records and may not be flexible enough
This method is useful for processing records in a specific order or for files that are
accessed sequentially.
Random Access: Allows direct access to any record by moving the file pointer to a
specific offset.
Efficient Retrieval: Faster than sequential access when accessing individual records
Sequential Use: Useful for ordered processing (e.g., accessing next/previous records
in sorted files).
Limited Use: Suitable for regular/sequential access, but less flexible due to fixed-
length records.
RAID Controller
Types of RAID Controller
There are three types of RAID controller:
1. Hardware-Based:
Uses a dedicated physical controller to manage hard drives.
Offers high speed and reliability
Can work independently from the computer's processor
Often built into the motherboard or as a separate card
Think of it as a captain managing the drives smoothly.
2. Software-Based:
Uses the computer’s processor and memory to manage RAID.
No special hardware needed
Cost-effective, but may reduce overall system performance
Slower than hardware RAID
Acts like a helpful assistant, but shares the load with other tasks.
3. Firmware-Based (Fake RAID):
Built into the computer's BIOS/firmware and works during boot-up.
Needs a driver after the OS loads
Cheaper than hardware RAID, but still uses CPU resources
Also known as hybrid RAID or fake RAID
A startup helper that hands over the job to software once the system runs.
Data Redundancy
Data redundancy, although taking up extra space, adds to disk reliability. This means,
That in case of disk failure, if the same data is also backed up onto another disk, we
can retrieve the data and go on with the operation.
On the other hand, if the data is spread across multiple disks without the RAID
technique, the loss of a single disk can affect the entire data.
Key Evaluation Points for a RAID System
When evaluating a RAID system, the following critical aspects should be considered:
1. Reliability
Refers to the system's ability to tolerate disk faults and prevent data loss.
Example:
RAID 0 offers no fault tolerance; if one disk fails all data is lost.
RAID 5 can tolerate one disk failure due to parity data.
RAID 6 can handle two simultaneous disk failures.
2. Availability
The fraction of time the RAID system is operational and available for use.
Example:
RAID 1 (Mirroring) allows immediate data access even during a single disk failure.
RAID 5 and 6 may degrade performance during a rebuild, but data remains available.
3. Performance
Measures how efficiently the RAID system handles data processing tasks. This includes:
Response Time: How quickly the system responds to data requests.
Throughput: The rate at which the system processes data (e.g., MB/s or IOPS).
Types of RAID Controller
There are three types of RAID controller:
1. Hardware-Based:
Uses a dedicated physical controller to manage hard drives.
Offers high speed and reliability
Can work independently from the computer's processor
Often built into the motherboard or as a separate card
Think of it as a captain managing the drives smoothly.
2. Software-Based:
Uses the computer’s processor and memory to manage RAID.
No special hardware needed
Cost-effective, but may reduce overall system performance
Slower than hardware RAID
Acts like a helpful assistant, but shares the load with other tasks.
3. Firmware-Based (Fake RAID):
Built into the computer's BIOS/firmware and works during boot-up.
Needs a driver after the OS loads
Cheaper than hardware RAID, but still uses CPU resources
Also known as hybrid RAID or fake RAID
A startup helper that hands over the job to software once the system runs.
Data Redundancy
Data redundancy, although taking up extra space, adds to disk reliability. This means,
That in case of disk failure, if the same data is also backed up onto another disk, we
can retrieve the data and go on with the operation.
On the other hand, if the data is spread across multiple disks without the RAID
technique, the loss of a single disk can affect the entire data.
Key Evaluation Points for a RAID System
When evaluating a RAID system, the following critical aspects should be considered:
1. Reliability
Refers to the system's ability to tolerate disk faults and prevent data loss.
Example:
RAID 0 offers no fault tolerance; if one disk fails all data is lost.
RAID 5 can tolerate one disk failure due to parity data.
RAID 6 can handle two simultaneous disk failures.
2. Availability
The fraction of time the RAID system is operational and available for use.
Example:
RAID 1 (Mirroring) allows immediate data access even during a single disk failure.
RAID 5 and 6 may degrade performance during a rebuild, but data remains available.
3. Performance
Measures how efficiently the RAID system handles data processing tasks. This includes:
Response Time: How quickly the system responds to data requests.
Throughput: The rate at which the system processes data (e.g., MB/s or IOPS).
Key Factors:
RAID levels affect performance differently:
RAID 0 offers high throughput but no redundancy.
RAID 1 improves read performance by serving data from either mirrored disk but
may not improve write performance significantly.
RAID 5/6 introduces overhead for parity calculations, affecting write speeds.
Workload type (e.g., sequential vs. random read/write operations).
Performance Trade-offs: Higher redundancy often comes at the cost of slower writes (due to
parity calculations).
4. Capacity
The amount of usable storage available to the user after accounting for redundancy
mechanisms. For a set of N disks, each with B blocks, the available capacity depends on the
RAID level:
RAID 0: All N × B blocks are usable (no redundancy).
RAID 1: Usable capacity is B (only one disk's capacity due to mirroring).
RAID 5: Usable capacity is (N −1)× B (one disk's worth of capacity used for parity).
RAID 6: Usable capacity is (N −2)× B (two disks’ worth used for parity).
Trade-offs: Higher redundancy (RAID 5/ 6) reduces available capacity compared to non-
redundant setups (RAID 0).
Assignment Questions
1. Explain file organization and Access mechanism.
2. What is directory structure?
3. Explain in detail about file allocation methods.
4. Write a note on file operations.
5. Explain RAID Structure.
6. Explain various disk scheduling algorithms.
7. Explain various page replacement algorithm with example.
8. What is dispatch latency.