Recap: What are the tasks of the OS?
1. Extension / Abstraction of Hardware
The OS abstracts and hides the complexity of different hardware types, providing a uniform interface to applications.
Processor (different architectures and instruction sets)
Graphics card (various GPUs and drivers)
Mass storage devices (hard drives, SSDs)
Local and remote services (including access over computer networks)
2. Resource Management
The OS manages hardware and software resources to ensure efficient and fair use:
CPU (scheduling and execution of processes)
Memory
Main memory (RAM) management
Mass storage devices (hard disks, SSDs)
Archival storage devices (tapes, optical media)
Peripheral devices (input/output devices, printers, etc.)
Data and Data Streams
File systems
Network data streams (communication between systems)
What are the tasks of the File System?
Tasks of the File System
Logical Structuring of the Physical Medium
Organizes raw physical storage devices (like hard drives, SSDs) into a logical structure that can be efficiently managed and accessed.
Abstraction from the Physical Structure
Hides the complexity of the physical layout of data (sectors, blocks, tracks).
Provides a uniform, abstract interface for users and applications.
User-Friendly Presentation
Presents stored data in an easily understandable format:
Graphical interfaces (file explorers)
Text-based interfaces (command-line navigation)
Organizes data logically into files and directories (folders).
Features for Managing Files and Directories
Allows creation, deletion, renaming, and modification of files and directories.
Supports access control (permissions and user rights).
Provides read/write access, search, and file metadata management (timestamps, ownership, etc.).
What are requirements are there for the File System?
simultaneous access by multiple users/processors access via network services rights management and enforcement
What are Optimization targets for the File System?
Minimize access times (e.g., caching strategies).
Maximize data efficiency: Higher ratio of user data to metadata/management data.
Efficient memory management: Optimal use of available storage capacity.
Physical data protection:
Prolong physical media lifespan.
Distribute write operations to minimize wear (wear leveling).
Monitor memory quality and replace bad sectors automatically.
Data backup: Ensure reliable recovery and protection of data + encryption
How is the File System structured?
Visualization / Application
Virtualization / Networking
Rights Management
Directory Creation
File Creation (Chaining)
Control / Linearisation
(Separates the operating system and the storage medium)
Backup if required, by embedded controller with operating system in the medium
Physical Storage
What are physical storage devices?
Hard Disk - platter surface divided into tracks and sectors
Optical Media - spiral track as vector of physical data blocks
Flash Based - vector of data block, of which the size is a power of 2 (USB,SD,MMC-Card,SSD)
What can be said about the Data Backup process?
Measurement of Magnetization Quality
Regularly assess the magnetization integrity of tapes or disks.
Detect degradation before data becomes unreadable.
Provision of Pre-Reserved Replacement Blocks
Maintain a pool of spare blocks to replace faulty ones when needed.
Renewal of Magnetization (Rewrite)
Rewrite data to restore magnetization when quality decreases beyond safe levels.
Replacement of Blocks with Permanent Loss of Quality
Reallocate data from blocks that have irreversible damage to healthy spare blocks.
What linearization in the context of file systems?
Linearization refers to the process of organizing and mapping data stored on physical storage devices (e.g., disks, SSDs) into a logical, continuous structure that the operating system and applications can easily manage and access.
The physical layout of data on a storage medium is often fragmented or spread across different locations (blocks, sectors, pages).
Linearization ensures that this fragmented physical data is presented logically as if it were stored sequentially (linearly).
It simplifies data access and management by abstracting the complexity of the underlying physical storage.
What assumptions are made about the logical structure of mass storage devices?
• Logical structures are introduced to standardize different physical structures.
• We assume the logical structure of mass storage devices to be a vector of blocks.
Each logical block has a block number, where 0 ≤ n < N.
0 ≤ n < N
Each block contains b bytes. Typically, b = 2^i.
b
b = 2^i
De facto standard block size: b = 4 KB (4096 bytes).
b = 4 KB
N is the total number of blocks on the storage medium.
N
The total capacity of the storage medium (in bytes) is calculated as: Capacity = b × N
b × N
The logical structure of blocks and their organization is managed by the operating system.
What other aspects can be assumed about the logical structure of a storage medium?
• Mass and archival storage devices consist of a known number of blocks, X, with a constant block size, bx.
• On magnetic tape, the blocks are naturally arranged in a sequence.
• Disk memory units need to undergo a linearisation procedure.
• Each physical block has an address p.
• In media that have a physically linear structure, the physical block number p, and the logical block number n can be converted directly.
Sketch direct and conversion mapping between the physical structure of a USB stick and the resulting logical structure
Sketch the conversion between the physical structure of a HDD and its reulting logical structure.
Whats the difference between cylinders and tracks with relation to HDD?
How is a HDD physically structured?
How can N the total number of blocks made available by a HDD be calculated?
Physical address: (c, h, s)
(c, h, s)
Ranges:
0 ≤ c < C (Cylinders)
0 ≤ c < C
0 ≤ h < H (Heads)
0 ≤ h < H
0 ≤ s < S (Sectors)
0 ≤ s < S
Total blocks (sectors): N = C × H × S
N = C × H × S
Linear block address: n, where 0 ≤ n < N
n
How can n (location) be calculated?
n = c × H × S + h × S + s
How can c,h and s be reconstructed from the sequential adress?
n = c*H*S + h*S + s
n / S = c*H + h remainder: s
p%S = s
(c*H + h) / H = c remainder: h
(c*H +h)%H = h
or Reconstruction Steps
s = p % S
temp = p / S
h = temp % H
c = temp / H
What is a file?
A file is a number of sequentially linked blocks. The first block of a file is defined by the directory.
Who carries out the sequencing of sectors and where is the information stored?
Logical sequencing of sectors is done by the OS
Information for this is saved in a file system
Different File Systems differ in the way of organising sequential order and saved meta information
What is a directory?
A directory is a special file, visualized differently by the operating system.
Its contents can’t be accessed directly (like regular file data).
Instead, specific file system functions are used:
Create, delete, move, rename, etc.
Metadata about files and subdirectories, including:
File or directory name
Size
Starting sector/block (location on disk)
Access rights/permissions
What types of file organization exist?
Sequential File Organization
All blocks of a file are stored in physically adjacent blocks on the storage medium.
The directory stores the starting block and file length for each file.
Ideal for sequential access and large data processing.
Random File Organization
Linked List of Blocks
Each block contains a pointer to the next block in the file.
Linked by a Separate Table (e.g., FAT)
A File Allocation Table (FAT) maintains pointers to the next block for each file.
Special File Management Objects
I-node (Unix/Linux): Contains metadata and pointers to file blocks.
MFT (Master File Table) records (NTFS, Windows): Store file metadata and block locations.
Sketch the differnt orgaization types.
What is FAT?
FAT (File Allocation Table) file systems (FAT16, FAT32) link disk blocks using a block table stored in main memory.
Common in DOS, Windows (up to 98), and supported in Unix/Linux systems.
Key Points:
The FAT is stored at a fixed location on the disk and loaded into RAM for fast access to block sequences.
If the FAT is damaged, reconstructing the file system is extremely difficult.
To protect against damage, the FAT is stored redundantly multiple times on the disk.
The locations of these FAT copies are fixed.
How does an i-node based file system work and what bdoes it look like?
•The superblock contains information on the storage medium
• i-nodes and indirect blocks together form a data structure for the efficient organisation of “large” storage media
•Data blocks are comparable to the blocks in the previously presented systems
An i-node block contains the following info:
Do indirect blocks exist in i-node type file systems?
Yes.
What differnt types of file organization exist? Sketch them!
Flat directory structure
User oriented directory structure (one hierarchy level)
Random tree per user
What types of rights managemnt exist and how do they work?
• Files can contain information on access rights (in the directory).
• The operating system applies these rights and enforces them.
Example:
traditional UNIX/Linux file permissions File owner is a user, the owner is registered in the directory. All users belong to groups. They can assign the file to one of those groups. Each file has the following rights attributes
• u: what are the rights of the user who owns the file?
• g: what are the rights of the group to which the file is assigned?
• o: what are the rights of all others who want to use the file?
Example: file-ACL (Access Control List)
More sophisticated variant. Access rights are managed based on individual users and groups (not only one).
Exists as an extension to conventional Unix/Linux file permissions
extended ACLs
Also used in Windows for NTFS file permission management
Windows ACLs
Virtualization for file systems?
File system of a mass storage medium is represented as a drive (C:) is usually the file system of which Windows was booted
Visualization types for file systems?
Window-Based Interface
Graphical visualization of files and directories, sometimes with previews.
Interaction through gestures (mouse clicks, drag-and-drop) for file operations and starting programs.
Keyboard input is mainly used for renaming files or directories.
Text-Based Interface
Console or terminal displays file and directory names in text form.
Commands typed into the console perform file operations or start programs (e.g., mkdir, rm, cd, ls).
mkdir
rm
cd
ls
Summary?
The complexity of file systems and storage devices is managed through a layered abstraction model.
The operating system abstracts physical storage devices by providing a unified Logical Block Addressing (LBA) scheme—a vector of equally sized data blocks.
On top of LBA, file systems are built, introducing files, directories, and access rights.
Further abstraction virtualizes storage, whether local or network-based, and provides a file system-independent visualization for users and applications.
Zuletzt geändertvor einem Monat