0% found this document useful (0 votes)
9 views42 pages

Understanding File Systems and Disk Structure

The document provides a comprehensive overview of various file systems (FAT, NTFS, EXT, HFS) and their internal workings, as well as details on secondary storage structure and disk scheduling algorithms. It explains how each file system operates, their features, and performance characteristics, along with a description of disk structure, reliability, formatting, boot blocks, and bad blocks. Additionally, it outlines different disk scheduling algorithms and their advantages and disadvantages.

Uploaded by

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

Understanding File Systems and Disk Structure

The document provides a comprehensive overview of various file systems (FAT, NTFS, EXT, HFS) and their internal workings, as well as details on secondary storage structure and disk scheduling algorithms. It explains how each file system operates, their features, and performance characteristics, along with a description of disk structure, reliability, formatting, boot blocks, and bad blocks. Additionally, it outlines different disk scheduling algorithms and their advantages and disadvantages.

Uploaded by

rengademanika4
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Here is a very simple, easy-to-understand explanation of how each file system—FAT, NTFS,

EXT, and HFS—works internally.


Perfect for quick learning and exam writing.

⭐ 1. FAT (File Allocation Table) – Simple Working


Used in: USB drives, memory cards, old Windows.

How FAT Works (Simple Explanation)

• The disk is divided into blocks.


• A table called FAT stores the list of blocks for each file.
• Each file has:
o Start block number
o FAT table tells which block comes next → like a linked list.

Example

File A starts at block 5


FAT table says:

• Block 5 → next block is 8


• Block 8 → next block is 11
• Block 11 → end of file

So file = 5 → 8 → 11 (linked through FAT)

Summary

Easy
Works like linked list
Slow if many blocks
No security features
⭐ 2. NTFS (New Technology File System) – Simple
Working
Used in: All modern Windows versions.

How NTFS Works (Simple Explanation)

• Everything (file names, size, security, data) is stored in a special database table
called MFT (Master File Table).
• Each file has an entry in MFT.
• NTFS uses journaling → it keeps a small log of operations to recover from crashes.

Features

• File permissions
• Encryption
• Large file support
• Compression

Working Example

When you save a file:

1. NTFS writes the details in the MFT.


2. Then writes the actual file blocks.
3. Journaling ensures if power fails, it can recover.

Summary

Very secure
Crash recovery
Supports huge files
More complex than FAT
⭐ 3. EXT (Extended File System – EXT2/EXT3/EXT4) –
Simple Working
Used in: Linux systems (Ubuntu, Debian, Fedora)

How EXT Works (Simple Explanation)

• Disk is divided into groups (block groups).


• Each group contains:
o Superblock
o Inode table
o Data blocks

What is an inode?

• An inode stores file information:


o File block locations
o Permissions
o Owner
o Size

EXT3/EXT4 use journaling for safety.

Example

When you open a file:

1. OS finds its inode.


2. Inode gives addresses of data blocks.
3. OS reads data blocks.

Summary

Fast
Reliable (journaling in EXT3/4)
Supports very large systems
More complex
⭐ 4. HFS / HFS+ (Hierarchical File System) – Simple
Working
Used in: Older macOS versions (before APFS)

How HFS Works (Simple Explanation)

• Uses a B-tree structure to store file names and locations.


• B-tree keeps files sorted and easy to search.
• Stores metadata in catalog file and extents file.

Example Working

1. When you save a file, HFS adds an entry into the B-tree.
2. The entry contains where the file’s blocks are stored (extents).
3. macOS reads the B-tree to open files quickly.

Summary

Fast search
Good for large directories
Replaced by APFS in modern macOS
Not good for SSD optimization

⭐ FINAL QUICK SUMMARY (VERY EASY)


File System Simple Working Used In

FAT Stores file block links in a table (like linked list) Pen drives, memory cards

NTFS Uses MFT database + journaling + permissions Windows

EXT Uses inode tables + block groups + journaling Linux

HFS Uses B-tree to store file info + extents Older Mac systems
If you want, I can also give:

Diagrams
5-mark answer
10-mark answer
Short notes for each file system

Just tell me!

Secondary-Storage Structure - Disk structure

Here is a simple, clear, and exam-friendly explanation of Secondary-Storage Structure –


Disk Structure in an Operating System.

Secondary-Storage Structure – Disk Structure (Simple Explanation)

Secondary storage mainly uses magnetic disks (HDDs) or SSDs, but the traditional OS
topic focuses on disk structure of magnetic hard disks.

