SlideShare a Scribd company logo
1 of 142
Download to read offline
File System Interface
Amir H. Payberah
amir@sics.se
Amirkabir University of Technology
(Tehran Polytechnic)
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 1 / 79
Motivation
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 2 / 79
Motivation
For most users, the file system (FS) is the most visible aspect of an
OS.
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 3 / 79
Motivation
For most users, the file system (FS) is the most visible aspect of an
OS.
Provides mechanism to access data/programs on storage.
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 3 / 79
Motivation
For most users, the file system (FS) is the most visible aspect of an
OS.
Provides mechanism to access data/programs on storage.
The FS consists of two distinct parts:
• A collection of files.
• A directory structure that organizes and provides information about
all the files in the system.
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 3 / 79
File Concept
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 4 / 79
File Concept
Contiguous logical address space.
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 5 / 79
File Concept
Contiguous logical address space.
Types:
• Data, e.g., numeric, text data, photos, music, ...
• Program
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 5 / 79
File Concept
Contiguous logical address space.
Types:
• Data, e.g., numeric, text data, photos, music, ...
• Program
Contents defined by file’s creator. Many types:
• Text file: a sequence of characters.
• Source file: a sequence of functions.
• Executable file: a series of code sections that the loader can bring
into memory and execute.
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 5 / 79
File Types: Name and Extension
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 6 / 79
File Attributes
Name: only information kept in human-readable form.
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 7 / 79
File Attributes
Name: only information kept in human-readable form.
Identifier: unique number identifies file within file system.
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 7 / 79
File Attributes
Name: only information kept in human-readable form.
Identifier: unique number identifies file within file system.
Type: needed for systems that support different types.
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 7 / 79
File Attributes
Name: only information kept in human-readable form.
Identifier: unique number identifies file within file system.
Type: needed for systems that support different types.
Location: pointer to file location on device.
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 7 / 79
File Attributes
Name: only information kept in human-readable form.
Identifier: unique number identifies file within file system.
Type: needed for systems that support different types.
Location: pointer to file location on device.
Size: current file size.
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 7 / 79
File Attributes
Name: only information kept in human-readable form.
Identifier: unique number identifies file within file system.
Type: needed for systems that support different types.
Location: pointer to file location on device.
Size: current file size.
Protection: controls who can do reading, writing, executing.
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 7 / 79
File Attributes
Name: only information kept in human-readable form.
Identifier: unique number identifies file within file system.
Type: needed for systems that support different types.
Location: pointer to file location on device.
Size: current file size.
Protection: controls who can do reading, writing, executing.
Time, date, and user identification: data for protection, security,
and usage monitoring.
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 7 / 79
File Attributes
Name: only information kept in human-readable form.
Identifier: unique number identifies file within file system.
Type: needed for systems that support different types.
Location: pointer to file location on device.
Size: current file size.
Protection: controls who can do reading, writing, executing.
Time, date, and user identification: data for protection, security,
and usage monitoring.
Information about files are kept in the directory structure.
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 7 / 79
File Operations
Create
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 8 / 79
File Operations
Create
Write: at write pointer location.
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 8 / 79
File Operations
Create
Write: at write pointer location.
Read: at read pointer location.
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 8 / 79
File Operations
Create
Write: at write pointer location.
Read: at read pointer location.
Reposition within file: seek
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 8 / 79
File Operations
Create
Write: at write pointer location.
Read: at read pointer location.
Reposition within file: seek
Delete
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 8 / 79
File Operations
Create
Write: at write pointer location.
Read: at read pointer location.
Reposition within file: seek
Delete
Truncate: to erase the contents of a file but keep its attributes.
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 8 / 79
File Operations
Create
Write: at write pointer location.
Read: at read pointer location.
Reposition within file: seek
Delete
Truncate: to erase the contents of a file but keep its attributes.
Open(Fi): move the content of entry Fi from disk to memory.
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 8 / 79
File Operations
Create
Write: at write pointer location.
Read: at read pointer location.
Reposition within file: seek
Delete
Truncate: to erase the contents of a file but keep its attributes.
Open(Fi): move the content of entry Fi from disk to memory.
Close(Fi): move the content of entry Fi in memory to directory
structure on disk.
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 8 / 79
Open Files (1/2)
Open(Fi): move the content of a file to memory
Search the directory structure on disk for the file.
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 9 / 79
Open Files (1/2)
Open(Fi): move the content of a file to memory
Search the directory structure on disk for the file.
To avoid the constant searching: open() system should be called
before a file is first used.
• Open-file table: tracks open files
• Per-process table and system-wide table
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 9 / 79
Open Files (1/2)
Open(Fi): move the content of a file to memory
Search the directory structure on disk for the file.
To avoid the constant searching: open() system should be called
before a file is first used.
• Open-file table: tracks open files
• Per-process table and system-wide table
When the file is no longer being actively used, it is closed by the
process, and the OS removes its entry from the open-file table.
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 9 / 79
Open Files (2/2)
Several information are associated with an open file:
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 10 / 79
Open Files (2/2)
Several information are associated with an open file:
File pointer: pointer to last read/write location, per process that
has the file open.
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 10 / 79
Open Files (2/2)
Several information are associated with an open file:
File pointer: pointer to last read/write location, per process that
has the file open.
File-open count: counter of the number of times a file is open to
allow removal of data from open-file table when last processes closes
it.
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 10 / 79
Open Files (2/2)
Several information are associated with an open file:
File pointer: pointer to last read/write location, per process that
has the file open.
File-open count: counter of the number of times a file is open to
allow removal of data from open-file table when last processes closes
it.
Disk location of the file: cache of data access information.
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 10 / 79
Open Files (2/2)
Several information are associated with an open file:
File pointer: pointer to last read/write location, per process that
has the file open.
File-open count: counter of the number of times a file is open to
allow removal of data from open-file table when last processes closes
it.
Disk location of the file: cache of data access information.
Access rights: per-process access mode information.
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 10 / 79
Open File Locking (1/2)
File locks allow one process to lock a file and prevent other processes
from gaining access to it.
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 11 / 79
Open File Locking (1/2)
File locks allow one process to lock a file and prevent other processes
from gaining access to it.
Similar to reader-writer locks.
• Shared lock similar to reader lock: several processes can acquire
concurrently
• Exclusive lock similar to writer lock: only one process can acquire it
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 11 / 79
Open File Locking (2/2)
Mandatory: the OS will prevent access until the exclusive lock is
released.
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 12 / 79
Open File Locking (2/2)
Mandatory: the OS will prevent access until the exclusive lock is
released.
Advisory: the OS will not prevent applications from acquiring access
to the file, and the application must be written so that it manually
acquires the lock before accessing the file.
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 12 / 79
File Structure
Files must conform to structures that are understood by the OS.
• E.g., the OS requires that an executable file have a specific structure
so that it can determine where in memory to load the file and what
the location of the first instruction is.
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 13 / 79
File Structure
Files must conform to structures that are understood by the OS.
• E.g., the OS requires that an executable file have a specific structure
so that it can determine where in memory to load the file and what
the location of the first instruction is.
Support multiple file structures?
• The size of the OS could be big, since it needs to contain the code
to support these file structures.
• On the other hand, severe problems may result if the OS does not
support some file structures.
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 13 / 79
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 14 / 79
Files and Their Metadata
The stat structure: the metadata of a file.
Defined in <bits/stat.h>, which is included from <sys/stat.h>.
struct stat {
dev_t st_dev; /* ID of device containing file */
ino_t st_ino; /* inode number */
mode_t st_mode; /* permissions */
nlink_t st_nlink; /* number of hard links */
uid_t st_uid; /* user ID of owner */
gid_t st_gid; /* group ID of owner */
dev_t st_rdev; /* device ID (if special file) */
off_t st_size; /* total size in bytes */
blksize_t st_blksize; /* blocksize for filesystem I/O */
blkcnt_t st_blocks; /* number of blocks allocated */
time_t st_atime; /* last access time */
time_t st_mtime; /* last modification time */
time_t st_ctime; /* last status change time */
};
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 15 / 79
The Stat Family
stat() returns information about the file denoted by the path path.
fstat() returns information about the file represented by the file
descriptor fd.
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
int stat(const char *path, struct stat *buf);
int fstat(int fd, struct stat *buf);
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 16 / 79
Open a File
open() maps the file to a file descriptor.
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
int open(const char *name, int flags);
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 17 / 79
Read and Write
read() and write() to read and write from/to a file.
#include <unistd.h>
ssize_t read(int fd, void *buf, size_t len);
ssize_t write(int fd, const void *buf, size_t count);
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 18 / 79
Access Methods
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 19 / 79
Access Methods - Sequential Access
The simplest and most common access method.
Sequential access is based on a tape model of a file.
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 20 / 79
Access Methods - Sequential Access
The simplest and most common access method.
Sequential access is based on a tape model of a file.
Information in the file is processed in order, one record after the
other.
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 20 / 79
Access Methods - Sequential Access
The simplest and most common access method.
Sequential access is based on a tape model of a file.
Information in the file is processed in order, one record after the
other.
A read operation (read next()): reads the next portion of the file
and automatically advances a file pointer.
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 20 / 79
Access Methods - Sequential Access
The simplest and most common access method.
Sequential access is based on a tape model of a file.
Information in the file is processed in order, one record after the
other.
A read operation (read next()): reads the next portion of the file
and automatically advances a file pointer.
A write operation (write next()): appends to the end of the file
and advances to the end of the newly written material.
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 20 / 79
Access Methods - Direct Access
A file is made up of fixed-length logical records that allow programs
to read and write records rapidly in no particular order.
It is based on a disk model of a file.
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 21 / 79
Access Methods - Direct Access
A file is made up of fixed-length logical records that allow programs
to read and write records rapidly in no particular order.
It is based on a disk model of a file.
Immediate access to large amounts of information.
• Databases are often of this type.
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 21 / 79
Access Methods - Direct Access
A file is made up of fixed-length logical records that allow programs
to read and write records rapidly in no particular order.
It is based on a disk model of a file.
Immediate access to large amounts of information.
• Databases are often of this type.
read(n) rather than read next().
• n is the block number.
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 21 / 79
Access Methods - Direct Access
A file is made up of fixed-length logical records that allow programs
to read and write records rapidly in no particular order.
It is based on a disk model of a file.
Immediate access to large amounts of information.
• Databases are often of this type.
read(n) rather than read next().
• n is the block number.
write(n) rather than write next().
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 21 / 79
Simulation of Sequential Access on Direct-Access File
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 22 / 79
Other Access Methods
Can be built on top of base methods.
Creation of an index for the file: contains pointers to the various
blocks
Keep index in memory for fast determination of location of data.
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 23 / 79
Example of Index and Relative Files
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 24 / 79
Disk Structure
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 25 / 79
Disk Structure (1/2)
Disk can be subdivided into partitions.
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 26 / 79
Disk Structure (1/2)
Disk can be subdivided into partitions.
Disks or partitions can be RAID protected against failure.
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 26 / 79
Disk Structure (1/2)
Disk can be subdivided into partitions.
Disks or partitions can be RAID protected against failure.
Disk or partition can be used raw, without a file system, or formatted
with a file system.
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 26 / 79
Disk Structure (1/2)
Disk can be subdivided into partitions.
Disks or partitions can be RAID protected against failure.
Disk or partition can be used raw, without a file system, or formatted
with a file system.
Partitioning is useful for limiting the sizes of individual file systems.
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 26 / 79
Disk Structure (2/2)
Entity containing file system known as a volume.
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 27 / 79
Disk Structure (2/2)
Entity containing file system known as a volume.
The volume may be a subset of a device, a whole device, or multiple
devices linked together into a RAID set.
• Each volume can be thought of as a virtual disk.
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 27 / 79
Disk Structure (2/2)
Entity containing file system known as a volume.
The volume may be a subset of a device, a whole device, or multiple
devices linked together into a RAID set.
• Each volume can be thought of as a virtual disk.
Each volume contains information about the files in the system.
• This information is kept in entries in a device directory or volume
table of contents.
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 27 / 79
Disk Structure (2/2)
Entity containing file system known as a volume.
The volume may be a subset of a device, a whole device, or multiple
devices linked together into a RAID set.
• Each volume can be thought of as a virtual disk.
Each volume contains information about the files in the system.
• This information is kept in entries in a device directory or volume
table of contents.
The device directory, (known as the directory), records information
such as name, location, size, and type for all files on that volume.
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 27 / 79
A Typical File-system Organization
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 28 / 79
Types of File Systems
Systems may have some general-purpose and some special-purpose
file systems.
Consider Solaris has
• tmpfs: memory-based volatile FS for fast, temporary I/O
• objfs: interface into kernel memory to get kernel symbols for
debugging
• ctfs: contract file system for managing daemons
• lofs: loopback file system allows one FS to be accessed in place of
another
• procfs: kernel interface to process structures
• ufs, zfs: general purpose file systems
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 29 / 79
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 30 / 79
Partition Table
MBR (Master Boot Record)
• The first sector
• 512 bytes (446 bytes: boot loader such as GRUB, 64 bytes:
partition table, 2 bytes: special code).
The partition table has enough room for four partitions.
• One of the four can be used as an extended partition.
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 31 / 79
fdisk and mkfs
fdisk and cfisk to partition a disk.
mkfs.ext4 to format a partition.
• mkfs.bfs, mkfs.cramfs, mkfs.ext2, mkfs.ext3,
mkfs.ext4dev, mkfs.minix, mkfs.msdos, mkfs.vfat, ...
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 32 / 79
Directory Structure
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 33 / 79
Directory Structure
The directory can be viewed as a symbol table that translates file
names into their directory entries.
Both the directory structure and the files reside on disk.
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 34 / 79
Operations Performed on Directory
Search for a file
Create a file
Delete a file
List a directory
Rename a file
Traverse the file system
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 35 / 79
Directory Organization
The directory itself can be organized in many ways.
• Single-level directories
• Two-level directories
• Tree-level directories
• Acyclic-graph directories
• General graph directories
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 36 / 79
Single-Level Directory
A single directory for all users.
Naming problem: they must have unique names.
Grouping problem
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 37 / 79
Two-Level Directory
Separate directory for each user.
Can have the same file name for different users.
Efficient searching
Path name: two level path, e.g., /userB/file.txt
No grouping capability
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 38 / 79
Tree-Structured Directories (1/2)
Efficient searching
Grouping capability
Current directory (working directory)
• cd /spell/mail/prog
• type list
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 39 / 79
Tree-Structured Directories (2/2)
Two types of path names:
• Absolute path name: begins at the root and follows a path down to
the specified file.
• Relative path name: a path from the current directory.
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 40 / 79
Tree-Structured Directories (2/2)
Two types of path names:
• Absolute path name: begins at the root and follows a path down to
the specified file.
• Relative path name: a path from the current directory.
Deleting a directory?
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 40 / 79
Tree-Structured Directories (2/2)
Two types of path names:
• Absolute path name: begins at the root and follows a path down to
the specified file.
• Relative path name: a path from the current directory.
Deleting a directory?
Simply delete empty directories.
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 40 / 79
Tree-Structured Directories (2/2)
Two types of path names:
• Absolute path name: begins at the root and follows a path down to
the specified file.
• Relative path name: a path from the current directory.
Deleting a directory?
Simply delete empty directories.
If a directory is not empty.
• The user must first delete all the files in that directory.
• Or using an option to delete a directory as in Linux rm
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 40 / 79
Acyclic-Graph Directories (1/3)
Have shared subdirectories and files
With a shared file, only one actual file exists, so any changes made
by one person are immediately visible to the other.
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 41 / 79
Acyclic-Graph Directories (2/3)
Two approaches to implement shared files:
Link
• Another name (pointer) to an existing file.
• Resolve the link: follow pointer to locate the file.
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 42 / 79
Acyclic-Graph Directories (2/3)
Two approaches to implement shared files:
Link
• Another name (pointer) to an existing file.
• Resolve the link: follow pointer to locate the file.
Duplicate all information about the file.
• Both entries are identical and equal.
• Consistency?
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 42 / 79
Acyclic-Graph Directories (3/3)
Deletion possibilities?
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 43 / 79
Acyclic-Graph Directories (3/3)
Deletion possibilities?
Remove the file content whenever anyone deletes it.
• Dangling pointers: pointing to the nonexistent file.
• What if the remaining file pointers contain actual disk addresses?
• Easy with soft-links (symbolic links)
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 43 / 79
Acyclic-Graph Directories (3/3)
Deletion possibilities?
Remove the file content whenever anyone deletes it.
• Dangling pointers: pointing to the nonexistent file.
• What if the remaining file pointers contain actual disk addresses?
• Easy with soft-links (symbolic links)
Preserve the file until all references to it are deleted.
• Hard links
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 43 / 79
General Graph Directory (1/2)
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 44 / 79
General Graph Directory (2/2)
How do we guarantee no cycles?
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 45 / 79
General Graph Directory (2/2)
How do we guarantee no cycles?
Allow only links to file not subdirectories.
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 45 / 79
General Graph Directory (2/2)
How do we guarantee no cycles?
Allow only links to file not subdirectories.
Garbage collection: determine when the last reference has been
deleted and the disk space can be reallocated.
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 45 / 79
General Graph Directory (2/2)
How do we guarantee no cycles?
Allow only links to file not subdirectories.
Garbage collection: determine when the last reference has been
deleted and the disk space can be reallocated.
Every time a new link is added use a cycle detection algorithm to
determine whether it is OK.
• Easier solution: bypass links during directory traversal.
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 45 / 79
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 46 / 79
Linux File System
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 47 / 79
/bin
Hold the most commonly used essential user programs.
• login
• Shells (bash, ksh, csh)
• File manipulation utilities (cp, mv, rm, ln, tar)
• Editors (ed, vi)
• File system utilities (dd, df, mount, umount, sync)
• System utilities (uname, hostname, arch)
• GNU utilities (gzip, gunzip)
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 48 / 79
/sbin
Hold essential maintenance or system programs:
• fsck, fdisk, mkfs, shutdown, init, ...
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 49 / 79
/sbin
Hold essential maintenance or system programs:
• fsck, fdisk, mkfs, shutdown, init, ...
The main difference between the programs stored in /bin and /sbin
is that the programs in /sbin are executable only by root.
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 49 / 79
/etc
Store the system wide configuration files required by many programs:
• passwd, shadow, fstab, hosts, ...
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 50 / 79
/home and /root
The /home directory: the home directories for all users.
The /root directory: the home directories for root user.
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 51 / 79
/dev
The special files representing hardware are kept in it.
• /dev/hda1
• /dev/ttyS0
• /dev/mouse
• /dev/fd0
• /dev/fifo1
• /dev/loop2
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 52 / 79
/tmp and /var
The /tmp and /var directories: hold temporary files or files with
constantly varying content.
The /tmp directory: files that only need to be used briefly and can
afford to be deleted at any time.
The /var directory: a bit more structured than /tmp.
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 53 / 79
/usr
Most programs and files directly relating to users of the system are
stored.
It is in some ways a mini version of the / directory.
• /usr/bin
• /usr/sbin
• /usr/spool
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 54 / 79
/proc
It is a virtual file system
Provided by the kernel
Provides information about the kernel and processes.
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 55 / 79
File and Directory Management
getcwd() returns the current working directory.
chdir() changes the current working directory to path
#include <unistd.h>
char *getcwd(char *buf, size_t size);
int chdir(const char *path);
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 56 / 79
File and Directory Management
mkdir() creates the directory path.
#include <sys/stat.h>
#include <sys/types.h>
int mkdir(const char *path, mode_t mode);
rmdir() removes a directory from the filesystem.
#include <unistd.h>
int rmdir(const char *path);
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 57 / 79
File and Directory Management
opendir() creates a directory stream representing.
readdir() returns the next entry in the directory.
closedir() closes the directory stream.
#include <sys/types.h>
#include <dirent.h>
DIR *opendir(const char *name);;
struct dirent *readdir(DIR *dir);
int closedir(DIR *dir);
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 58 / 79
File System Commands (1/3)
pwd: where am I?
cd: changes working directory.
ls: shows the contents of current directory.
cat: takes all input and outputs it to a file or other source.
mkdir: creates a new directory
rmdir: removes empty directory
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 59 / 79
File System Commands (2/3)
mv: moves files
cp: copies files
rm: removes directory
gzip/gunzip: to compress and uncompress a file
tar: to compress and uncompress a file
e2fsck: check a Linux ext2/ext3/ext4 file system
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 60 / 79
File System Commands (3/3)
dd: converts and copies a file
df: reports File System disk space usage
du: estimates file space usage
ln: makes links between files
file: determines file type
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 61 / 79
File System Mounting
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 62 / 79
File System Mounting
A file system must be mounted before it can be accessed.
A unmounted file system is mounted at a mount point.
Mount point: the location within the file structure where the file
system is to be attached.
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 63 / 79
Mount Point
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 64 / 79
Mount Point
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 64 / 79
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 65 / 79
Mounting File System
File system are mounted with the mount command.
mount -t type source mount point
To unmount a file system, the umount command is used.
umount /dev/<device name> or mount point
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 66 / 79
Mounting Automatically With fstab
This file lists all the partitions that need to be mounted at boot
time and the directory where they need to be mounted.
/etc/fstab
• Which devices to be mounted.
• What kinds of file systems they contain.
• At what point in the file system the mount takes place.
# <file system> <mount point> <type> <options> <dump> <pass>
UUID=79257dad-... / ext4 errors=remount-ro 0 1
UUID=2e84fea4-... /home ext4 defaults 0 2
UUID=7cf4a322-... none swap sw 0 0
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 67 / 79
File Sharing and Protection
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 68 / 79
File Sharing
Sharing of files on multi-user systems is desirable.
Sharing may be done through a protection scheme.
• User IDs identify user
• Owner of a file/directory: the user who can change attributes and
grant access and who has the most control over the file.
• Group of a file/directory: a subset of users who can share access to
the file.
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 69 / 79
File Sharing - Remote File Systems (1/2)
Client-server model allows clients to mount remote file systems from
servers:
Server can serve multiple clients.
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 70 / 79
File Sharing - Remote File Systems (1/2)
Client-server model allows clients to mount remote file systems from
servers:
Server can serve multiple clients.
NFS is standard UNIX client-server file sharing protocol.
CIFS is standard Windows client-server protocol.
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 70 / 79
File Sharing - Remote File Systems (1/2)
Client-server model allows clients to mount remote file systems from
servers:
Server can serve multiple clients.
NFS is standard UNIX client-server file sharing protocol.
CIFS is standard Windows client-server protocol.
Standard OS file calls are translated into remote calls.
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 70 / 79
File Sharing - Remote File Systems (2/2)
Distributed Information Systems (distributed naming services) such
as LDAP, DNS, NIS, Active Directory implement unified access to
information needed for remote computing.
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 71 / 79
File Sharing - Failure Modes
All file systems have failure modes.
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 72 / 79
File Sharing - Failure Modes
All file systems have failure modes.
Remote file systems add new failure modes, due to network and
server failure.
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 72 / 79
File Sharing - Failure Modes
All file systems have failure modes.
Remote file systems add new failure modes, due to network and
server failure.
Recovery from failure can involve state: information about status of
each remote request.
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 72 / 79
File Sharing - Failure Modes
All file systems have failure modes.
Remote file systems add new failure modes, due to network and
server failure.
Recovery from failure can involve state: information about status of
each remote request.
Stateless protocols such as NFS v3 include all information in each
request, allowing easy recovery but less security.
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 72 / 79
File Sharing - Consistency Semantics
Specify how multiple users are to access a shared file simultaneously.
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 73 / 79
File Sharing - Consistency Semantics
Specify how multiple users are to access a shared file simultaneously.
Similar to process synchronization algorithms.
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 73 / 79
File Sharing - Consistency Semantics
Specify how multiple users are to access a shared file simultaneously.
Similar to process synchronization algorithms.
Unix file system (UFS):
• Writes to an open file visible immediately to other users of the same
open file
• Sharing file pointer to allow multiple users to read and write
concurrently
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 73 / 79
File Sharing - Consistency Semantics
Specify how multiple users are to access a shared file simultaneously.
Similar to process synchronization algorithms.
Unix file system (UFS):
• Writes to an open file visible immediately to other users of the same
open file
• Sharing file pointer to allow multiple users to read and write
concurrently
Andrew File System (AFS):
• Writes only visible to sessions starting after the file is closed
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 73 / 79
Access Lists and Groups
Mode of access: read, write, execute (rwx)
Make access dependent on the identity of the user.
Different users may need different types of access to a file or direc-
tory.
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 74 / 79
Access Control List
Associate access-control list (ACL) with each file and directory.
• Specifying user names and the types of access allowed for each user.
Three classes of users:
• Owner: the user who created the file.
• Group: a set of users who are sharing the file and need similar
access.
• Universe: all other users in the system.
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 75 / 79
A Sample UNIX Directory Listing
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 76 / 79
Summary
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 77 / 79
Summary
File concept: types, attributes, operations, locks
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 78 / 79
Summary
File concept: types, attributes, operations, locks
Access methods: sequential, direct
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 78 / 79
Summary
File concept: types, attributes, operations, locks
Access methods: sequential, direct
Disk structure and file system
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 78 / 79
Summary
File concept: types, attributes, operations, locks
Access methods: sequential, direct
Disk structure and file system
Directory structure: single-level, two-level, tree-structured, acyclic-
graph, general-graph
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 78 / 79
Summary
File concept: types, attributes, operations, locks
Access methods: sequential, direct
Disk structure and file system
Directory structure: single-level, two-level, tree-structured, acyclic-
graph, general-graph
Mounting
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 78 / 79
Summary
File concept: types, attributes, operations, locks
Access methods: sequential, direct
Disk structure and file system
Directory structure: single-level, two-level, tree-structured, acyclic-
graph, general-graph
Mounting
File sharing and protection: rwx, owner, group, universe
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 78 / 79
Questions?
Acknowledgements
Some slides were derived from Avi Silberschatz slides.
Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 79 / 79

