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 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
Feature of Storage management: There is some feature of storage
management which is provided for storage capacity. These are given
below:
1. Storage management is a process that is used to optimize the use of
storage devices.
2. Storage management must be allocated and managed as a resource in
order to truly benefit a corporation.
3. Storage management is generally a basic system component of
information systems.
4. It is used to improve the performance of their data storage resources.
Advantage of storage management: There are some advantages of
storage management which are given below:
• It becomes very simple to manage a storage capacity.
• It generally reduces the time consumption.
• It improves the performance of system.
• In virtualization and automation technologies, it can help an
organization improve its agility.
Limitations of storage management:
• 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.
• Performance degradation with increased storage utilization: As more
data is stored, the system’s performance can decrease due to
increased disk access time, fragmentation, and other factors.
• Complexity of storage management: Storage management can be
complex, especially as the size of the storage environment grows.
1
• Cost: Storing large amounts of data can be expensive, and the cost of
additional storage capacity can add up quickly.
• Security issues: Storing sensitive data can also present security risks,
and the operating system must have robust security features in place
to prevent unauthorized access to this data.
• Backup and Recovery: Backup and recovery of data can also be
challenging, especially if the data is stored on multiple systems or
devices.
What is a File System?
A file system is a method an operating system uses to store, organize,
and manage files and directories on a storage device. Some common
types of file systems include:
1. FAT (File Allocation Table): An older file system used by older
versions of Windows and other operating systems.
2. NTFS (New Technology File System): A modern file system used by
Windows. It supports features such as file and folder permissions,
compression, and encryption.
3. ext (Extended File System): A file system commonly used on Linux
and Unix-based operating systems.
4. HFS (Hierarchical File System): A file system used by macOS.
5. APFS (Apple File System): A new file system introduced by Apple for
their Macs and iOS devices.
File type Usual extension Function
Read to run machine
Executable exe, com, bin
language program
Compiled, machine
Object obj, o
language not linked
Source code in various
Source Code C, java, pas, asm, a
languages
Commands to the
Batch bat, sh
command interpreter
Text txt, doc Textual data, documents
Various word processor
Word Processor wp, tex, rrf, doc
formats
Archive arc, zip, tar Related files grouped
2
File type Usual extension Function
into one compressed file
For containing
Multimedia mpeg, mov, rm
audio/video information
It is the textual data and
Markup xml, html, tex
documents
It contains libraries of
Library lib, a ,so, dll routines for
programmers
It is a format for printing
Print or View gif, pdf, jpg or viewing an ASCII or
binary file.
Advantages of File System
• Organization: A file system allows files to be organized into directories
and subdirectories, making it easier to manage and locate files.
• Data protection: File systems often include features such as file and
folder permissions, backup and restore, and error detection and
correction, to protect data from loss or corruption.
• Improved performance: A well-designed file system can improve the
performance of reading and writing data by organizing it efficiently on
disk.
Disadvantages of File System
• Compatibility issues: Different file systems may not be compatible
with each other, making it difficult to transfer data between different
operating systems.
• Disk space overhead: File systems may use some disk space to store
metadata and other overhead information, reducing the amount of
space available for user data.
• Vulnerability: File systems can be vulnerable to data
corruption, malware, and other security threats, which can compromise
the stability and security of the system.
3
File Access Methods
Let's look at various ways to access files stored in secondary memory.
Sequential Access
Most of the operating systems access the file sequentially. In other words, we can say
that most of the files need to be accessed sequentially by the operating system.
In sequential access, the OS read the file word by word. A pointer is maintained
which initially points to the base address of the file. If the user wants to read first
word of the file then the pointer provides that word to the user and increases its
value by 1 word. This process continues till the end of the file.
Modern word systems do provide the concept of direct access and indexed access
but the most used method is sequential access due to the fact that most of the files
such as text files, audio files, video files, etc need to be sequentially accessed.
Direct Access
The Direct Access is mostly required in the case of database systems. In most of the
cases, we need filtered information from the database. The sequential access can be
very slow and inefficient in such cases.
Suppose every block of the storage stores 4 records and we know that the record we
needed is stored in 10th block. In that case, the sequential access will not be
implemented because it will traverse all the blocks in order to access the needed
record.
4
Direct access will give the required result despite of the fact that the operating system has to
perform some complex tasks such as determining the desired block number. However, that is
generally implemented in database applications.
Indexed Access
If a file can be sorted on any of the filed then an index can be assigned to a group of
certain records. However, A particular record can be accessed by its index. The index
is nothing but the address of a record in the file.
In index accessing, searching in a large database became very quick and easy but we
need to have some extra space in the memory to store the index value.
What is File System Mounting?
Mounting is a process in which the operating system adds the directories
and files from a storage device to the user’s computer file system. The file
system is attached to an empty directory, by adding so the system user
5
can access the data that is available inside the storage device through the
system file manager. Storage systems can be internal hard disks, external
hard disks, USB flash drivers, SSD cards, memory cards, network-
attached storage devices, CDs and DVDs, remote file systems, or
anything else.
Terminologies used in File System Mounting
• File System: It is the method used by the operating system to manage
data storage in a storage device. So, a user can access and organize
the directories and files in an efficient manner.
• Device name: It is a name/identifier given to a storage partition. In
windows, for example, “D:” in windows.
• Mount point: It is an empty directory in which we are adding the file
system during the process of mounting.
Mounting Indifferent Operating Systems
1. Linux-Unix based OS
We want to mount /dev/sdb1 to an existing directory /mnt.
sudo mount /dev/sdb1 /mnt/mydisk
After mounting, we have to unmount after use
sudo umount /mnt/mydisk
2. Windows OS
In windows mounting is very easy for a user. When we connect the
external storage devices, windows automatically detect the file system
and mount it to the drive letter. Drive letter may be D: or E:.
Steps:
• Connect an external storage device to your PC.
• Windows detects the file system on the drive (e.g., FAT32 or NTFS)
and assigns it a drive letter, such as “E:”.
• You can access the derive by going through, THIS PC –> FILE
EXPLORER –>”E:” drive
• Access the data.
6
File Sharing and Protection
Definition of file sharing
File sharing refers to the process of sharing or distributing electronic files
such as documents, music, videos, images, and software between two or
more users or computers.
Types of File Sharing
File sharing refers to the practice of distributing or providing access to digital
files, such as documents, images, audio, and video files, between two or
more users or devices. There are several types of file sharing methods
available, and each method has its own unique advantages and
disadvantages.
• Peer-to-Peer (P2P) File Sharing − Peer-to-peer file sharing allows users to share files
with each other without the need for a centralized server. Instead, users connect to each
other directly and exchange files through a network of peers. P2P file sharing is
commonly used for sharing large files such as movies, music, and software.
• Cloud-Based File Sharing − Cloud-based file sharing involves the storage of files in a
remote server, which can be accessed from any device with an internet connection. Users
can upload and download files from cloud-based file sharing services such as Google
Drive, Dropbox, and OneDrive. Cloud-based file sharing allows users to easily share files
with others, collaborate on documents, and access files from anywhere.
• Direct File Transfer − Direct file transfer involves the transfer of files between two
devices through a direct connection such as Bluetooth or Wi-Fi Direct. Direct file transfer
is commonly used for sharing files between mobile devices or laptops.
• Removable Media File Sharing − Removable media file sharing involves the use of
physical storage devices such as USB drives or external hard drives. Users can copy files
onto the device and share them with others by physically passing the device to them.
File Sharing Protection Measures
• Encryption − Encryption is the process of converting data into a coded language that can
only be accessed by authorized users with a decryption key. This can help protect files
from unauthorized access and ensure that data remains confidential even if it is
intercepted during file sharing.
7
• Password protection − Password protection involves securing files with a password that
must be entered before the file can be accessed. This can help prevent unauthorized
access to files and ensure that only authorized users can view or modify the files.
• Secure file transfer protocols − Secure file transfer protocols, such as SFTP (Secure File
Transfer Protocol) and HTTPS (Hypertext Transfer Protocol Secure), provide a secure
way to transfer files over the internet. These protocols use encryption and other security
measures to protect files from interception and unauthorized access during transfer.
• Firewall protection − Firewall protection involves using a firewall to monitor and
control network traffic to prevent unauthorized access to the user's device or network.
Firewalls can also be configured to block specific file sharing protocols or limit access to
certain users or devices, providing an additional layer of protection for shared files.
Best Practices for Secure File Sharing
• Use trusted sources for file sharing − To reduce the risk of downloading malware or
viruses, it is essential to use trusted sources for file sharing. Users should only download
files from reputable sources and avoid downloading files from unknown or suspicious
websites.
• Limit access to files − To minimize the risk of data breaches or leaks, users should limit
access to files only to authorized individuals or groups. This can be done by using
password protection, encryption, and other access control measures.
• Educate users on safe file sharing practices − Educating users on safe file sharing
practices can help reduce the risk of security incidents. Users should be trained on how to
identify and avoid phishing scams, how to recognize suspicious files or emails, and how
to securely share files.
• Regularly update antivirus and anti-malware software − To ensure maximum
protection against malware and viruses, it is essential to regularly update antivirus and
anti-malware software. This will help to identify and remove any potential threats to the
user's device or network.
8
File System Implementation in Operating
System
A file is a collection of related information. The file system resides on
secondary storage and provides efficient and convenient access to the
disk by allowing data to be stored, located, and retrieved.
File system implementation in an operating system refers to how the file
system manages the storage and retrieval of data on a physical storage
device such as a hard drive, solid-state drive, or flash drive. The file
system implementation includes several components, including:
1. File System Structure: The file system structure refers to how the
files and directories are organized and stored on the physical storage
device. This includes the layout of file systems data structures such as
the directory structure, file allocation table, and inodes.
2. File Allocation: The file allocation mechanism determines how files
are allocated on the storage device. This can include allocation
techniques such as contiguous allocation, linked allocation, indexed
allocation, or a combination of these techniques.
3. Data Retrieval: The file system implementation determines how the
data is read from and written to the physical storage device. This
includes strategies such as buffering and caching to optimize file I/O
performance.
4. Security and Permissions: The file system implementation includes
features for managing file security and permissions. This includes
access control lists (ACLs), file permissions, and ownership
management.
5. Recovery and Fault Tolerance: The file system implementation
includes features for recovering from system failures and maintaining
data integrity. This includes techniques such as journaling and file
system snapshots.
File system implementation is a critical aspect of an operating system as it
directly impacts the performance, reliability, and security of the system.
Different operating systems use different file system implementations
based on the specific needs of the system and the intended use cases.
Some common file systems used in operating systems include NTFS and
FAT in Windows, and ext4 and XFS in Linux.
9
The file system is organized into many layers:
1. I/O Control level – Device drivers act as an interface between devices
and OS, they help to transfer data between disk and main memory. It
takes block number as input and as output, it gives low-level hardware-
specific instruction.
2. Basic file system – It Issues general commands to the device driver to
read and write physical blocks on disk. It manages the memory buffers
and caches. A block in the buffer can hold the contents of the disk
block and the cache stores frequently used file system metadata.
3. File organization Module – It has information about files, the location
of files and their logical and physical blocks. Physical blocks do not
match with logical numbers of logical blocks numbered from 0 to N. It
also has a free space that tracks unallocated blocks.
4. Logical file system – It manages metadata information about a file i.e
includes all details about a file except the actual contents of the file. It
also maintains via file control blocks. File control block (FCB) has
information about a file – owner, size, permissions, and location of file
contents.
Advantages
1. Duplication of code is minimized.
2. Each file system can have its own logical file system.
3. File system implementation in an operating system provides several
advantages, including:
4. Efficient Data Storage: File system implementation ensures efficient
data storage on a physical storage device. It provides a structured way
10
of organizing files and directories, which makes it easy to find and
access files.
5. Data Security: File system implementation includes features for
managing file security and permissions. This ensures that sensitive
data is protected from unauthorized access.
6. Data Recovery: The file system implementation includes features for
recovering from system failures and maintaining data integrity. This
helps to prevent data loss and ensures that data can be recovered in
the event of a system failure.
7. Improved Performance: File system implementation includes
techniques such as buffering and caching to optimize file I/O
performance. This results in faster access to data and improved overall
system performance.
8. Scalability: File system implementation can be designed to be
scalable, making it possible to store and retrieve large amounts of data
efficiently.
9. Flexibility: Different file system implementations can be designed to
meet specific needs and use cases. This allows developers to choose
the best file system implementation for their specific requirements.
10. Cross-Platform Compatibility: Many file system implementations
are cross-platform compatible, which means they can be used on
different operating systems. This makes it easy to transfer files
between different systems.
In summary, file system implementation in an operating system provides
several advantages, including efficient data storage, data security, data
recovery, improved performance, scalability, flexibility, and cross-platform
compatibility. These advantages make file system implementation a
critical aspect of any operating system.
Disadvantages
If we access many files at the same time then it results in low
performance. We can implement a file system by using two types of data
structures:
1. Boot Control Block – It is usually the first block of volume and it
contains information needed to boot an operating system. In UNIX it is
called the boot block and in NTFS it is called the partition boot sector.
2. Volume Control Block – It has information about a particular partition
ex:- free block count, block size and block pointers, etc. In UNIX it is
called superblock and in NTFS it is stored in the master file table.
3. Directory Structure – They store file names and associated inode
numbers. In UNIX, includes file names and associated file names and
in NTFS, it is stored in the master file table.
4. Per-File FCB – It contains details about files and it has a unique
identifier number to allow association with the directory entry. In NTFS
it is stored in the master file table.
11
5. Mount Table – It contains information about each mounted volume.
6. Directory-Structure cache – This cache holds the directory
information of recently accessed directories.
7. System-wide open-file table – It contains the copy of the FCB of each
open file.
8. Per-process open-file table – It contains information opened by that
particular process and it maps with the appropriate system-wide open-
file.
9. Linear List – It maintains a linear list of filenames with pointers to the
data blocks. It is time-consuming also. To create a new file, we must
first search the directory to be sure that no existing file has the same
name then we add a file at the end of the directory. To delete a file, we
search the directory for the named file and release the space. To reuse
the directory entry either we can mark the entry as unused or we can
attach it to a list of free directories.
10. Hash Table – The hash table takes a value computed from the file
name and returns a pointer to the file. It decreases the directory search
time. The insertion and deletion process of files is easy. The major
difficulty is hash tables are its generally fixed size and hash tables are
dependent on the hash function of that size.
Kernel I/O Subsystem in Operating System
The kernel provides many services related to I/O. Several services such
as scheduling, caching, spooling, device reservation, and error handling –
are provided by the kernel’s I/O subsystem built on the hardware and
device-driver infrastructure. The I/O subsystem is also responsible for
protecting itself from errant processes and malicious users.
1. I/O Scheduling –
To schedule a set of I/O requests means to determine a good order in
which to execute them. The order in which the application issues the
system call is the best choice. Scheduling can improve the overall
performance of the system, can share device access permission fairly
to all the processes, and reduce the average waiting time, response
time, and turnaround time for I/O to complete.
OS developers implement schedules by maintaining a wait queue of
the request for each device. When an application issues a blocking I/O
system call,The request is placed in the queue for that device. The I/O
scheduler rearranges the order to improve the efficiency of the
system.
2. Buffering –
A buffer is a memory area that stores data being transferred between
two devices or between a device and an application. Buffering is done
for three reasons.
12
1. The first is to cope with a speed mismatch between the producer
and consumer of a data stream.
2. The second use of buffering is to provide adaptation for data that
have different data-transfer sizes.
3. The third use of buffering is to support copy semantics for the
application I/O, “copy semantic ” means, suppose that an
application wants to write data on a disk that is stored in its buffer. it
calls the write() system’s call, providing a pointer to the buffer and
the integer specifying the number of bytes to write.
3. Caching –
A cache is a region of fast memory that holds a copy of data. Access to
the cached copy is much easier than the original file. For instance, the
instruction of the currently running process is stored on the disk,
cached in physical memory, and copied again in the CPU’s secondary
and primary cache.
The main difference between a buffer and a cache is that a buffer may
hold only the existing copy of a data item, while a cache, by definition,
holds a copy on faster storage of an item that resides elsewhere.
4. Spooling and Device Reservation –
A spool is a buffer that holds the output of a device, such as a printer
that cannot accept interleaved data streams. Although a printer can
serve only one job at a time, several applications may wish to print
their output concurrently, without having their output mixes together.
The OS solves this problem by preventing all output from continuing to
the printer. The output of all applications is spooled in a separate disk
file. When an application finishes printing then the spooling system
queues the corresponding spool file for output to the printer.
5. Error Handling –
An Os that uses protected memory can guard against many kinds of
hardware and application errors so that a complete system failure is
not the usual result of each minor mechanical glitch, Devices, and I/O
transfers can fail in many ways, either for transient reasons, as when a
network becomes overloaded or for permanent reasons, as when a
disk controller becomes defective.
Error Handling Strategies: Ensuring robust error handling is a critical
aspect of the Kernel I/O Subsystem to maintain the stability and
reliability of the operating system. The strategies employed for error
handling involve mechanisms for detecting, reporting, and recovering
from I/O errors. Below are key components of error handling strategies
within the Kernel I/O Subsystem:
1. Error Detection Mechanisms: The Kernel I/O Subsystem
incorporates various mechanisms to detect I/O errors promptly
13
2. Error Reporting: Once an error is detected, the Kernel I/O
Subsystem employs mechanisms to report the error to higher levels of
the operating system or user applications
3. Error Recovery Mechanisms: Recovering from I/O errors is crucial to
maintaining system stability.
4. User Notification: Informing users or administrators about I/O errors
is essential for timely intervention and system maintenance:
User Alerts: Providing alerts to users, either through the user interface
or system notifications, can prompt immediate attention to potential
issues.
Automated Notifications: Implementing automated notification
systems, such as emails or messages, to inform system administrators
about critical errors for proactive system management.
6. I/O Protection –
Errors and the issue of protection are closely related. A user process
may attempt to issue illegal I/O instructions to disrupt the normal
function of a system. We can use the various mechanisms to ensure
that such disruption cannot take place in the system.
To prevent illegal I/O access, we define all I/O instructions to be
privileged instructions. The user cannot issue I/O instruction directly.
14