A disk is a mechanical storage device where data is stored in the form of magnetic
patterns.

1. Physical Structure of a Disk

A hard disk consists of:

1. Platters
Circular metallic disks coated with magnetic material.

Multiple platters are stacked vertically.

2. Tracks

Each platter is divided into many circular rings called tracks.

3. Sectors

Each track is divided into small fixed-size pieces called sectors.

Sector = smallest storage unit (usually 512 bytes or 4 KB).

4. Cylinders

A group of tracks placed directly above each other (one per platter) forms a cylinder.

5. Read/Write Heads

Each platter surface has a head that reads and writes data.
Heads move together across the surface.

Diagram (Text Form)

Platter

├── Track 0

├── Track 1

├── Track 2

└── Sector 1

└── Sector 2

└── Sector 3

Cylinder = All tracks across platters that align vertically

2. Logical Structure of a Disk

The OS sees the disk in logical units:

1. Logical Blocks

The OS views the disk as a 1-D array of logical blocks.

Logical block 0 → first sector of the first track of the outermost cylinder.
2. Boot Block

The first block of the disk.

Contains bootstrap program to load OS.

3. Disk Partitions

Disk may be split into multiple areas:

C: drive

D: drive

Linux partitions

Each partition has its own file system.

3. Disk Addressing
To locate a sector on disk, old systems used:

CHS Addressing

Cylinder number

Head number

Sector number

Modern systems use LBA (Logical Block Addressing)

→ each block has a unique block number.

Example:

Logical Block 100 = actual sector location calculated internally.

4. Disk Performance Parameters

Performance depends on:

A. Seek Time
Time for the head to move to the correct track.

Largest contributor to delay.

B. Rotational Latency

Waiting time for the desired sector to rotate under the head.

C. Transfer Time

Time to actually read/write the sector.

D. Disk Bandwidth

Total number of bytes transferred per second.

5. Disk Scheduling (Related to Disk Structure)

To improve performance, OS uses algorithms like:


FCFS

SSTF

SCAN

C-SCAN

LOOK

C-LOOK

These reduce seek time by choosing an efficient order to serve requests.

6. Disk Formatting

Before using a disk:

A. Low-Level Formatting

Creates sectors and headers.


B. Logical Formatting (File System Creation)

Build file system structures like:

Superblock

FAT

Inode table

C. Partitioning

Dividing into logical volumes.

7. Disk Management

Includes:

Free-space management

Bad block detection


RAID for reliability

Disk caching for speed

Simple 5-Mark Answer (Write This in Exam)

Secondary-storage structure describes how a magnetic disk is organized. A disk contains


platters coated with magnetic material. Each platter is divided into tracks and each track is
divided into sectors, which are the smallest storage units. Tracks at the same position on
all platters form a cylinder. The OS views the disk as a linear array of logical blocks using
LBA addressing. Performance depends on seek time, rotational latency, and transfer time.
Disks are divided into partitions and contain boot blocks and file systems. Disk scheduling
algorithms improve access time.

If you want, I can also provide:

✔ Diagram of disk structure

✔ Short notes

✔ MCQs + answers

✔ Disk scheduling explanation


Just tell me!

Below is a deep but easy-to-understand explanation of all Disk Scheduling Algorithms.

Perfect for 5–10 marks answers.

1. FIFO (First In First Out)

Idea

Serve disk requests in the order they arrive.


Working

Head does not look at the distance.

It simply takes the first request, completes it, then moves to the next.

Example

Head starts at 50.

Requests: 82, 170, 43, 140, 24, 16

Order of service:

→ 50 → 82 → 170 → 43 → 140 → 24 → 16

Advantages

Very simple.

Fair (no starvation).

Disadvantages

Causes large seek time.


Performance is not good.

2. SSTF (Shortest Seek Time First)

Idea

Serve the request that is closest to the current head position.

Working

Calculate distance of all pending requests from current head.

Choose minimum distance.

Move head to that request.

Repeat.

Example

Head = 50
Requests = 82, 170, 43, 140, 24, 16

Distances from 50 →

82(32), 170(120), 43(7), 140(90), 24(26), 16(34)

Nearest = 43, so execute that first.

Next head = 43 → find nearest again.

Advantages

Much better performance than FIFO.

Minimizes total seek time.

Disadvantages

Can cause starvation of far-away requests.

3. SCAN (Elevator Algorithm)

Idea
Head moves like an elevator:

→ goes in one direction

→ serves all requests

→ reaches the end

→ reverses direction and repeats

Working

Choose a direction (left/right).

