Operating System · Unit 04

File System

A file system gives the operating system a reliable way to name, store, retrieve, share and protect information on secondary storage. Work through the unit in the order a real file travels: from an application, into a directory, across disk blocks, and back again.

What is a file system?

A file system is the set of data structures, rules and operating-system services that organise files on a storage device. It turns raw blocks into meaningful names such as notes.txt, remembers where each file lives, and checks whether a process is allowed to use it.

File — A named collection of related information stored on secondary storage.
Metadata — Details such as size, owner, timestamps, permissions and block locations.
Directory — A special file that maps names to file records and subdirectories.
Mounting — Making a file system available at a directory in the system tree.

Real-world analogy: A library catalogue

A file is a book, the directory is the catalogue, metadata is the label on the book, and the file system is the librarian that can locate, lend and protect every item.
Experiment: File lifecycle: create → write → delete

Select a file or create a draft, then watch how an operating system coordinates the application, file record and disk blocks.

Application

open · read · write · close

File control table

name · owner · size · block pointers

Disk blocks

data and free-space map

/home/student

System event

The file system is ready for an operation.

type: textstate: saved
File attributes, operations and access methods

Attributes

Name, identifier, type, location, size, protection, owner and creation or modification times.

Operations

Create, open, read, write, seek, close, rename and delete. The OS validates each request.

Access methods

Sequential reads in order; direct jumps to a block; indexed uses an index to find records quickly.

Quick quiz

1. Which structure maps a human-readable file name to its file record?

2. Which access method jumps directly to a known position?