More Related Content

What's hot

Internal representation of file chapter 4 Sowmya Jyothi
Internal representation of file chapter 4 Sowmya JyothiInternal representation of file chapter 4 Sowmya Jyothi
Internal representation of file chapter 4 Sowmya JyothiSowmya Jyothi
 
Buffer cache unix ppt Mrs.Sowmya Jyothi
Buffer cache unix ppt Mrs.Sowmya JyothiBuffer cache unix ppt Mrs.Sowmya Jyothi
Buffer cache unix ppt Mrs.Sowmya JyothiSowmya Jyothi
 
Studying a decade of Linux system calls
Studying a decade of Linux system callsStudying a decade of Linux system calls
Studying a decade of Linux system callscorpaulbezemer
 
System protection in Operating System
System protection in Operating SystemSystem protection in Operating System
System protection in Operating Systemsohaildanish
 
physical file system in operating system
physical file system in operating systemphysical file system in operating system
physical file system in operating systemtittuajay
 
Chapter 3 part 2
Chapter 3 part 2Chapter 3 part 2
Chapter 3 part 2rohassanie
 
Disk and File System Management in Linux
Disk and File System Management in LinuxDisk and File System Management in Linux
Disk and File System Management in LinuxHenry Osborne
 
Structure of operating system
Structure of operating systemStructure of operating system
Structure of operating systemRafi Dar
 
