Unit 4 of 4 · M.Sc IT Sem 1

Unit 4: Device and file management

Operating System notes · PTU syllabus (PGCA1903)

5 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
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.

Example

Disk access time: seek time 5 ms + rotational latency 3 ms + transfer time 0.5 ms = 8.5 ms per access. Disk scheduling reduces total seek time across many requests.

Exam tip

Access time = seek time + rotational latency + transfer time.

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.

Example

Preparing a new disk: the manufacturer low-level formats it into sectors; the user partitions it into C: and D:; each partition is formatted with a file system (NTFS, ext4); a boot block holds the bootstrap loader.

Exam tip

Bad blocks are handled by sector sparing (spare sectors replace bad ones).

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).

Example

Choosing a RAID level: a video editing workstation uses RAID 0 for speed (no protection); a small office file server uses RAID 1 (mirroring) for safety; a database server uses RAID 5 or RAID 10 for a balance of performance and redundancy.

Exam tip

RAID 0 = striping, RAID 1 = mirroring, RAID 5 = striping with distributed 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.

Example

Coordinating I/O: the traffic controller tracks the status of every device, channel and control unit; the scheduler decides which waiting request goes next; the device handler starts the actual transfer.

Exam tip

Three parts of the I/O subsystem: traffic controller, scheduler and device handler.

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.

Example

File attributes: report.docx has a name, type (.docx), location on disk, size (48 KB), protection (owner can read and write) and timestamps for creation and last modification.

Exam tip

Operations: create, open, read, write, reposition (seek), delete and truncate.

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

Example

Choosing access: a log file is read sequentially; a database jumps directly to record 5,000; an indexed file looks up a roll number in an index and then jumps to the record.

Exam tip

Sequential suits tapes and logs; direct suits disks and databases; indexed combines both.

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.

Example

Tree directories: /home/asha/notes.txt and /home/ravi/notes.txt can coexist because they are in different directories. A single-level directory would allow only one notes.txt.

Exam tip

Compare single-level, two-level, tree, acyclic-graph and general graph structures.

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.

Example

Allocation methods compared: a 5-block file stored contiguously at blocks 10–14 is fast to read but can't grow easily; linked allocation chains blocks anywhere but is slow for random access; indexed allocation keeps all block numbers in an index block, supporting direct access.

Exam tip

Learn the pros and cons of contiguous, linked and indexed allocation.

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.

Example

Linux permissions: -rwxr-x--- means the owner can read, write and execute; the group can read and execute; others have no access. chmod 750 file sets exactly these permissions.

Exam tip

Protection controls access by users and processes; ACLs give per-user rights.

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).

Example

Threats to each goal: stealing a password file breaks confidentiality; altering exam marks breaks integrity; a denial-of-service attack on a portal breaks availability.

Exam tip

Link threats to the CIA triad and name a defence for each.

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

Example

Same task, two systems: to list running processes, Linux uses ps aux or top; Windows uses Task Manager or tasklist. Linux uses ext4 and permissions; Windows uses NTFS and ACLs.

Exam tip

Compare kernel design, file system, user interface and security model.

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.

Planning your M.Sc IT in Ludhiana? See the M.Sc IT at SBS →

WhatsApp us