Other File Systems: LFS and NFS. 2 Log-Structured File Systems The trend: CPUs are faster, RAM & caches are bigger –So, a lot of reads do not require.

Slides:



Advertisements
Similar presentations
More on File Management
Advertisements

Mendel Rosenblum and John K. Ousterhout Presented by Travis Bale 1.
Serverless Network File Systems. Network File Systems Allow sharing among independent file systems in a transparent manner Mounting a remote directory.
CS-550: Distributed File Systems [SiS]1 Resource Management in Distributed Systems: Distributed File Systems.
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Emery Berger University of Massachusetts Amherst Operating Systems CMPSCI 377 Lecture.
Ken Birman. Distributed File Systems Goal: view a distributed system as a file system Storage is distributed Web tries to make world a collection of hyperlinked.
Distributed File Systems
File System Implementation
Distributed File Systems: RPC, NFS, and AFS
Other File Systems: AFS, Napster. 2 Recap NFS: –Server exposes one or more directories Client accesses them by mounting the directories –Stateless server.
Other File Systems: LFS, NFS, and AFS
NFS. The Sun Network File System (NFS) An implementation and a specification of a software system for accessing remote files across LANs. The implementation.
University of Pennsylvania 11/21/00CSE 3801 Distributed File Systems CSE 380 Lecture Note 14 Insup Lee.
File Systems Implementation. 2 Goals for Today Filesystem Implementation Structure for –Storing files –Directories –Managing free space –Shared files.
Dr. Kalpakis CMSC 421, Operating Systems File System Implementation.
File Systems (2). Readings r Silbershatz et al: 11.8.
DESIGN AND IMPLEMENTATION OF THE SUN NETWORK FILESYSTEM R. Sandberg, D. Goldberg S. Kleinman, D. Walsh, R. Lyon Sun Microsystems.
Lecture 23 The Andrew File System. NFS Architecture client File Server Local FS RPC.
Distributed File Systems Concepts & Overview. Goals and Criteria Goal: present to a user a coherent, efficient, and manageable system for long-term data.
CSE 486/586, Spring 2012 CSE 486/586 Distributed Systems Distributed File Systems Steve Ko Computer Sciences and Engineering University at Buffalo.
CSC 456 Operating Systems Seminar Presentation (11/13/2012) Leon Weingard, Liang Xin The Google File System.
Distributed File Systems 1 CS502 Spring 2006 Distributed Files Systems CS-502 Operating Systems Spring 2006.
Networked File System CS Introduction to Operating Systems.
Distributed Systems. Interprocess Communication (IPC) Processes are either independent or cooperating – Threads provide a gray area – Cooperating processes.
Distributed File Systems
Operating System Concepts with Java – 7 th Edition, Nov 15, 2006 Silberschatz, Galvin and Gagne ©2007 Chapter 11: File System Implementation.
Distributed file systems, Case studies n Sun’s NFS u history u virtual file system and mounting u NFS protocol u caching in NFS u V3 n Andrew File System.
Distributed File Systems Overview  A file system is an abstract data type – an abstraction of a storage device.  A distributed file system is available.
Chapter 20 Distributed File Systems Copyright © 2008.
What is a Distributed File System?? Allows transparent access to remote files over a network. Examples: Network File System (NFS) by Sun Microsystems.
Introduction to DFS. Distributed File Systems A file system whose clients, servers and storage devices are dispersed among the machines of a distributed.
1 File Systems: Consistency Issues. 2 File Systems: Consistency Issues File systems maintains many data structures  Free list/bit vector  Directories.
Log-Structured File Systems
Ridge Xu 12.1 Operating System Concepts Chapter 12: File System Implementation File System Structure File System Implementation Directory Implementation.
ITEC 502 컴퓨터 시스템 및 실습 Chapter 11-2: File System Implementation Mi-Jung Choi DPNM Lab. Dept. of CSE, POSTECH.
Computer Science Lecture 19, page 1 CS677: Distributed OS Last Class: Fault tolerance Reliable communication –One-one communication –One-many communication.
Sun Network File System Presentation 3 Group A4 Sean Hudson, Syeda Taib, Manasi Kapadia.
Advanced Operating Systems - Spring 2009 Lecture 20 – Wednesday April 1 st, 2009 Dan C. Marinescu Office: HEC 439 B.
Chapter 11: File System Implementation Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Jan 1, 2005 File-System Structure.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition File System Implementation.
GLOBAL EDGE SOFTWERE LTD1 R EMOTE F ILE S HARING - Ardhanareesh Aradhyamath.
Distributed File Systems Group A5 Amit Sharma Dhaval Sanghvi Ali Abbas.
Lecture 25 The Andrew File System. NFS Architecture client File Server Local FS RPC.
Review CS File Systems - Partitions What is a hard disk partition?
Distributed File Systems Questions answered in this lecture: Why are distributed file systems useful? What is difficult about distributed file systems?
Chapter Five Distributed file systems. 2 Contents Distributed file system design Distributed file system implementation Trends in distributed file systems.
Distributed Systems: Distributed File Systems Ghada Ahmed, PhD. Assistant Prof., Computer Science Dept. Web:
Case Study -- Sun’s Network File System (NFS) NFS is popular and widely used. NFS was originally designed and implemented by Sun Microsystems for use on.
Computer Science Lecture 19, page 1 CS677: Distributed OS Last Class: Fault tolerance Reliable communication –One-one communication –One-many communication.
DISTRIBUTED FILE SYSTEM- ENHANCEMENT AND FURTHER DEVELOPMENT BY:- PALLAWI(10BIT0033)
Chapter 12: File System Implementation
Chapter 11: File System Implementation
Distributed File Systems
File System Implementation
NFS and AFS Adapted from slides by Ed Lazowska, Hank Levy, Andrea and Remzi Arpaci-Dussea, Michael Swift.
Multiple Processor Systems
CSE 451: Operating Systems Winter Module 22 Distributed File Systems
Chapter 11: File System Implementation
Distributed File Systems
DISTRIBUTED FILE SYSTEMS
Distributed File Systems
CSE 451: Operating Systems Spring Module 21 Distributed File Systems
DESIGN AND IMPLEMENTATION OF THE SUN NETWORK FILESYSTEM
Distributed File Systems
Multiple Processor and Distributed Systems
CSE 451: Operating Systems Winter Module 22 Distributed File Systems
Chapter 15: File System Internals
DISTRIBUTED SYSTEMS Principles and Paradigms Second Edition ANDREW S
Distributed File Systems
Distributed File Systems
Presentation transcript:

Other File Systems: LFS and NFS

2 Log-Structured File Systems The trend: CPUs are faster, RAM & caches are bigger –So, a lot of reads do not require disk access –Most disk accesses are writes  pre-fetching not very useful –Worse, most writes are small  10 ms overhead for 50 µs write –Example: to create a new file: i-node of directory needs to be written Directory block needs to be written i-node for the file has to be written Need to write the file –Delaying these writes could hamper consistency Solution: LFS to utilize full disk bandwidth

3 LFS Basic Idea Structure the disk a log –Periodically, all pending writes buffered in memory are collected in a single segment –The entire segment is written contiguously at end of the log Segment may contain i-nodes, directory entries, data –Start of each segment has a summary –If segment around 1 MB, then full disk bandwidth can be utilized Note, i-nodes are now scattered on disk –Maintain i-node map (entry i points to i-node i on disk) –Part of it is cached, reducing the delay in accessing i-node This description works great for disks of infinite size

4 LFS vs. UFS file1 file2 dir1dir2 Unix File System file1file2 dir1 dir2 Log-Structured File System Log inode directory data inode map Blocks written to create two 1-block files: dir1/file1 and dir2/file2, in UFS and LFS

5 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 Solution: LFS Cleaner thread compacts the log –Read segment summary, and see if contents are current File blocks, i-nodes, etc. –If not, the segment is marked free, and cleaner moves forward –Else, cleaner writes content into new segment at end of the log –The segment is marked as free! Disk is a circular buffer, writer adds contents to the front, cleaner cleans content from the back

