DP

L33_Ch12d

Chapter 12: File Management (Part D: Sections 12.8-End)

Applications of General Concepts in Various Operating Systems


Page 1: Overview

  • This section covers file management principles as they pertain to various operating systems.


Page 2: UNIX File Management

Types of Files in UNIX

  • 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!


Page 3: INodes in UNIX

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


Page 4: Structure of INodes

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


Page 5: File Allocation in UNIX

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


Page 6: Capacity of a FreeBSD File

  • 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


Page 7: UNIX Directories and INodes

  • INode Table Example:

    • Directory mapping, showing file names and their associated INodes.


Page 8: Volume Structure in UNIX

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


Page 9: LINUX Virtual File System (VFS)

  • Components of LINUX VFS:

    • Individual file systems, device drivers, buffer cache, system call interface, user applications.


Page 10: VFS Concept in LINUX

  • Illustrates mapping of user processes to secondary storage through system calls and disk I/O calls using VFS system calls.


Page 11: Primary Object Types in VFS

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


Page 12: The Superblock Object

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


Page 13: The INode Object

  • Holds information on file characteristics excluding the file name and content.

  • Attributes might include owner, permissions, access times, size, and number of links.


Page 14: The DEntry Object

  • Purpose: Represents components in a path for faster lookup.

  • Links to INodes and superblocks, including parent DEntry pointers.


Page 15: The File Object

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


Page 16: Caches in VFS

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


Page 17: Windows File System - NTFS

  • Designed for high-end workstation and server requirements.

  • Key features include recoverability, security, handling large disks/files, multiple data streams, journaling, compression, and linking.


Page 18: NTFS Volume and File Structure

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


Page 19: NTFS Partition and Cluster Sizes

  • Table outlining sector and cluster sizes corresponding to various volume sizes, highlighting the relationship between cluster count and byte size.


Page 20: NTFS Volume Layout

  • Diagram representing how NTFS structures volume with system files, boot sector, and Master File Table.


Page 21: Master File Table (MFT)

  • Central to the Windows file system; a structured table containing records describing each file.

  • Distinction between MFT records and actual data file records highlighted.


Page 22: NTFS File and Directory Attribute Types

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


Page 23: NTFS Components

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


Page 24: ANDROID File Structure

  • Typical directory tree layout for Android systems, showcasing root and mounted storage points.


Page 25: Database Management Interface

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