Other File Systems: LFS, NFS, and Afs
Other File Systems: LFS, NFS, and Afs
file1
inode
directory
dir1
dir2
Unix File
System
inode map
dir2
dir1
Log
file1
data
file2
Log-Structured
File System
Blocks written to
create two 1-block
files: dir1/file1 and
dir2/file2, in UFS and
LFS
LFS Cleaning
Finite disk space implies that the disk is eventually full
Fortunately, some segments have stale information
A file overwrite causes i-node to point to new blocks
Old ones still occupy space
Naming transparency
Load balancing
Scalability
Location and network transparency
Fault tolerance
Transfer Model
Upload/download Model:
Client downloads file, works on it, and writes it back on server
Simple and good performance
Naming transparency
Naming is a mapping from logical to physical objects
Ideally client interface should be transparent
Not distinguish between remote and local files
/machine/path or mounting remote FS in local hierarchy are not
transparent
10
Caching
Keep repeatedly accessed blocks in cache
Improves performance of further accesses
How it works:
Where to cache?
Disk: Pros: more reliable, data present locally on recovery
Memory: Pros: diskless workstations, quicker data access,
Servers maintain cache in memory
11
Delayed write:
File Locking:
The upload/download model locks a downloaded file
Other processes wait for file lock to be released
12
Architecture:
A server exports one or more of its directories to remote clients
Clients access exported directories by mounting them
The contents are then accessed as if they were local
13
Example
14
NFS Protocol
Supports directory and file access via remote procedure
calls (RPCs)
All UNIX system calls supported other than open & close
Open and close are intentionally not supported
NFS Implementation
Three main layers:
System call layer:
Handles calls like open, read and close
17
18
Open:
Kernel realizes that file is on remotely mounted directory
Finds r-node in v-node for the directory
NFS client code then opens file, enters r-node for file in VFS, and
returns file descriptor for remote node
19
Cache coherency
Clients cache file attributes and data
If two clients cache the same data, cache coherency is lost
Solutions:
Each cache block has a timer (3 sec for data, 30 sec for dir)
Entry is discarded when timer expires
20
Features:
AFS Overview
Based on the upload/download model
Clients download and cache files
Server keeps track of clients that cache the file
Clients upload files at end of session
22
AFS Details
Has dedicated server machines
Clients have partitioned name space:
Local name space and shared name space
Cluster of dedicated servers (Vice) present shared name space
Clients run Virtue protocol to communicate with Vice
Other issues:
Scalability, client mobility, security, protection, heterogeneity
23
AFS Implementation
Client cache is a local directory on UNIX FS
Venus and server processes access file directly by UNIX i-node
Venus has 2 caches, one for status & one for data
Uses LRU to keep them bounded in size
26
Summary
LFS:
Local file system
Optimize writes
NFS:
Simple distributed file system protocol. No open/close
Stateless server
Has problems with cache consistency, locking protocol
AFS:
More complicated distributed file system protocol
Stateful server
session semantics: consistency on close
27
28
29
30
31
32
Backup Issues
Should the entire FS be backup up?
Binaries, special I/O files usually not backed up
33
Backup Strategies
Physical Dump
Start from block 0 of disk, write all blocks in order, stop after last
Pros: Simple to implement, speed
Cons: skip directories, incremental dumps, restore some file
No point dumping unused blocks, avoiding it is a big overhead
How to dump bad blocks?
Logical Dump
Start at a directory
dump all directories and files changed since base date
Base date could be of last incremental dump, last full dump, etc.
Also dump all dirs (even unmodified) in path to a modified file
34
Logical Dumps
Why dump unmodified directories?
Restore files on a fresh FS
To incrementally recover a single file
35
A Dumping Algorithm
Algorithm:
36
37