6 Distributed File Systems Goal: view a distributed system as a file system –Storage is distributed –Web tries to make world a collection of hyperlinked documents Issues not common to usual file systems –Naming transparency –Load balancing –Scalability –Location and network transparency –Fault tolerance We will look at some of these today

7 Transfer Model Upload/download Model: –Client downloads file, works on it, and writes it back on server –Simple and good performance Remote Access Model: –File only on server; client sends commands to get work done

8 Directory Hierarchy

9 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 A transparent DFS hides the location of files in system 2 forms of transparency: –Location transparency: path gives no hint of file location /server1/dir1/dir2/x tells x is on server1, but not where server1 is –Location independence: move files without changing names Separate naming hierarchy from storage devices hierarchy

10 File Sharing Semantics Sequential consistency: reads see previous writes –Ordering on all system calls seen by all processors –Maintained in single processor systems –Can be achieved in DFS with one file server and no caching

11 Caching Keep repeatedly accessed blocks in cache –Improves performance of further accesses How it works: –If needed block not in cache, it is fetched and cached –Accesses performed on local copy –One master file copy on server, other copies distributed in DFS –Cache consistency problem: how to keep cached copy consistent with master file copy Where to cache? –Disk: Pros: more reliable, data present locally on recovery –Memory: Pros: diskless workstations, quicker data access, –Servers maintain cache in memory

12 File Sharing Semantics Other approaches: –Write through caches: immediately propagate changes in cache files to server Reliable but poor performance –Delayed write: Writes are not propagated immediately, probably on file close Session semantics: write file back on close Alternative: scan cache periodically and flush modified blocks Better performance but poor reliability –File Locking: The upload/download model locks a downloaded file Other processes wait for file lock to be released

13 Network File System (NFS) Developed by Sun Microsystems in 1984 –Used to join FSes on multiple computers as one logical whole Used commonly today with UNIX systems Assumptions –Allows arbitrary collection of users to share a file system –Clients and servers might be on different LANs –Machines can be clients and servers at the same time 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

14 Example

15 NFS Mount Protocol Client sends path name to server with request to mount –Not required to specify where to mount If path is legal and exported, server returns file handle –Contains FS type, disk, i-node number of directory, security info –Subsequent accesses from client use file handle Mount can be either at boot or automount –Using automount, directories are not mounted during boot –OS sends a message to servers on first remote file access –Automount is helpful since remote dir might not be used at all Mount only affects the client view!

16 NFS Protocol Supports directory and file access via RPCs All UNIX system calls supported other than open & close Open and close are intentionally not supported –For a read, client sends lookup message to server –Server looks up file and returns handle –Unlike open, lookup does not copy info in internal system tables –Subsequently, read contains file handle, offset and num bytes –Each message is self-contained Pros: server is stateless, i.e. no state about open files Cons: Locking is difficult, no concurrency control

17 NFS Implementation Three main layers: –System call layer: Handles calls like open, read and close –Virtual File System Layer: Maintains table with one entry (v-node) for each open file v-nodes indicate if file is local or remote –If remote it has enough info to access them –For local files, FS and i-node are recorded –NFS Service Layer: This lowest layer implements the NFS protocol

18 NFS Layer Structure

19 How NFS works? Mount: –Sys ad calls mount program with remote dir, local dir –Mount program parses for name of NFS server –Contacts server asking for file handle for remote dir –If directory exists for remote mounting, server returns handle –Client kernel constructs v-node for remote dir –Asks NFS client code to construct r-node for file handle 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

20 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 –On open of cached file, its last modify time on server is checked If cached copy is old, it is discarded –Every 30 sec, cache time expires All dirty blocks are written back to the server