File Protection in Operating System
File Protection in Operating SystemFile Protection in Operating System
File Protection in Operating SystemMeghaj Mallick
 
Introduction to System Calls
Introduction to System CallsIntroduction to System Calls
Introduction to System CallsVandana Salve
 
File management
File managementFile management
File managementMohd Arif
 

What's hot (19)

Chapter 5
Chapter 5Chapter 5
Chapter 5
 
Internal representation of file chapter 4 Sowmya Jyothi
Internal representation of file chapter 4 Sowmya JyothiInternal representation of file chapter 4 Sowmya Jyothi
Internal representation of file chapter 4 Sowmya Jyothi
 
Buffer cache unix ppt Mrs.Sowmya Jyothi
Buffer cache unix ppt Mrs.Sowmya JyothiBuffer cache unix ppt Mrs.Sowmya Jyothi
Buffer cache unix ppt Mrs.Sowmya Jyothi
 
Studying a decade of Linux system calls
Studying a decade of Linux system callsStudying a decade of Linux system calls
Studying a decade of Linux system calls
 
Chapter 14 - Protection
Chapter 14 - ProtectionChapter 14 - Protection
Chapter 14 - Protection
 
System calls
System callsSystem calls
System calls
 
System protection in Operating System
System protection in Operating SystemSystem protection in Operating System
System protection in Operating System
 
