KEMBAR78
Disk Management in Operating Systems | PDF | File System | Hard Disk Drive
0% found this document useful (0 votes)
490 views5 pages

Disk Management in Operating Systems

Disk management in operating systems is essential for efficient data storage and retrieval, focusing on disk scheduling algorithms, partitioning, formatting, and RAID levels. Key algorithms like FCFS and SSTF optimize I/O performance, while partitioning prepares disks for data storage and RAID configurations enhance reliability and performance. Understanding these concepts is crucial for effective disk resource management in modern computing.

Uploaded by

riksohom3
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
490 views5 pages

Disk Management in Operating Systems

Disk management in operating systems is essential for efficient data storage and retrieval, focusing on disk scheduling algorithms, partitioning, formatting, and RAID levels. Key algorithms like FCFS and SSTF optimize I/O performance, while partitioning prepares disks for data storage and RAID configurations enhance reliability and performance. Understanding these concepts is crucial for effective disk resource management in modern computing.

Uploaded by

riksohom3
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Lecture Notes: Disk Management in

Operating Systems
Introduction
Disk management is a vital function of operating systems, ensuring efficient storage,
retrieval, and organization of data on disk drives. It involves optimizing disk performance,
structuring disk space, and enhancing reliability through redundancy. This lecture note
explores three key aspects of disk management: Disk Scheduling Algorithms (e.g., FCFS,
SSTF), Disk Partitioning and Formatting, and RAID Levels. These concepts are essential
for understanding how operating systems manage disk resources to meet performance and
reliability demands.

1. Disk Scheduling Algorithms (e.g., FCFS, SSTF)


Disk scheduling algorithms determine the order in which disk I/O requests (e.g., read/write
operations) are serviced, aiming to minimize seek time and optimize performance on
traditional hard disk drives (HDDs).

1.1 First-Come, First-Served (FCFS)

 Concept: Services disk requests in the order they arrive, following a simple queue-
based approach.
 Operation:
o The disk head processes each request sequentially based on submission time.
o No optimization for head movement; it moves to the requested track
regardless of position.
 Advantages:
o Simple to implement and inherently fair.
o No starvation, as all requests are eventually serviced.
 Disadvantages:
o High average seek time due to random head movement.
o Inefficient for systems with heavy I/O workloads.
 Example: Requests at tracks 53, 98, 183, 37 with the head at 50 result in a total seek
of |50-53| + |53-98| + |98-183| + |183-37| = 3 + 45 + 85 + 146 = 279.

1.2 Shortest Seek Time First (SSTF)

 Concept: Selects the request closest to the current disk head position to minimize
seek time.
 Operation:
o From the current head position, the algorithm picks the nearest track in the
request queue.
o Continuously updates based on the new head position after each service.
 Advantages:
o Reduces average seek time compared to FCFS.
o Improves disk performance for moderate workloads.
 Disadvantages:
o Can cause starvation for requests far from the current head position.
o Not globally optimal, as it prioritizes local efficiency.
 Example: Head at 50 with requests at 53, 98, 183, 37:
o Order: 50 → 53 → 37 → 98 → 183.
o Total seek: |50-53| + |53-37| + |37-98| + |98-183| = 3 + 16 + 61 + 85 = 165.

1.3 Other Algorithms

 SCAN (Elevator): Moves the head in one direction, servicing requests until the end,
then reverses.
 C-SCAN: Moves in one direction only, returning to the start after reaching the end,
providing uniform wait times.
 LOOK: Similar to SCAN but reverses at the last request, not the disk edge.

1.4 Considerations

 HDDs: Algorithms like SSTF and SCAN optimize for mechanical seek and rotational
latency.
 SSDs: Scheduling is less critical due to uniform access times; simple algorithms like
NOOP suffice.
 Metrics: Seek time, throughput, and fairness guide algorithm choice.

1.5 Use Cases

 FCFS in lightly loaded systems or SSDs with minimal optimization needs.


 SSTF in file servers with moderate disk traffic requiring reduced latency.

2. Disk Partitioning and Formatting


Disk partitioning and formatting prepare a disk for data storage by dividing it into logical
sections and establishing a file system structure.

2.1 Disk Partitioning

 Concept: Divides a physical disk into multiple logical partitions, each treated as an
independent storage unit.
 Types:
o Primary Partitions: Bootable partitions (e.g., containing an OS), limited to
four per disk in traditional MBR schemes.
o Extended Partitions: Contain logical partitions, bypassing the four-partition
limit.
o Logical Partitions: Subdivisions within an extended partition.
 Partition Tables:
o MBR (Master Boot Record): Legacy scheme supporting up to 2 TB disks
and four primary partitions.
o GPT (GUID Partition Table): Modern standard supporting larger disks (up
to 9.4 ZB) and more partitions (up to 128).
 Process:
o Use tools like fdisk, parted, or Disk Management (Windows) to define
partition boundaries.
o Assign partition types (e.g., NTFS, ext4) and sizes.
 Advantages:
o Isolates data (e.g., OS vs. user files).
o Supports multiple OSes on one disk (dual-boot).
o Enhances manageability and backup strategies.
 Disadvantages:
o Fixed sizes can lead to wasted space if misallocated.
o Adds complexity to disk management.

2.2 Disk Formatting

 Concept: Initializes a partition with a file system, creating structures for data storage
and retrieval.
 Types:
o Low-Level Formatting: Performed by manufacturers, defines physical
sectors and tracks (rarely user-managed).
o High-Level Formatting: Creates file system metadata (e.g., FAT, inode
tables) and prepares the partition for use.
 File Systems:
o FAT32: Simple, widely compatible, limited to 4 GB files and 8 TB partitions.
o NTFS: Supports large files, encryption, and permissions (Windows standard).
o ext4: Robust, journaled file system for Linux with large partition support.
 Process:
o Select a file system (e.g., mkfs.ext4 on Linux, format on Windows).
o Write file system metadata (e.g., superblock, directory tables).
o Verify the partition is ready for data storage.
 Advantages:
o Enables OS-specific features (e.g., journaling, compression).
o Prepares disk for efficient data organization.
 Disadvantages:
o Erases existing data during formatting.
o File system choice affects compatibility and performance.

2.3 Use Cases

 Partitioning a disk for dual-boot Windows/Linux systems.


 Formatting an external drive with NTFS for large file transfers on Windows.

3. RAID Levels
RAID (Redundant Array of Independent Disks) is a disk management technique that
combines multiple disks to improve performance, reliability, or both through redundancy and
striping.

3.1 RAID 0 (Striping)

 Concept: Data is split across multiple disks to enhance performance, with no


redundancy.
 Operation: Writes data in stripes (e.g., blocks) across all disks, allowing parallel
access.
 Advantages:
o High read/write speed due to parallelism.
o Full disk capacity utilization.
 Disadvantages:
o No fault tolerance; one disk failure loses all data.
 Minimum Disks: 2.
 Use Case: High-performance applications (e.g., video editing) where speed trumps
reliability.

3.2 RAID 1 (Mirroring)

 Concept: Data is duplicated across multiple disks for redundancy, with no striping.
 Operation: Identical copies of data are written to each disk simultaneously.
 Advantages:
o High reliability; data survives single disk failure.
o Simple to implement.
 Disadvantages:
o Only 50% capacity utilization (e.g., 2 TB across two 2 TB disks).
o No performance gain for writes.
 Minimum Disks: 2.
 Use Case: Critical systems (e.g., database servers) requiring data redundancy.

3.3 RAID 5 (Striping with Parity)

 Concept: Combines striping for performance with distributed parity for redundancy.
 Operation:
o Data and parity (error-checking info) are striped across all disks.
o Parity allows reconstruction of data if one disk fails.
 Advantages:
o Balances performance and reliability.
o Capacity = (n-1) × disk size (e.g., 3 disks of 1 TB = 2 TB usable).
 Disadvantages:
o Slower writes due to parity calculation.
o Recovery after failure is complex and time-consuming.
 Minimum Disks: 3.
 Use Case: File servers needing both speed and fault tolerance.

3.4 RAID 10 (1+0, Mirroring and Striping)


 Concept: Combines mirroring (RAID 1) and striping (RAID 0) for high performance
and redundancy.
 Operation: Data is striped across mirrored pairs of disks.
 Advantages:
o High read/write performance and fault tolerance (survives multiple failures if
not in the same mirror).
o Fast recovery from disk failure.
 Disadvantages:
o 50% capacity utilization (e.g., 4 disks of 1 TB = 2 TB usable).
o Requires more disks, increasing cost.
 Minimum Disks: 4.
 Use Case: Enterprise systems (e.g., high-traffic web servers) requiring speed and
reliability.

3.5 Other RAID Levels

 RAID 2: Bit-level striping with dedicated parity (rarely used).


 RAID 3/4: Byte/block-level striping with dedicated parity disk (less common).
 RAID 6: Striping with dual distributed parity (survives two disk failures, minimum 4
disks).

3.6 Implementation

 Hardware RAID: Managed by a dedicated RAID controller.


 Software RAID: Handled by the operating system (e.g., mdadm in Linux, Windows
Storage Spaces).

3.7 Use Cases

 RAID 0 in gaming PCs for fast disk access.


 RAID 5 in small business servers for cost-effective redundancy.
 RAID 10 in data centers for mission-critical applications.

Conclusion
Disk management is crucial for optimizing storage performance, organization, and reliability
in operating systems. Disk Scheduling Algorithms like FCFS and SSTF enhance I/O
efficiency by minimizing seek times on HDDs. Disk Partitioning and Formatting structure
disks into usable partitions with appropriate file systems, supporting diverse OS and
application needs. RAID Levels provide options for balancing performance and redundancy,
catering to everything from high-speed workloads to fault-tolerant systems. Understanding
these concepts is key to managing disk resources effectively in modern computing
environments. Future topics may include SSD optimization, disk caching, and advanced
RAID configurations.

You might also like