Unit 4 of 4 · M.Sc IT Sem 1

Unit 4: Device and file management

Operating System notes · PTU syllabus (PGCA1903)

3 min read12 topics10 exam questions
On this page
  1. Unit summary
  2. Secondary storage structure
  3. I/O devices and disk scheduling
  4. Disk management
  5. RAID structure
  6. I/O traffic controller and I/O scheduler
  7. File concepts
  8. Access methods
  9. Directory and disk structure
  10. File system implementation
  11. Protection
  12. Security
  13. Case studies: Linux and Windows
  14. Key terms
  15. Quick revision
  16. Important questions

Unit summary

Disks, devices and files are where data lives. This unit covers secondary storage structure, disk scheduling and management, RAID, the I/O traffic controller and I/O scheduler, file concepts and access methods, directory and disk structure, file system implementation, protection and security, and case studies of Linux and Windows.

After this unit you can

  • Explain disk structure and apply disk scheduling algorithms
  • Explain RAID levels and the I/O subsystem
  • Explain files, access methods, directories and file system implementation
  • Describe protection and security and compare Linux and Windows

PTU syllabus topics

  • Secondary storage structure
  • disk scheduling and management
  • RAID structure
  • I/O traffic controller and scheduler roles
  • file concepts and access methods
  • directory and disk structure
  • file system implementation
  • protection and security
  • Linux and Windows case studies
ComparisonDisk scheduling algorithms
How it moves
Trade-off

FCFS

In request order

Fair but slow

SSTF

Nearest request next

Fast; may starve far requests

SCAN (elevator)

Sweeps end to end

Balanced

C-SCAN

One direction, then jumps back

More uniform wait times

1

Topic 1

Secondary storage structure

  • Hard disk: platters divided into tracks and sectors; tracks at the same position on all surfaces form a cylinder; access time = seek time + rotational latency + transfer time. SSDs have no moving parts, so seek and rotation costs vanish.
2

Topic 2

I/O devices and disk scheduling

I/O devices connect through controllers; data moves by programmed I/O, interrupts or DMA. A disk has platters, tracks, sectors and cylinders; access time = seek time + rotational latency + transfer time. Disk scheduling reduces seek time.

AlgorithmHow it moves the head
FCFSServes requests in arrival order
SSTFServes the nearest request next (may starve far ones)
SCAN (elevator)Moves end to end, serving requests on the way
C-SCANServes in one direction only, then jumps back
LOOK / C-LOOKLike SCAN / C-SCAN but turns at the last request

Exam tip

For disk problems, draw the head movement on a number line and add up every cylinder moved.

  • Device driver: OS module that hides device details and translates generic I/O requests into device-specific commands.
  • Disk management: formatting (low-level and logical), partitioning, boot block, bad-block handling, RAID for reliability and performance.

Example

Requests 98, 183, 37, 122, 14, 124, 65, 67 with head at 53: FCFS moves 640 cylinders; SSTF 236; SCAN (towards 0) 236; C-LOOK 322.

3

Topic 3

Disk management

  • Low-level formatting divides the disk into sectors; partitioning divides it into logical disks; logical formatting creates a file system. The boot block holds the bootstrap loader; bad blocks are detected and spared.
4

Topic 4

RAID structure

ComparisonRAID levels
Method
Feature

RAID 0

Striping without redundancy

Fast; no fault tolerance

RAID 1

Mirroring

Survives one disk failure; 50% capacity

RAID 5

Block striping with distributed parity

Survives one failure; good read performance

RAID 6

Two parity blocks

Survives two failures

RAID 10 (1 + 0)

Mirrored pairs, striped

Fast and fault tolerant; costly

  • RAID (redundant array of independent disks) improves performance through striping and reliability through redundancy (mirroring or parity).
5

Topic 5

I/O traffic controller and I/O scheduler

ComparisonI/O subsystem components
I/O traffic controller
I/O scheduler

Role

Keeps track of the status of devices, control units and channels and finds a free path for a request

Decides the order in which waiting I/O requests are served

Data kept

Channel, control unit and device control blocks

Request queues with priorities

Goal

Path availability

Fairness and efficiency

  • I/O device handler processes interrupts and runs the disk scheduling algorithm. Buffering, caching and spooling smooth speed differences between devices and processes.
6

Topic 6

File concepts

  • File: named collection of related information on secondary storage; attributes — name, type, location, size, protection, timestamps, owner.
  • Operations: create, open, read, write, reposition (seek), delete, truncate, close; the OS maintains an open-file table.