Serve all requests in that direction.

Go to end of disk.

Change direction.

Serve remaining requests.

Example

Head = 50, moving right

Requests: 16, 24, 43, 82, 140, 170

Order: 50 → 82 → 140 → 170 → (end) → 43 → 24 → 16


Advantages

More uniform service.

No starvation.

Disadvantages

Moves to end even if no request is there.

4. C-SCAN (Circular SCAN)

Idea

SCAN but moves in one direction only.

Working

Head moves only to right.

Serves all requests on the way.


Reaches disk end.

Jumps back to start without servicing.

Continues moving right again.

Example

Head = 50

Requests = 16, 24, 43, 82, 140, 170

Order:

50 → 82 → 140 → 170 → (end) → jump → 16 → 24 → 43

Advantages

All requests experience uniform wait time.

Better performance for heavy loads.

Disadvantages

Extra time wasted in jumping from end to start.


5. LOOK

Idea

SCAN but does not go to the physical end.

It stops at the last request in that direction.

Working

Move in a direction.

Serve all requests.

Stop at last request.

Reverse direction.

Continue.

Example
Head = 50

Requests are between 16 to 170.

Order:

50 → 82 → 140 → 170 → (reverse) → 43 → 24 → 16

Advantages

Saves time (no unnecessary movement).

Better than SCAN.

Disadvantages

More complex than SCAN.

6. C-LOOK

Idea

C-SCAN but does not go to the end of disk.

Stops at last request then jumps to first request.


Working

Head moves in one direction only.

Stops at last request.

Jumps back to first request.

Continues.

Example

Head = 50

Requests = 16, 24, 43, 82, 140, 170

Order:

50 → 82 → 140 → 170 → jump → 16 → 24 → 43

Advantages

Less movement than C-SCAN.

Uniform response time.


Disadvantages

Slightly complex.

Comparison Table (Quick Revision)

Algorithm Moves Direction Goes to End? Starvation? Performance

FIFO Order of arrival No No Poor

SSTF Closest request No Yes Good

SCAN Both Yes No Better

C-SCAN One direction Yes No Good

LOOK Both No No Better

C-LOOK One direction No No Best

If you want, I can also give numerical problems solved for each algorithm.

Here is a clear, simple, exam-ready deep explanation for:

✔ Disk Reliability
✔ Disk Formatting

✔ Boot Block

✔ Bad Blocks

Perfect for 5–8 marks answers.

1. Disk Reliability

Disk reliability means how safely a disk stores data without loss or corruption.

Since disks contain mechanical parts, they can fail. OS and hardware use several methods
to increase reliability.

Methods to Improve Reliability

(a) Redundancy (RAID)

RAID (Redundant Array of Independent Disks) stores data in multiple disks.

If one disk fails, data can be recovered from another.

RAID 1 (mirroring) creates a duplicate copy for full protection.

(b) Error-Detecting and Correcting Codes (ECC)


Each sector has ECC bits.

Detects and fixes small errors automatically.

© Backups

Regular backups protect against total disk failure.

(c) Disk mirroring

Two disks contain exactly the same data.

If one fails, the system instantly switches to the other.

€ Spare sectors

Disks reserve extra sectors.

If a sector becomes damaged, it’s replaced automatically.

(f) SMART Monitoring


Modern disks use Self-Monitoring and Reporting Technology to detect failures early.

2. Disk Formatting

Disk formatting prepares a disk for storing files.

It happens in two main steps:

(a) Low-Level Formatting (Physical Formatting)

Divides disk into sectors and tracks.

Sets headers, trailers, ECC bits.

Performed by manufacturer or OS.

Creates the actual physical structure.

Purpose:
Make the disk physically ready to store bits.

Define blocks (e.g., 512 bytes, 4 KB).

(b) High-Level Formatting (Logical / File System Formatting)

Creates file-system structures on the disk such as:

FAT table (in FAT file system)

MFT (Master File Table) in NTFS

Superblock, inode table (in EXT file systems)

Creates root directory.

Marks all blocks as “free”.

Purpose:

Prepare the disk to store files and directories.


OS knows where and how to save files.

3. Boot Block

A boot block is a special block located at the beginning of a disk.

Its purpose is to start the computer.

Working

1. When the system is powered on, BIOS/UEFI reads the first block of the disk.

2. This block contains the boot loader.

3. Boot loader loads the Operating System into memory.


MBR (Master Boot Record)

The first sector of traditional disks.

Contains:

Small boot program

Partition table

Located at sector 0.

GPT (GUID Partition Table)

