This section covers file management principles as they pertain to various operating systems.
Regular files: Contains arbitrary data in zero or more data blocks.
Directory files: Contains a list of file names and pointers to associated INodes (index nodes).
Special files: Provide mechanisms to map physical devices to file names.
Named pipes: An inter-process communication facility.
Links: Alternative file names for existing files.
Symbolic links: A data file that points to another file name.
Note: Remember the Producer-Consumer Problem!
INodes administer all UNIX file types.
INode Definition: A control structure containing the essential information for a file.
Multiple file names can link to a single INode.
Every active INode is related to only one file, while each file is controlled by just one INode.
INodes contain attributes such as:
Mode
Owner
Timestamps
Size
Reference counts
Pointers indicating data locations in blocks.
Each INode also tracks various types of data and location pointers.
Dynamic Allocation: File allocation occurs based on need and not pre-allocated.
Indexed Method: Utilized to track files with references in the INode.
All UNIX implementations include direct and indirect pointers in the INode (single, double, triple).
Look into the FreeBSD variant for implementation details.
Table of block size and capacity for FreeBSD:
Direct: 12 blocks = 48K bytes
Single Indirect: 512 blocks = 2M bytes
Double Indirect: 512 x 512 = 256K blocks = 1G bytes
Triple Indirect: 512 x 256K = 128M blocks = 512G bytes
INode Table Example:
Directory mapping, showing file names and their associated INodes.
The UNIX file system resides on a logical disk laid out with the following:
Boot Block: Contains OS boot code.
Superblock: Contains file system attributes.
INode Table: Collection of INodes for each file.
Data Blocks: Storage for data files and subdirectories.
Components of LINUX VFS:
Individual file systems, device drivers, buffer cache, system call interface, user applications.
Illustrates mapping of user processes to secondary storage through system calls and disk I/O calls using VFS system calls.
DEntry Object: Represents a directory entry.
File Object: Represents an open file associated with a process.
Superblock Object: Represents a mounted file system.
INode Object: Represents a specific file.
Implementation follows Object-Oriented principles.
Functionality: Stores information about the specific file system.
Attributes include: device, block size, dirty flag, file system type, open files list, and mutual exclusion semaphores.
Holds information on file characteristics excluding the file name and content.
Attributes might include owner, permissions, access times, size, and number of links.
Purpose: Represents components in a path for faster lookup.
Links to INodes and superblocks, including parent DEntry pointers.
Represents an open file by a process.
Created via open() and destroyed via close().
Methods include read, write, open, release, and lock, along with various informational items.
INode Cache: Stores recent INodes for quicker access.
Directory Cache: Links directory names with their INode numbers to speed listings.
Buffer Cache: Optimizes data buffer management, reducing disk access frequency.
Designed for high-end workstation and server requirements.
Key features include recoverability, security, handling large disks/files, multiple data streams, journaling, compression, and linking.
Storage Concepts:
Sectors: Smallest physical unit (512 bytes).
Clusters: Contiguous sectors; power of 2.
Volumes: Logical partitions of one or more clusters. Maximum volume size is 2^64 clusters.
Table outlining sector and cluster sizes corresponding to various volume sizes, highlighting the relationship between cluster count and byte size.
Diagram representing how NTFS structures volume with system files, boot sector, and Master File Table.
Central to the Windows file system; a structured table containing records describing each file.
Distinction between MFT records and actual data file records highlighted.
Attributes of files/folders include standard info, attribute lists, file names, security descriptors, data contents, index roots, and bitmap records.
Note distinctions between required and optional attributes.
Overview of the integrated functionality of various components such as the I/O Manager, Cache Manager, and disk drivers for system performance and fault tolerance.
Typical directory tree layout for Android systems, showcasing root and mounted storage points.
User perspective focuses on data abstraction rather than physical files.
Overview of the interaction between DBMS and files, alongside the role of the filesystem and storage drivers.