Download presentation
Presentation is loading. Please wait.
Published byFrederica Lang Modified over 9 years ago
1
File Systems (2)
2
Readings r Silbershatz et al: 11.8
3
Network-Attached Storage r Client machines may also have storage
4
Do this …. r Login into two different linux machines r You should see your home directory r Now go to /tmp on one of the machines r Create a file with your last name and put your full name in the file on that machine r Now go to the other machine
5
Virtual File System r How does an operating system allow multiple types of file systems to be integrated into a directory structure? r Data structures and procedures are used to isolate the basic system-call functionality from implementation
6
Virtual File System r Three layers m File system interface: open(), read(), write() m Virtual file system (VFS): Layer VFS allows the same system call interface (the API) to be used for different types of file systems. The API is to the VFS interface, rather than any specific type of file system
7
Schematic View of Virtual File System
8
Network File Systems r I’m on a Linux machine r I go to another Linux machine m I see the same files in my home directory m Why? r This is because you are using a networked file system (NFS) r NFS also provides the protocols needed for an integrated view of directories
9
The Sun Network File System (NFS) r An implementation and a specification of a software system for accessing remote files across Local area networks (LANs) r The implementation is part of the Solaris and SunOS operating systems running on Sun workstations using an unreliable datagram protocol (UDP/IP or TCP protocol) and Ethernet
10
NFS r An NFS file server runs on a machine (which may have large disks) that has a local file system. r An NFS client runs on an arbitrary machine and access the files on machines that run NFS servers.
11
NFS r Directories can be mounted which means that they can appear in the tree structure m The directories can be on remote machines m The remote machines may use a different OS than the client machine
12
NFS Structures r Export List m Maintained by server m Information: List of local directories that server exports for mounting Names of machines that are permitted to mount them r File handle m Refers to a set of information Identifier An inode number to identify the mounted directory
13
NFS Mount Protocol r Establishes initial logical connection between server and client r Client sends a mount request message to a server m Request includes name of remote directory to be mounted and name of server machine storing it
14
NFS Mount Protocol r Following a mount request that conforms to its export list, the server returns a file handle—a key for further accesses r The mount operation changes only the user’s view and does not affect the server side
15
NFS r Support access to files on remote servers r Must support concurrency m Make varying guarantees about locking, who “wins” with concurrent writes, etc... m Must gracefully handle dropped connections
16
NFS r When an application program calls open() to obtain access to a file it is making a call to the NFS client r If the path refers to a local file, the system uses the computer’s standard file system software to access the file r If the path refers to a remote file, the system uses NFS client software to access the remote file through the NFS server
17
NFS r The NFS server handles incoming client requests r These requests are mapped to local file system operations
18
NFS Protocol r All requests have a sequence number, allowing the server to determine if a request is duplicated or if any are missing r Modern implementations use TCP/IP r What is UDP and TCP/IP? m TCP provides reliable delivery of messages in the network m UDP does not
19
NFS r Files are assumed to be shared by multiple clients r Synchronization is needed r Problem m There is a performance problem if every time a client wants to access a file it has to go to the server m Thus clients are allowed to keep a local copy of the file while they are reading and writing its contents This is referred to as caching
20
Now Try this r Go to /faculty/hanan r Open the file helloThere r Edit the file by adding your name and then save and close.
21
NFS r UNIX Semantics m When a read follows a write the read returns the value just written m When two writes happen in quick succession followed by a read, the value read is the value stored by the last write r In a centralized systems this is easy to implement r If there is no caching in NFS then this is also easy to implement
22
NFS r NFS allows clients to cache for performance reasons r How then is UNIX semantics provided? r Approach 1: m Propagate all changes to cached files back to the server as they happen m Not efficient Lots of network traffic
23
NFS r Approach 2: Change the semantics m NFS implements session semantics Changes to an open file are initially visible only to the process that modified the file m Implementation When a process closes the file, it sends a copy to the NFS server so that subsequent reads get the new value m What if two clients are caching and modifying the file at the same time?
24
NFS Client Caching r NFS Clients are allowed to cache copies of remote files for subsequent accesses r Supports close-to-open cache consistency m When client A closes a file, its contents are synchronized with the server (which has the master copy), and timestamp is changed m When client B opens the file, it checks that local timestamp agrees with server timestamp. If not, it discards local copy
25
Other r SUN m ZFS r Linux m Btrfs ZFS for Linux Still in prototype stage
26
ZFS r Integrated into Solaris 10 (2006) r The major feature that distinguishes ZFS from other file systems is ZFS’s focus on data integrity
27
ZFS r Data integrity m Assume mirrored disk m Application tries the first disk m Checksum reveals the block is corrupt on the disk m ZFS tries the second disk m Checksum indicates that the block is good m ZFS delivers the data to the application and repairs the first disk m Before ZFS the file system didn’t use checksum
28
Summary r Studied NFS
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.