7

Topic 7

Access methods

ComparisonFile access methods
How it works
Example

Sequential

Records read in order

Log files, tapes, text processing

Direct (random)

Any block accessed by number

Databases, airline reservations

Indexed

Index points to blocks; search index then access

Large files with key-based look-up

8

Topic 8

Directory and disk structure

ClassificationDirectory structures
Directories
  • Single-level

    All files in one directory — naming conflicts

  • Two-level

    Separate directory per user

  • Tree-structured

    Hierarchical folders with paths

  • Acyclic graph

    Shared files and subdirectories (links)

  • General graph

    Allows cycles — needs garbage collection

  • Operations: search, create, delete, list, rename, traverse; absolute and relative path names.
9

Topic 9

File system implementation

ComparisonAllocation methods
How blocks are found
Pros and cons

Contiguous

Start block and length

Fast sequential and direct access; external fragmentation

Linked

Each block points to the next (FAT keeps pointers in a table)

No fragmentation; slow direct access

Indexed

An index block lists all data blocks (Unix inode)

Fast direct access; index overhead

Key termsFree-space management
Bit vector
One bit per block
Linked list
Free blocks linked together
Grouping
First free block stores addresses of n free blocks
Counting
Start address and count of contiguous free blocks
  • Layers: application → logical file system (metadata, FCB or inode) → file-organisation module → basic file system → I/O control → devices.
10

Topic 10

Protection

  • Access control lists (ACLs): list of users and their permissions for each file.
  • Unix permissions: owner, group, others × read, write, execute (rwxr-xr--; chmod 754).
  • Passwords and encryption for sensitive files.
11

Topic 11

Security

  • Security goals: confidentiality, integrity, availability.
  • Unauthorised use: intruders (casual users, insiders, hackers), stolen credentials, privilege escalation, exploitation of software bugs (buffer overflow).
  • Denial of service (DoS): making a system or service unavailable by overwhelming it — DDoS uses many compromised machines (botnets).
12

Topic 12

Case studies: Linux and Windows

ComparisonLinux and Windows
Linux
Windows

Kernel

Monolithic with loadable modules

Hybrid (NT kernel, executive, HAL)

Processes and threads

fork and exec; tasks scheduled by the EEVDF scheduler (earlier CFS)

CreateProcess; priority-based preemptive thread scheduling with 32 levels

Memory

Demand paging, page cache, swap

Demand paging with working sets, page file

File systems

ext4, XFS, Btrfs; everything is a file

NTFS (journaling, ACLs), ReFS, FAT32

Security

Users, groups, rwx permissions, SELinux, AppArmor

Access tokens, ACLs, User Account Control, BitLocker

Licence

Open source (GPL)

Proprietary

Key terms

Seek time
Time to move the disk arm to the required track
RAID
Array of disks for performance and reliability
I/O traffic controller
Component tracking paths to devices
Inode
Unix structure holding file metadata and block pointers
Access control list
List of users and their permissions on an object

Quick revision

  • Tracks, sectors, cylinders; access time; SSDs.
  • FCFS, SSTF, SCAN, C-SCAN, LOOK, C-LOOK; formatting, boot and bad blocks.
  • RAID 0, 1, 5, 6, 10; traffic controller, scheduler, handler; buffering, spooling.
  • File attributes and operations; sequential, direct, indexed access; directory structures.
  • Contiguous, linked, indexed allocation; free-space management; protection and security; Linux vs Windows.

Important exam questions

Practice questions written to the PTU exam pattern for this unit's syllabus: short answers (Section A style) and long answers (Sections B and C style).

Short-answer questions

  1. Q1.Define seek time and rotational latency.
  2. Q2.Which disk scheduling algorithm can starve requests?
  3. Q3.Distinguish RAID 0 and RAID 1.
  4. Q4.What does the I/O traffic controller do?
  5. Q5.Distinguish linked and indexed allocation.
  6. Q6.Name two file systems used by Linux.

Long-answer questions

  1. Q1.Explain disk scheduling algorithms with a numerical example.
  2. Q2.Explain RAID levels.
  3. Q3.Explain file system implementation and allocation methods.
  4. Q4.Compare Linux and Windows as case studies.

Stuck on this unit?

Message SBS on WhatsApp for help with Operating System, or to ask about studying M.Sc IT at Synetic.

WhatsApp us