Unit 4: Device and file management
Operating System notes · PTU syllabus (PGCA1903)
On this page
- Unit summary
- Secondary storage structure
- I/O devices and disk scheduling
- Disk management
- RAID structure
- I/O traffic controller and I/O scheduler
- File concepts
- Access methods
- Directory and disk structure
- File system implementation
- Protection
- Security
- Case studies: Linux and Windows
- Key terms
- Quick revision
- 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
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
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.
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.
| Algorithm | How it moves the head |
|---|---|
| FCFS | Serves requests in arrival order |
| SSTF | Serves the nearest request next (may starve far ones) |
| SCAN (elevator) | Moves end to end, serving requests on the way |
| C-SCAN | Serves in one direction only, then jumps back |
| LOOK / C-LOOK | Like 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.
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.
Topic 4
RAID structure
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).
Topic 5
I/O traffic controller and 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.
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.
Topic 7
Access methods
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
Topic 8
Directory and disk structure
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.
Topic 9
File system implementation
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
- 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.
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.
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).
Topic 12
Case studies: Linux and 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
- Q1.Define seek time and rotational latency.
- Q2.Which disk scheduling algorithm can starve requests?
- Q3.Distinguish RAID 0 and RAID 1.
- Q4.What does the I/O traffic controller do?
- Q5.Distinguish linked and indexed allocation.
- Q6.Name two file systems used by Linux.
Long-answer questions
- Q1.Explain disk scheduling algorithms with a numerical example.
- Q2.Explain RAID levels.
- Q3.Explain file system implementation and allocation methods.
- 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.