physical file system in operating system
physical file system in operating systemphysical file system in operating system
physical file system in operating system
 
Operating system 3
Operating system 3 Operating system 3
Operating system 3
 
File Protection
File ProtectionFile Protection
File Protection
 
Ppt linux
Ppt linuxPpt linux
Ppt linux
 
Operating system 4 files by adi
Operating system 4 files by adiOperating system 4 files by adi
Operating system 4 files by adi
 
Chapter 3 part 2
Chapter 3 part 2Chapter 3 part 2
Chapter 3 part 2
 
File system
File systemFile system
File system
 
Disk and File System Management in Linux
Disk and File System Management in LinuxDisk and File System Management in Linux
Disk and File System Management in Linux
 
Structure of operating system
Structure of operating systemStructure of operating system
Structure of operating system
 
File Protection in Operating System
File Protection in Operating SystemFile Protection in Operating System
File Protection in Operating System
 
Introduction to System Calls
Introduction to System CallsIntroduction to System Calls
Introduction to System Calls
 
File management
File managementFile management
File management
 

Viewers also liked

Chapter 10 - File System Interface
Chapter 10 - File System InterfaceChapter 10 - File System Interface
Chapter 10 - File System InterfaceWayne Jones Jnr
 
Introduction to Operating Systems - Part2
Introduction to Operating Systems - Part2Introduction to Operating Systems - Part2
Introduction to Operating Systems - Part2Amir Payberah
 
Process Management - Part2
Process Management - Part2Process Management - Part2
Process Management - Part2Amir Payberah
 
CPU Scheduling - Part2
CPU Scheduling - Part2CPU Scheduling - Part2
CPU Scheduling - Part2Amir Payberah
 
The Stratosphere Big Data Analytics Platform
The Stratosphere Big Data Analytics PlatformThe Stratosphere Big Data Analytics Platform
The Stratosphere Big Data Analytics PlatformAmir Payberah
 
Data Intensive Computing Frameworks
Data Intensive Computing FrameworksData Intensive Computing Frameworks
Data Intensive Computing FrameworksAmir Payberah
 
CPU Scheduling - Part1
CPU Scheduling - Part1CPU Scheduling - Part1
CPU Scheduling - Part1Amir Payberah
 
Virtual Memory - Part1
Virtual Memory - Part1Virtual Memory - Part1
Virtual Memory - Part1Amir Payberah
 
Virtual Memory - Part2
Virtual Memory - Part2Virtual Memory - Part2
Virtual Memory - Part2Amir Payberah
 
P2P Content Distribution Network
P2P Content Distribution NetworkP2P Content Distribution Network
P2P Content Distribution NetworkAmir Payberah
 
File System Interface
File System InterfaceFile System Interface
File System Interfacechandinisanz
 
Ch11: File System Interface
Ch11: File System InterfaceCh11: File System Interface
Ch11: File System InterfaceAhmar Hashmi
 
Process Management - Part3
Process Management - Part3Process Management - Part3
Process Management - Part3Amir Payberah
 

Viewers also liked (20)

Chapter 10 - File System Interface
Chapter 10 - File System InterfaceChapter 10 - File System Interface
Chapter 10 - File System Interface
 
Main Memory - Part2
Main Memory - Part2Main Memory - Part2
Main Memory - Part2
 
Introduction to Operating Systems - Part2
Introduction to Operating Systems - Part2Introduction to Operating Systems - Part2
Introduction to Operating Systems - Part2
 
Security
SecuritySecurity
Security
 
Protection
ProtectionProtection
Protection
 
IO Systems
IO SystemsIO Systems
IO Systems
 
Cloud Computing
Cloud ComputingCloud Computing
Cloud Computing
 
Process Management - Part2
Process Management - Part2Process Management - Part2
Process Management - Part2
 
CPU Scheduling - Part2
CPU Scheduling - Part2CPU Scheduling - Part2
CPU Scheduling - Part2
 
The Stratosphere Big Data Analytics Platform
The Stratosphere Big Data Analytics PlatformThe Stratosphere Big Data Analytics Platform
The Stratosphere Big Data Analytics Platform
 
Data Intensive Computing Frameworks
Data Intensive Computing FrameworksData Intensive Computing Frameworks
Data Intensive Computing Frameworks
 
Deadlocks
DeadlocksDeadlocks
Deadlocks
 
CPU Scheduling - Part1
CPU Scheduling - Part1CPU Scheduling - Part1
CPU Scheduling - Part1
 
Virtual Memory - Part1
Virtual Memory - Part1Virtual Memory - Part1
Virtual Memory - Part1
 
Virtual Memory - Part2
Virtual Memory - Part2Virtual Memory - Part2
Virtual Memory - Part2
 
P2P Content Distribution Network
P2P Content Distribution NetworkP2P Content Distribution Network
P2P Content Distribution Network
 
