16-05-2014, 10:36 AM
UNIX Tutorial 1: File Systems
UNIX Tutorial.pdf (Size: 162.99 KB / Downloads: 21)
Representation of File Systems
• The separate file systems the system may use are
not accessed by device identifiers (such as a drive
number or a drive name) .
• They are combined into a single hierarchical tree
structure that represents the file systems as one
whole single entity.
• UNIX/Linux adds each new file system into this
single file system tree as it is mounted. All file
systems, of whatever type, are mounted onto a
directory and the files of the mounted file system
cover up the existing contents of that directory
Virtual File System (VFS)
• VFS allows UNIX/Linux to support many, often
very different, file systems, each presenting a
common software interface to the VFS.
• Details of the file systems are translated by
software so that all file systems appear identical to
the rest of the kernel
• Virtual File System layer allows you to
transparently mount the many different file
systems at the same time.
NFS
• Network File System
– Designed to operate with a wide range of
operating systems
• Challenge
– Simulate the semantics of the user O/S
Statelessness
• Server maintains no state
– e.g a read on the server opens, seeks, reads, and closes
– A write is similar, but the buffer is flushed to disk
before closing
• Server crash: client continues to try until server
reboots – no loss
• Client crashes: client must rebuild its own state –
no effect on server
NFS Protocol
• Client - server: server holds file systems
• Stateless protocol: The server does not
retain the state of the client operations
• Server exports filesystems (/etc/exports)
• Client (re)mounts filesystems
• File handle: used to uniquely identify a file
on the server
NFS Security Problems
• Two points of access control: mount and each
RPC; no restriction on specific users
• NFS servers blindly trust NFS clients -> exported
FS may be read by any machine
• Remember: clients maintain the state, including
permissions.
• Anyone can write a malicious NFS client, and
having UIDs and GIDs of users read the files.