What is a File System?
Definition
A file system organizes and manages files and directories on storage
devices.
Common Types
• FAT: Older Windows systems
• NTFS: Modern Windows with permissions and encryption
• ext: Linux and Unix-based systems
• HFS: macOS
• APFS: New Apple file system for Macs and iOS
Issues Handled By
File
▪ The System
file system’s job is to keep the files organized in the best way possible.
▪ A free space is created on the hard drive whenever a file is deleted from it.
▪ To reallocate them to other files, many of these spaces may need to be recovered
▪ Choosing where to store the files on the hard disc is the main issue with files one block
may or may not be used to store a file.
▪ It may be kept in the disk’s non-contiguous blocks.
▪ We must keep track of all the blocks where the files are partially located.
Files Attributes And Their Operations
File Types and Their Content
File Directories and Their Advantages
Directory Advantages
Contents
• Name, type, address • Efficient file location
• File length and dates • Convenient naming for users
• Owner ID and protection info • Logical grouping of files
File Directories
• The collection of files is a file directory.
• The directory contains information about the files, including attributes, location, and ownership.
• Much of this information, especially that is concerned with storage, is managed by the operating system.
• The directory is itself a file, accessible by various file management routines.
Information contained in a device directory.
•Name
•Type
•Address
•Current length
•Maximum length
•Date last accessed
•Date last updated
•Owner id
•Protection information
Operation performed on the directory are
•Search for a file
•Create a file
•Delete a file
•List a directory
•Rename a file
•Traverse the file system
Directory Structures: Single, Two-Level
Single-Level Directory
•A single directory is shared by all users,
preventing duplicate file names across Two-level Directory
users. •Each user has a separate directory, allowing the same
•Lacks file grouping, making organization file name to be used by different users.
based on user needs difficult. •File location is identified using a two-level path name,
enabling efficient searching.
Directory Structures: Tree
Tree-Structured Directory
•Directories are organized in a tree structure, enabling
efficient searching and file grouping.
•Supports both absolute and relative path names for file
access.
File Allocation Methods
Continuous Allocation Linked Allocation
Allocates blocks
Allocates a single continuous non-contiguously with pointers
set of blocks for a file, linking blocks, avoiding
improving sequential access external fragmentation but
performance but causing supporting only sequential
external fragmentation. access.
File Allocation Methods
Indexed Allocation
Allocates blocks
non-contiguously with pointers
linking blocks, avoiding
external fragmentation but
supporting only sequential
access.