File System Interface
File System InterfaceFile System Interface
File System Interface
 
Ch11: File System Interface
Ch11: File System InterfaceCh11: File System Interface
Ch11: File System Interface
 
Main Memory - Part1
Main Memory - Part1Main Memory - Part1
Main Memory - Part1
 
Process Management - Part3
Process Management - Part3Process Management - Part3
Process Management - Part3
 

Similar to File System Interface

File system interface
File system interfaceFile system interface
File system interfaceDayan Ahmed
 
File Management and manipulation in C++ Programming
File Management and manipulation in C++ ProgrammingFile Management and manipulation in C++ Programming
File Management and manipulation in C++ ProgrammingChereLemma2
 
Session9-File Upload Security
Session9-File Upload SecuritySession9-File Upload Security
Session9-File Upload Securityzakieh alizadeh
 
MODULE 3.1 updated-18cs56.pptx
MODULE 3.1 updated-18cs56.pptxMODULE 3.1 updated-18cs56.pptx
MODULE 3.1 updated-18cs56.pptxManasaPJ1
 
Learn about the File Concept in operating systems ppt
Learn about the File Concept in operating systems pptLearn about the File Concept in operating systems ppt
Learn about the File Concept in operating systems pptgeethasenthil2706
 
Unit 7
Unit 7Unit 7
Unit 7siddr
 
FILE SYSTEMS IN WINDOWS OPERATING SYSTEMS
FILE SYSTEMS IN WINDOWS OPERATING SYSTEMSFILE SYSTEMS IN WINDOWS OPERATING SYSTEMS
FILE SYSTEMS IN WINDOWS OPERATING SYSTEMSKABILESH RAMAR
 
file management_osnotes.ppt
file management_osnotes.pptfile management_osnotes.ppt
file management_osnotes.pptHelalMirzad
 
Concept of file handling in c
Concept of file handling in cConcept of file handling in c
Concept of file handling in cMugdhaSharma11
 
Model of file system
Model of file systemModel of file system
Model of file systemIshucs
 
File Management – File Concept, access methods, File types and File Operation
File Management – File Concept, access methods,  File types and File OperationFile Management – File Concept, access methods,  File types and File Operation
File Management – File Concept, access methods, File types and File OperationDhrumil Panchal
 

Similar to File System Interface (20)

File system interface
File system interfaceFile system interface
File system interface
 
File Management and manipulation in C++ Programming
File Management and manipulation in C++ ProgrammingFile Management and manipulation in C++ Programming
File Management and manipulation in C++ Programming
 
Session9-File Upload Security
Session9-File Upload SecuritySession9-File Upload Security
Session9-File Upload Security
 
FILE MANAGEMENT.pptx
FILE MANAGEMENT.pptxFILE MANAGEMENT.pptx
FILE MANAGEMENT.pptx
 
MODULE 3.1 updated-18cs56.pptx
MODULE 3.1 updated-18cs56.pptxMODULE 3.1 updated-18cs56.pptx
MODULE 3.1 updated-18cs56.pptx
 
Learn about the File Concept in operating systems ppt
Learn about the File Concept in operating systems pptLearn about the File Concept in operating systems ppt
Learn about the File Concept in operating systems ppt
 
Chapter4.pptx
Chapter4.pptxChapter4.pptx
Chapter4.pptx
 
Unit 7
Unit 7Unit 7
Unit 7
 
File Handling
File HandlingFile Handling
File Handling
 
File Handling
File HandlingFile Handling
File Handling
 
FILE SYSTEMS IN WINDOWS OPERATING SYSTEMS
FILE SYSTEMS IN WINDOWS OPERATING SYSTEMSFILE SYSTEMS IN WINDOWS OPERATING SYSTEMS
FILE SYSTEMS IN WINDOWS OPERATING SYSTEMS
 
file management_osnotes.ppt
file management_osnotes.pptfile management_osnotes.ppt
file management_osnotes.ppt
 
Concept of file handling in c
Concept of file handling in cConcept of file handling in c
Concept of file handling in c
 
Model of file system
Model of file systemModel of file system
Model of file system
 
File Management – File Concept, access methods, File types and File Operation
File Management – File Concept, access methods,  File types and File OperationFile Management – File Concept, access methods,  File types and File Operation
File Management – File Concept, access methods, File types and File Operation
 
file_handling_in_c.ppt
file_handling_in_c.pptfile_handling_in_c.ppt
file_handling_in_c.ppt
 
Chapter 12.pptx
Chapter 12.pptxChapter 12.pptx
Chapter 12.pptx
 
Operating system
Operating systemOperating system
Operating system
 
file_c.pdf
file_c.pdffile_c.pdf
file_c.pdf
 
DFSNov1.pptx
DFSNov1.pptxDFSNov1.pptx
DFSNov1.pptx
 

More from Amir Payberah

The Spark Big Data Analytics Platform
The Spark Big Data Analytics PlatformThe Spark Big Data Analytics Platform
The Spark Big Data Analytics PlatformAmir Payberah
 
Linux Module Programming
Linux Module ProgrammingLinux Module Programming
Linux Module ProgrammingAmir Payberah
 
Process Synchronization - Part2
Process Synchronization -  Part2Process Synchronization -  Part2
Process Synchronization - Part2Amir Payberah
 
Process Synchronization - Part1
Process Synchronization -  Part1Process Synchronization -  Part1
Process Synchronization - Part1Amir Payberah
 
Process Management - Part1
Process Management - Part1Process Management - Part1
Process Management - Part1Amir Payberah
 
Introduction to Operating Systems - Part3
Introduction to Operating Systems - Part3Introduction to Operating Systems - Part3
Introduction to Operating Systems - Part3Amir Payberah
 
Introduction to Operating Systems - Part1
Introduction to Operating Systems - Part1Introduction to Operating Systems - Part1
Introduction to Operating Systems - Part1Amir Payberah
 
Graph processing - Powergraph and GraphX
Graph processing - Powergraph and GraphXGraph processing - Powergraph and GraphX
Graph processing - Powergraph and GraphXAmir Payberah
 

More from Amir Payberah (10)

The Spark Big Data Analytics Platform
The Spark Big Data Analytics PlatformThe Spark Big Data Analytics Platform
The Spark Big Data Analytics Platform
 
Linux Module Programming
Linux Module ProgrammingLinux Module Programming
Linux Module Programming
 
Process Synchronization - Part2
Process Synchronization -  Part2Process Synchronization -  Part2
Process Synchronization - Part2
 
Process Synchronization - Part1
Process Synchronization -  Part1Process Synchronization -  Part1
Process Synchronization - Part1
 
Threads
ThreadsThreads
Threads
 
Process Management - Part1
Process Management - Part1Process Management - Part1
Process Management - Part1
 
Introduction to Operating Systems - Part3
Introduction to Operating Systems - Part3Introduction to Operating Systems - Part3
Introduction to Operating Systems - Part3
 
Introduction to Operating Systems - Part1
Introduction to Operating Systems - Part1Introduction to Operating Systems - Part1
Introduction to Operating Systems - Part1
 
Mesos and YARN
Mesos and YARNMesos and YARN
Mesos and YARN
 
Graph processing - Powergraph and GraphX
Graph processing - Powergraph and GraphXGraph processing - Powergraph and GraphX
Graph processing - Powergraph and GraphX
 

Recently uploaded

Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Intelisync
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 

Recently uploaded (20)

Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 