Used in modern systems.

Contains protective MBR + boot partitions.


Purpose of Boot Block

Without a boot block, the OS cannot start.

It acts as the bridge between hardware and OS.

4. Bad Blocks

Bad blocks are damaged sectors on a disk that cannot reliably store data.

Causes

Physical damage (scratches)

Magnetic/flash wear

Sudden power failure

Manufacturing defects
Types of Bad Blocks

(a) Hard Bad Blocks

Permanently damaged.

Cannot be repaired.

Disk controller marks them unusable.

(b) Soft Bad Blocks

Caused by temporary issues (power loss, weak magnetization).

Can be repaired by rewriting or formatting.

Handling Bad Blocks

At Hardware Level

Disk has spare sectors.


When a block fails, hardware replaces it automatically (sector remapping).

At File-System Level

OS marks the block as bad in the file system table.

Example: FAT marks it as BAD entry.

NTFS records it in bad cluster list.

At User Level

Tools like chkdsk, fsck scan and fix logical errors.

✔ Short Summary (for quick revision)

Topic Simple Explanation

Disk Reliability Methods to prevent data loss (RAID, ECC, backups, monitoring)

Disk Formatting Low-level: create sectors; High-level: create file system


Boot Block First block containing boot loader; used to load OS

Bad Blocks Damaged disk sectors; marked unusable or replaced

If you want, I can also provide very short exam answers (2–3 marks) or diagram-based
notes.

Here is a clear, detailed, exam-ready answer on File Access Methods in Operating Systems.

Perfect for 5–10 marks questions.

File Access Methods – Detailed Explanation

A file access method defines how data stored inside a file can be read or written.

Operating systems support three main file access methods:

✔ Sequential Access

✔ Direct (Random) Access

✔ Indexed Access

These methods allow different ways to organize and retrieve data efficiently based on the
needs of applications.
1. Sequential Access Method

Meaning

The file is accessed in order, one record after another.

This is the simplest and most common method.

Working

The system maintains a read/write pointer.

When data is read, the pointer moves automatically to the next position.

Operations allowed:

Read next

Write next

Rewind (go back to start)

Skip (jump forward)


Example

Reading a text file line by line.

Watching a video or audio file from start to finish.

Advantages

Simple to implement.

Suitable for sequential data.

Good for medium/large files like logs, tapes.

Disadvantages

Slow for searching, because you must pass through all previous records.

Not suitable for random data retrieval.


2. Direct Access Method (Random Access)

Meaning

Allows access to any record directly by using its position (block number).

No need to read previous records.

Working

File is divided into fixed-size blocks.

Each block has a block number like:

Block 0, Block 1, Block 2, … Block n

OS can jump to any block:

Read block 5

Write block 10
Example

Databases (SQL)

Memory-mapped files

Large datasets where quick access is required

Advantages

Extremely fast access.

Best for applications that need non-sequential reading.

Disadvantages

Complex to manage.

Requires structure (fixed block size).

Not suitable for text/variable-length files.


3. Indexed Access Method

Meaning

Uses an index (like index of a book) to locate data quickly.

The index stores key → block address pairs.

Working

OS creates an index file.

Index contains pointers to the actual data blocks.

To read data:

1. Search index for the key.

2. Get block address.

3. Access the block directly.


Types of Indexing

1. Single-Level Index – simple, works for small files.

2. Multi-Level Index – used for large files (like B-tree).

3. Cluster Index – used in databases.

Example

File systems like NTFS, EXT, use indexed access.

Database systems (B-Tree indexing).

Advantages

Fast searching.
Supports random access without scanning entire file.

Efficient for large files.

Disadvantages

Extra space needed for index.

Requires index maintenance.

Slightly slower than pure random access.

Comparison Table (Perfect for Revision)

Method Access Type Speed Best Use Drawback

Sequential One-by-one Slow Logs, media files Cannot jump directly

Direct (Random) Jump to any block Fast Databases, large files Complex,
fixed blocks needed

Indexed Using index pointer Medium–Fast Large structured files Needs index
storage
Short 3–4 Lines (Exam Version)

Sequential Access

Records are accessed in a fixed order from beginning to end. Used in text and tape storage.
Simple but slow for searching.

Direct Access

Allows access to any record directly by using block numbers. Very fast and used in
databases. Requires fixed-size blocks.

Indexed Access

Uses an index that maps keys to block addresses. Supports fast searching and random
access. Requires extra index space.

If you want, I can also give diagrams, short notes, or numerical examples for each method.

You might also like