Professional Documents
Culture Documents
objects
subjects gribble r rw r
guest r capability
ACL
7
Dr. Suleiman Abu Kharmeh
Access Lists and Groups in Unix
• Mode of access: read, write, execute
• Three classes of users on Unix / Linux
RWX
a) owner access 7 111
RWX
b) group access 6 110
RWX
c) public access 1 001
file/directory
command
permissions
file/directory
command
Dr. Suleiman Abu Kharmeh group
A Sample UNIX Directory Listing
• Example methods:
– Contiguous allocation
– Linked allocation
– Indexed allocation
• Cons:
– In HDD, sequential read requires disk seek to jump
to the next block. (Still not too bad…)
– Random read will be very inefficient.
O(n) time seek operation
(n = # of blocks in the file)
• Cons
– We have to access each block in
the disk one by one to find more
than one free block.
– Traversing the free list may
require substantial I/O
23
Dr. Suleiman Abu Kharmeh
UNIX file layout overview
15 pointers
(iNodes)
• Block size is 4K
Thus, with 12 direct pointers, first 48K are
directly reachable from the i-node.
• Boot block
• Super block
• FCBs
– (I-nodes in Unix, FAT or MFT in Windows)
• Data blocks
Dr. Suleiman Abu Kharmeh
File System Maintenance
• Format
– Create file system layout: super block, I-nodes…
• Bad blocks
– Most disks have some, increase over age
– Keep them in bad-block list
– “scandisk”
• De-fragmentation
– Re-arrange blocks rather contiguously
• Scanning
– After system crashes
– Correct inconsistent file descriptors
1. Create 7. Append
2. Delete 8. Seek
3. Open 9. Get attributes
4. Close 10.Set Attributes
5. Read 11.Rename
6. Write
31
Dr. Suleiman Abu Kharmeh
Application File System Interaction
Open Directories
file
pointer
..
array
.
File data
35
Dr. Suleiman Abu Kharmeh
An Example Program Using File System Calls
36
Dr. Suleiman Abu Kharmeh
Virtual File Systems
• Virtual File Systems (VFS) on Unix provide an object-oriented way of
implementing file systems
• VFS allows the same system call interface (the API) to be used for different types
of file systems
– Separates file-system generic operations from implementation details
– Implementation can be one of many file systems types, or network file
system
• Implements vnodes which hold inodes or network file details
– Then dispatches operation to appropriate file system implementation
routines
• The API is to the VFS interface, rather than any specific type of file system
• For example, Linux has four object types:
– inode, file, superblock, dentry
• VFS defines set of operations on the objects that must be implemented
– Every object has a pointer to a function table
• Function table has addresses of routines to implement that function on
that object
Dr. Suleiman Abu Kharmeh
Schematic View of Virtual File
System
FAT
The File Allocation Table (FAT) file system was initially
developed for DOS Operating System and was later used
and supported by all versions of Microsoft Windows.
It was an evolution of Microsoft's earlier operating system
MS-DOS and was the predominant File System in Windows
versions like 95, 98, ME etc.
All the latest versions of Windows still support FAT file
system although it may not be popular.
FAT had various versions like FAT12, FAT16 and FAT32.
Successive versions of FAT were named after the number of
bits in the table: 12, 16 and 32.
Dr. Suleiman Abu Kharmeh
FAT
• FAT == File Allocation Table
• FAT is located at the top of the volume.
– two copies kept in case one becomes damaged.
Super
Disk Block
42
Dr. Suleiman Abu Kharmeh
Volume size V.S. Cluster size
• Design Objectives
1) Fault-tolerance
Built-in transaction logging feature.
2) Security
Granular (per file/directory) security support.
3) Scalability
Handling huge disks efficiently.
57
Dr. Suleiman Abu Kharmeh