File System Interface

  • 1. File System Interface Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic) Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 1 / 79
  • 2. Motivation Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 2 / 79
  • 3. Motivation For most users, the file system (FS) is the most visible aspect of an OS. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 3 / 79
  • 4. Motivation For most users, the file system (FS) is the most visible aspect of an OS. Provides mechanism to access data/programs on storage. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 3 / 79
  • 5. Motivation For most users, the file system (FS) is the most visible aspect of an OS. Provides mechanism to access data/programs on storage. The FS consists of two distinct parts: • A collection of files. • A directory structure that organizes and provides information about all the files in the system. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 3 / 79
  • 6. File Concept Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 4 / 79
  • 7. File Concept Contiguous logical address space. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 5 / 79
  • 8. File Concept Contiguous logical address space. Types: • Data, e.g., numeric, text data, photos, music, ... • Program Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 5 / 79
  • 9. File Concept Contiguous logical address space. Types: • Data, e.g., numeric, text data, photos, music, ... • Program Contents defined by file’s creator. Many types: • Text file: a sequence of characters. • Source file: a sequence of functions. • Executable file: a series of code sections that the loader can bring into memory and execute. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 5 / 79
  • 10. File Types: Name and Extension Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 6 / 79
  • 11. File Attributes Name: only information kept in human-readable form. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 7 / 79
  • 12. File Attributes Name: only information kept in human-readable form. Identifier: unique number identifies file within file system. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 7 / 79
  • 13. File Attributes Name: only information kept in human-readable form. Identifier: unique number identifies file within file system. Type: needed for systems that support different types. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 7 / 79
  • 14. File Attributes Name: only information kept in human-readable form. Identifier: unique number identifies file within file system. Type: needed for systems that support different types. Location: pointer to file location on device. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 7 / 79
  • 15. File Attributes Name: only information kept in human-readable form. Identifier: unique number identifies file within file system. Type: needed for systems that support different types. Location: pointer to file location on device. Size: current file size. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 7 / 79
  • 16. File Attributes Name: only information kept in human-readable form. Identifier: unique number identifies file within file system. Type: needed for systems that support different types. Location: pointer to file location on device. Size: current file size. Protection: controls who can do reading, writing, executing. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 7 / 79
  • 17. File Attributes Name: only information kept in human-readable form. Identifier: unique number identifies file within file system. Type: needed for systems that support different types. Location: pointer to file location on device. Size: current file size. Protection: controls who can do reading, writing, executing. Time, date, and user identification: data for protection, security, and usage monitoring. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 7 / 79
  • 18. File Attributes Name: only information kept in human-readable form. Identifier: unique number identifies file within file system. Type: needed for systems that support different types. Location: pointer to file location on device. Size: current file size. Protection: controls who can do reading, writing, executing. Time, date, and user identification: data for protection, security, and usage monitoring. Information about files are kept in the directory structure. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 7 / 79
  • 19. File Operations Create Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 8 / 79
  • 20. File Operations Create Write: at write pointer location. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 8 / 79
  • 21. File Operations Create Write: at write pointer location. Read: at read pointer location. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 8 / 79
  • 22. File Operations Create Write: at write pointer location. Read: at read pointer location. Reposition within file: seek Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 8 / 79
  • 23. File Operations Create Write: at write pointer location. Read: at read pointer location. Reposition within file: seek Delete Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 8 / 79
  • 24. File Operations Create Write: at write pointer location. Read: at read pointer location. Reposition within file: seek Delete Truncate: to erase the contents of a file but keep its attributes. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 8 / 79
  • 25. File Operations Create Write: at write pointer location. Read: at read pointer location. Reposition within file: seek Delete Truncate: to erase the contents of a file but keep its attributes. Open(Fi): move the content of entry Fi from disk to memory. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 8 / 79
  • 26. File Operations Create Write: at write pointer location. Read: at read pointer location. Reposition within file: seek Delete Truncate: to erase the contents of a file but keep its attributes. Open(Fi): move the content of entry Fi from disk to memory. Close(Fi): move the content of entry Fi in memory to directory structure on disk. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 8 / 79
  • 27. Open Files (1/2) Open(Fi): move the content of a file to memory Search the directory structure on disk for the file. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 9 / 79
  • 28. Open Files (1/2) Open(Fi): move the content of a file to memory Search the directory structure on disk for the file. To avoid the constant searching: open() system should be called before a file is first used. • Open-file table: tracks open files • Per-process table and system-wide table Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 9 / 79
  • 29. Open Files (1/2) Open(Fi): move the content of a file to memory Search the directory structure on disk for the file. To avoid the constant searching: open() system should be called before a file is first used. • Open-file table: tracks open files • Per-process table and system-wide table When the file is no longer being actively used, it is closed by the process, and the OS removes its entry from the open-file table. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 9 / 79
  • 30. Open Files (2/2) Several information are associated with an open file: Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 10 / 79
  • 31. Open Files (2/2) Several information are associated with an open file: File pointer: pointer to last read/write location, per process that has the file open. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 10 / 79
  • 32. Open Files (2/2) Several information are associated with an open file: File pointer: pointer to last read/write location, per process that has the file open. File-open count: counter of the number of times a file is open to allow removal of data from open-file table when last processes closes it. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 10 / 79
  • 33. Open Files (2/2) Several information are associated with an open file: File pointer: pointer to last read/write location, per process that has the file open. File-open count: counter of the number of times a file is open to allow removal of data from open-file table when last processes closes it. Disk location of the file: cache of data access information. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 10 / 79
  • 34. Open Files (2/2) Several information are associated with an open file: File pointer: pointer to last read/write location, per process that has the file open. File-open count: counter of the number of times a file is open to allow removal of data from open-file table when last processes closes it. Disk location of the file: cache of data access information. Access rights: per-process access mode information. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 10 / 79
  • 35. Open File Locking (1/2) File locks allow one process to lock a file and prevent other processes from gaining access to it. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 11 / 79
  • 36. Open File Locking (1/2) File locks allow one process to lock a file and prevent other processes from gaining access to it. Similar to reader-writer locks. • Shared lock similar to reader lock: several processes can acquire concurrently • Exclusive lock similar to writer lock: only one process can acquire it Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 11 / 79
  • 37. Open File Locking (2/2) Mandatory: the OS will prevent access until the exclusive lock is released. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 12 / 79
  • 38. Open File Locking (2/2) Mandatory: the OS will prevent access until the exclusive lock is released. Advisory: the OS will not prevent applications from acquiring access to the file, and the application must be written so that it manually acquires the lock before accessing the file. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 12 / 79
  • 39. File Structure Files must conform to structures that are understood by the OS. • E.g., the OS requires that an executable file have a specific structure so that it can determine where in memory to load the file and what the location of the first instruction is. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 13 / 79
  • 40. File Structure Files must conform to structures that are understood by the OS. • E.g., the OS requires that an executable file have a specific structure so that it can determine where in memory to load the file and what the location of the first instruction is. Support multiple file structures? • The size of the OS could be big, since it needs to contain the code to support these file structures. • On the other hand, severe problems may result if the OS does not support some file structures. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 13 / 79
  • 41. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 14 / 79
  • 42. Files and Their Metadata The stat structure: the metadata of a file. Defined in <bits/stat.h>, which is included from <sys/stat.h>. struct stat { dev_t st_dev; /* ID of device containing file */ ino_t st_ino; /* inode number */ mode_t st_mode; /* permissions */ nlink_t st_nlink; /* number of hard links */ uid_t st_uid; /* user ID of owner */ gid_t st_gid; /* group ID of owner */ dev_t st_rdev; /* device ID (if special file) */ off_t st_size; /* total size in bytes */ blksize_t st_blksize; /* blocksize for filesystem I/O */ blkcnt_t st_blocks; /* number of blocks allocated */ time_t st_atime; /* last access time */ time_t st_mtime; /* last modification time */ time_t st_ctime; /* last status change time */ }; Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 15 / 79
  • 43. The Stat Family stat() returns information about the file denoted by the path path. fstat() returns information about the file represented by the file descriptor fd. #include <sys/types.h> #include <sys/stat.h> #include <unistd.h> int stat(const char *path, struct stat *buf); int fstat(int fd, struct stat *buf); Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 16 / 79
  • 44. Open a File open() maps the file to a file descriptor. #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> int open(const char *name, int flags); Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 17 / 79
  • 45. Read and Write read() and write() to read and write from/to a file. #include <unistd.h> ssize_t read(int fd, void *buf, size_t len); ssize_t write(int fd, const void *buf, size_t count); Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 18 / 79
  • 46. Access Methods Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 19 / 79
  • 47. Access Methods - Sequential Access The simplest and most common access method. Sequential access is based on a tape model of a file. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 20 / 79
  • 48. Access Methods - Sequential Access The simplest and most common access method. Sequential access is based on a tape model of a file. Information in the file is processed in order, one record after the other. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 20 / 79
  • 49. Access Methods - Sequential Access The simplest and most common access method. Sequential access is based on a tape model of a file. Information in the file is processed in order, one record after the other. A read operation (read next()): reads the next portion of the file and automatically advances a file pointer. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 20 / 79
  • 50. Access Methods - Sequential Access The simplest and most common access method. Sequential access is based on a tape model of a file. Information in the file is processed in order, one record after the other. A read operation (read next()): reads the next portion of the file and automatically advances a file pointer. A write operation (write next()): appends to the end of the file and advances to the end of the newly written material. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 20 / 79
  • 51. Access Methods - Direct Access A file is made up of fixed-length logical records that allow programs to read and write records rapidly in no particular order. It is based on a disk model of a file. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 21 / 79
  • 52. Access Methods - Direct Access A file is made up of fixed-length logical records that allow programs to read and write records rapidly in no particular order. It is based on a disk model of a file. Immediate access to large amounts of information. • Databases are often of this type. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 21 / 79
  • 53. Access Methods - Direct Access A file is made up of fixed-length logical records that allow programs to read and write records rapidly in no particular order. It is based on a disk model of a file. Immediate access to large amounts of information. • Databases are often of this type. read(n) rather than read next(). • n is the block number. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 21 / 79
  • 54. Access Methods - Direct Access A file is made up of fixed-length logical records that allow programs to read and write records rapidly in no particular order. It is based on a disk model of a file. Immediate access to large amounts of information. • Databases are often of this type. read(n) rather than read next(). • n is the block number. write(n) rather than write next(). Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 21 / 79
  • 55. Simulation of Sequential Access on Direct-Access File Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 22 / 79
  • 56. Other Access Methods Can be built on top of base methods. Creation of an index for the file: contains pointers to the various blocks Keep index in memory for fast determination of location of data. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 23 / 79
  • 57. Example of Index and Relative Files Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 24 / 79
  • 58. Disk Structure Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 25 / 79
  • 59. Disk Structure (1/2) Disk can be subdivided into partitions. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 26 / 79
  • 60. Disk Structure (1/2) Disk can be subdivided into partitions. Disks or partitions can be RAID protected against failure. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 26 / 79
  • 61. Disk Structure (1/2) Disk can be subdivided into partitions. Disks or partitions can be RAID protected against failure. Disk or partition can be used raw, without a file system, or formatted with a file system. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 26 / 79
  • 62. Disk Structure (1/2) Disk can be subdivided into partitions. Disks or partitions can be RAID protected against failure. Disk or partition can be used raw, without a file system, or formatted with a file system. Partitioning is useful for limiting the sizes of individual file systems. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 26 / 79
  • 63. Disk Structure (2/2) Entity containing file system known as a volume. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 27 / 79
  • 64. Disk Structure (2/2) Entity containing file system known as a volume. The volume may be a subset of a device, a whole device, or multiple devices linked together into a RAID set. • Each volume can be thought of as a virtual disk. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 27 / 79
  • 65. Disk Structure (2/2) Entity containing file system known as a volume. The volume may be a subset of a device, a whole device, or multiple devices linked together into a RAID set. • Each volume can be thought of as a virtual disk. Each volume contains information about the files in the system. • This information is kept in entries in a device directory or volume table of contents. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 27 / 79
  • 66. Disk Structure (2/2) Entity containing file system known as a volume. The volume may be a subset of a device, a whole device, or multiple devices linked together into a RAID set. • Each volume can be thought of as a virtual disk. Each volume contains information about the files in the system. • This information is kept in entries in a device directory or volume table of contents. The device directory, (known as the directory), records information such as name, location, size, and type for all files on that volume. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 27 / 79
  • 67. A Typical File-system Organization Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 28 / 79
  • 68. Types of File Systems Systems may have some general-purpose and some special-purpose file systems. Consider Solaris has • tmpfs: memory-based volatile FS for fast, temporary I/O • objfs: interface into kernel memory to get kernel symbols for debugging • ctfs: contract file system for managing daemons • lofs: loopback file system allows one FS to be accessed in place of another • procfs: kernel interface to process structures • ufs, zfs: general purpose file systems Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 29 / 79
  • 69. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 30 / 79
  • 70. Partition Table MBR (Master Boot Record) • The first sector • 512 bytes (446 bytes: boot loader such as GRUB, 64 bytes: partition table, 2 bytes: special code). The partition table has enough room for four partitions. • One of the four can be used as an extended partition. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 31 / 79
  • 71. fdisk and mkfs fdisk and cfisk to partition a disk. mkfs.ext4 to format a partition. • mkfs.bfs, mkfs.cramfs, mkfs.ext2, mkfs.ext3, mkfs.ext4dev, mkfs.minix, mkfs.msdos, mkfs.vfat, ... Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 32 / 79
  • 72. Directory Structure Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 33 / 79
  • 73. Directory Structure The directory can be viewed as a symbol table that translates file names into their directory entries. Both the directory structure and the files reside on disk. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 34 / 79
  • 74. Operations Performed on Directory Search for a file Create a file Delete a file List a directory Rename a file Traverse the file system Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 35 / 79
  • 75. Directory Organization The directory itself can be organized in many ways. • Single-level directories • Two-level directories • Tree-level directories • Acyclic-graph directories • General graph directories Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 36 / 79
  • 76. Single-Level Directory A single directory for all users. Naming problem: they must have unique names. Grouping problem Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 37 / 79
  • 77. Two-Level Directory Separate directory for each user. Can have the same file name for different users. Efficient searching Path name: two level path, e.g., /userB/file.txt No grouping capability Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 38 / 79
  • 78. Tree-Structured Directories (1/2) Efficient searching Grouping capability Current directory (working directory) • cd /spell/mail/prog • type list Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 39 / 79
  • 79. Tree-Structured Directories (2/2) Two types of path names: • Absolute path name: begins at the root and follows a path down to the specified file. • Relative path name: a path from the current directory. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 40 / 79
  • 80. Tree-Structured Directories (2/2) Two types of path names: • Absolute path name: begins at the root and follows a path down to the specified file. • Relative path name: a path from the current directory. Deleting a directory? Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 40 / 79
  • 81. Tree-Structured Directories (2/2) Two types of path names: • Absolute path name: begins at the root and follows a path down to the specified file. • Relative path name: a path from the current directory. Deleting a directory? Simply delete empty directories. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 40 / 79
  • 82. Tree-Structured Directories (2/2) Two types of path names: • Absolute path name: begins at the root and follows a path down to the specified file. • Relative path name: a path from the current directory. Deleting a directory? Simply delete empty directories. If a directory is not empty. • The user must first delete all the files in that directory. • Or using an option to delete a directory as in Linux rm Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 40 / 79
  • 83. Acyclic-Graph Directories (1/3) Have shared subdirectories and files With a shared file, only one actual file exists, so any changes made by one person are immediately visible to the other. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 41 / 79
  • 84. Acyclic-Graph Directories (2/3) Two approaches to implement shared files: Link • Another name (pointer) to an existing file. • Resolve the link: follow pointer to locate the file. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 42 / 79
  • 85. Acyclic-Graph Directories (2/3) Two approaches to implement shared files: Link • Another name (pointer) to an existing file. • Resolve the link: follow pointer to locate the file. Duplicate all information about the file. • Both entries are identical and equal. • Consistency? Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 42 / 79
  • 86. Acyclic-Graph Directories (3/3) Deletion possibilities? Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 43 / 79
  • 87. Acyclic-Graph Directories (3/3) Deletion possibilities? Remove the file content whenever anyone deletes it. • Dangling pointers: pointing to the nonexistent file. • What if the remaining file pointers contain actual disk addresses? • Easy with soft-links (symbolic links) Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 43 / 79
  • 88. Acyclic-Graph Directories (3/3) Deletion possibilities? Remove the file content whenever anyone deletes it. • Dangling pointers: pointing to the nonexistent file. • What if the remaining file pointers contain actual disk addresses? • Easy with soft-links (symbolic links) Preserve the file until all references to it are deleted. • Hard links Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 43 / 79
  • 89. General Graph Directory (1/2) Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 44 / 79
  • 90. General Graph Directory (2/2) How do we guarantee no cycles? Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 45 / 79
  • 91. General Graph Directory (2/2) How do we guarantee no cycles? Allow only links to file not subdirectories. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 45 / 79
  • 92. General Graph Directory (2/2) How do we guarantee no cycles? Allow only links to file not subdirectories. Garbage collection: determine when the last reference has been deleted and the disk space can be reallocated. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 45 / 79
  • 93. General Graph Directory (2/2) How do we guarantee no cycles? Allow only links to file not subdirectories. Garbage collection: determine when the last reference has been deleted and the disk space can be reallocated. Every time a new link is added use a cycle detection algorithm to determine whether it is OK. • Easier solution: bypass links during directory traversal. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 45 / 79
  • 94. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 46 / 79
  • 95. Linux File System Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 47 / 79
  • 96. /bin Hold the most commonly used essential user programs. • login • Shells (bash, ksh, csh) • File manipulation utilities (cp, mv, rm, ln, tar) • Editors (ed, vi) • File system utilities (dd, df, mount, umount, sync) • System utilities (uname, hostname, arch) • GNU utilities (gzip, gunzip) Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 48 / 79
  • 97. /sbin Hold essential maintenance or system programs: • fsck, fdisk, mkfs, shutdown, init, ... Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 49 / 79
  • 98. /sbin Hold essential maintenance or system programs: • fsck, fdisk, mkfs, shutdown, init, ... The main difference between the programs stored in /bin and /sbin is that the programs in /sbin are executable only by root. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 49 / 79
  • 99. /etc Store the system wide configuration files required by many programs: • passwd, shadow, fstab, hosts, ... Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 50 / 79
  • 100. /home and /root The /home directory: the home directories for all users. The /root directory: the home directories for root user. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 51 / 79
  • 101. /dev The special files representing hardware are kept in it. • /dev/hda1 • /dev/ttyS0 • /dev/mouse • /dev/fd0 • /dev/fifo1 • /dev/loop2 Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 52 / 79
  • 102. /tmp and /var The /tmp and /var directories: hold temporary files or files with constantly varying content. The /tmp directory: files that only need to be used briefly and can afford to be deleted at any time. The /var directory: a bit more structured than /tmp. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 53 / 79
  • 103. /usr Most programs and files directly relating to users of the system are stored. It is in some ways a mini version of the / directory. • /usr/bin • /usr/sbin • /usr/spool Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 54 / 79
  • 104. /proc It is a virtual file system Provided by the kernel Provides information about the kernel and processes. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 55 / 79
  • 105. File and Directory Management getcwd() returns the current working directory. chdir() changes the current working directory to path #include <unistd.h> char *getcwd(char *buf, size_t size); int chdir(const char *path); Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 56 / 79
  • 106. File and Directory Management mkdir() creates the directory path. #include <sys/stat.h> #include <sys/types.h> int mkdir(const char *path, mode_t mode); rmdir() removes a directory from the filesystem. #include <unistd.h> int rmdir(const char *path); Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 57 / 79
  • 107. File and Directory Management opendir() creates a directory stream representing. readdir() returns the next entry in the directory. closedir() closes the directory stream. #include <sys/types.h> #include <dirent.h> DIR *opendir(const char *name);; struct dirent *readdir(DIR *dir); int closedir(DIR *dir); Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 58 / 79
  • 108. File System Commands (1/3) pwd: where am I? cd: changes working directory. ls: shows the contents of current directory. cat: takes all input and outputs it to a file or other source. mkdir: creates a new directory rmdir: removes empty directory Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 59 / 79
  • 109. File System Commands (2/3) mv: moves files cp: copies files rm: removes directory gzip/gunzip: to compress and uncompress a file tar: to compress and uncompress a file e2fsck: check a Linux ext2/ext3/ext4 file system Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 60 / 79
  • 110. File System Commands (3/3) dd: converts and copies a file df: reports File System disk space usage du: estimates file space usage ln: makes links between files file: determines file type Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 61 / 79
  • 111. File System Mounting Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 62 / 79
  • 112. File System Mounting A file system must be mounted before it can be accessed. A unmounted file system is mounted at a mount point. Mount point: the location within the file structure where the file system is to be attached. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 63 / 79
  • 113. Mount Point Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 64 / 79
  • 114. Mount Point Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 64 / 79
  • 115. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 65 / 79
  • 116. Mounting File System File system are mounted with the mount command. mount -t type source mount point To unmount a file system, the umount command is used. umount /dev/<device name> or mount point Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 66 / 79
  • 117. Mounting Automatically With fstab This file lists all the partitions that need to be mounted at boot time and the directory where they need to be mounted. /etc/fstab • Which devices to be mounted. • What kinds of file systems they contain. • At what point in the file system the mount takes place. # <file system> <mount point> <type> <options> <dump> <pass> UUID=79257dad-... / ext4 errors=remount-ro 0 1 UUID=2e84fea4-... /home ext4 defaults 0 2 UUID=7cf4a322-... none swap sw 0 0 Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 67 / 79
  • 118. File Sharing and Protection Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 68 / 79
  • 119. File Sharing Sharing of files on multi-user systems is desirable. Sharing may be done through a protection scheme. • User IDs identify user • Owner of a file/directory: the user who can change attributes and grant access and who has the most control over the file. • Group of a file/directory: a subset of users who can share access to the file. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 69 / 79
  • 120. File Sharing - Remote File Systems (1/2) Client-server model allows clients to mount remote file systems from servers: Server can serve multiple clients. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 70 / 79
  • 121. File Sharing - Remote File Systems (1/2) Client-server model allows clients to mount remote file systems from servers: Server can serve multiple clients. NFS is standard UNIX client-server file sharing protocol. CIFS is standard Windows client-server protocol. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 70 / 79
  • 122. File Sharing - Remote File Systems (1/2) Client-server model allows clients to mount remote file systems from servers: Server can serve multiple clients. NFS is standard UNIX client-server file sharing protocol. CIFS is standard Windows client-server protocol. Standard OS file calls are translated into remote calls. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 70 / 79
  • 123. File Sharing - Remote File Systems (2/2) Distributed Information Systems (distributed naming services) such as LDAP, DNS, NIS, Active Directory implement unified access to information needed for remote computing. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 71 / 79
  • 124. File Sharing - Failure Modes All file systems have failure modes. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 72 / 79
  • 125. File Sharing - Failure Modes All file systems have failure modes. Remote file systems add new failure modes, due to network and server failure. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 72 / 79
  • 126. File Sharing - Failure Modes All file systems have failure modes. Remote file systems add new failure modes, due to network and server failure. Recovery from failure can involve state: information about status of each remote request. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 72 / 79
  • 127. File Sharing - Failure Modes All file systems have failure modes. Remote file systems add new failure modes, due to network and server failure. Recovery from failure can involve state: information about status of each remote request. Stateless protocols such as NFS v3 include all information in each request, allowing easy recovery but less security. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 72 / 79
  • 128. File Sharing - Consistency Semantics Specify how multiple users are to access a shared file simultaneously. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 73 / 79
  • 129. File Sharing - Consistency Semantics Specify how multiple users are to access a shared file simultaneously. Similar to process synchronization algorithms. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 73 / 79
  • 130. File Sharing - Consistency Semantics Specify how multiple users are to access a shared file simultaneously. Similar to process synchronization algorithms. Unix file system (UFS): • Writes to an open file visible immediately to other users of the same open file • Sharing file pointer to allow multiple users to read and write concurrently Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 73 / 79
  • 131. File Sharing - Consistency Semantics Specify how multiple users are to access a shared file simultaneously. Similar to process synchronization algorithms. Unix file system (UFS): • Writes to an open file visible immediately to other users of the same open file • Sharing file pointer to allow multiple users to read and write concurrently Andrew File System (AFS): • Writes only visible to sessions starting after the file is closed Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 73 / 79
  • 132. Access Lists and Groups Mode of access: read, write, execute (rwx) Make access dependent on the identity of the user. Different users may need different types of access to a file or direc- tory. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 74 / 79
  • 133. Access Control List Associate access-control list (ACL) with each file and directory. • Specifying user names and the types of access allowed for each user. Three classes of users: • Owner: the user who created the file. • Group: a set of users who are sharing the file and need similar access. • Universe: all other users in the system. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 75 / 79
  • 134. A Sample UNIX Directory Listing Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 76 / 79
  • 135. Summary Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 77 / 79
  • 136. Summary File concept: types, attributes, operations, locks Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 78 / 79
  • 137. Summary File concept: types, attributes, operations, locks Access methods: sequential, direct Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 78 / 79
  • 138. Summary File concept: types, attributes, operations, locks Access methods: sequential, direct Disk structure and file system Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 78 / 79
  • 139. Summary File concept: types, attributes, operations, locks Access methods: sequential, direct Disk structure and file system Directory structure: single-level, two-level, tree-structured, acyclic- graph, general-graph Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 78 / 79
  • 140. Summary File concept: types, attributes, operations, locks Access methods: sequential, direct Disk structure and file system Directory structure: single-level, two-level, tree-structured, acyclic- graph, general-graph Mounting Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 78 / 79
  • 141. Summary File concept: types, attributes, operations, locks Access methods: sequential, direct Disk structure and file system Directory structure: single-level, two-level, tree-structured, acyclic- graph, general-graph Mounting File sharing and protection: rwx, owner, group, universe Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 78 / 79
  • 142. Questions? Acknowledgements Some slides were derived from Avi Silberschatz slides. Amir H. Payberah (Tehran Polytechnic) File System Interface 1393/9/3 79 / 79