SlideShare a Scribd company logo
Silberschatz, Galvin and Gagne ©200211.1
Chapter 11: File-System Interface
File Concept
Access Methods
Directory Structure
File System Mounting
File Sharing
Protection
Silberschatz, Galvin and Gagne ©200211.2
File Concept
Contiguous logical address space
Types:
Data
numeric
character
binary
Program
Silberschatz, Galvin and Gagne ©200211.3
File Structure
None - sequence of words, bytes
Simple record structure
Lines
Fixed length
Variable length
Complex Structures
Formatted document
Relocatable load file
Can simulate last two with first method by inserting
appropriate control characters.
Who decides:
Operating system
Program
Silberschatz, Galvin and Gagne ©200211.4
File Attributes
Name – only information kept in human-readable form.
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,
which is maintained on the disk.
Silberschatz, Galvin and Gagne ©200211.5
File Operations
Create
Write
Read
Reposition within file – file seek
Delete
Truncate
Open(Fi) – search the directory structure on disk for entry
Fi, and move the content of entry to memory.
Close (Fi) – move the content of entry Fi in memory to
directory structure on disk.
Silberschatz, Galvin and Gagne ©200211.6
File Types – Name, Extension
Silberschatz, Galvin and Gagne ©200211.7
Access Methods
Sequential Access
read next
write next
reset
no read after last write
(rewrite)
Direct Access
read n
write n
position to n
read next
write next
rewrite n
n = relative block number
Silberschatz, Galvin and Gagne ©200211.8
Sequential-access File
Silberschatz, Galvin and Gagne ©200211.9
Simulation of Sequential Access on a Direct-access File
Silberschatz, Galvin and Gagne ©200211.10
Example of Index and Relative
Files
Silberschatz, Galvin and Gagne ©200211.11
Directory Structure
A collection of nodes containing information about all
files.
F 1 F 2
F 3
F 4
F n
Directory
Files
Both the directory structure and the files reside on disk.
Backups of these two structures are kept on tapes.
Silberschatz, Galvin and Gagne ©200211.12
A Typical File-system Organization
Silberschatz, Galvin and Gagne ©200211.13
Information in a Device Directory
Name
Type
Address
Current length
Maximum length
Date last accessed (for archival)
Date last updated (for dump)
Owner ID (who pays)
Protection information (discuss later)
Silberschatz, Galvin and Gagne ©200211.14
Operations Performed on Directory
Search for a file
Create a file
Delete a file
List a directory
Rename a file
Traverse the file system
Silberschatz, Galvin and Gagne ©200211.15
Organize the Directory (Logically) to
Obtain
Efficiency – locating a file quickly.
Naming – convenient to users.
Two users can have same name for different files.
The same file can have several different names.
Grouping – logical grouping of files by properties, (e.g.,
all Java programs, all games, …)
Silberschatz, Galvin and Gagne ©200211.16
Single-Level Directory
A single directory for all users.
Naming problem
Grouping problem
Silberschatz, Galvin and Gagne ©200211.17
Two-Level Directory
Separate directory for each user.
•Path name
•Can have the same file name for different user
•Efficient searching
•No grouping capability
Silberschatz, Galvin and Gagne ©200211.18
Tree-Structured Directories
Silberschatz, Galvin and Gagne ©200211.19
Tree-Structured Directories (Cont.)
Efficient searching
Grouping Capability
Current directory (working directory)
cd /spell/mail/prog
type list
Silberschatz, Galvin and Gagne ©200211.20
Tree-Structured Directories (Cont.)
Absolute or relative path name
Creating a new file is done in current directory.
Delete a file
rm <file-name>
Creating a new subdirectory is done in current directory.
mkdir <dir-name>
Example: if in current directory /mail
mkdir count
mail
prog copy prt exp count
Deleting “mail” ⇒ deleting the entire subtree rooted by “mail”.
Silberschatz, Galvin and Gagne ©200211.21
Acyclic-Graph Directories
Have shared subdirectories and files.
Silberschatz, Galvin and Gagne ©200211.22
Acyclic-Graph Directories (Cont.)
Two different names (aliasing)
If dict deletes list ⇒ dangling pointer.
Solutions:
Backpointers, so we can delete all pointers.
Variable size records a problem.
Backpointers using a daisy chain organization.
Entry-hold-count solution.
Silberschatz, Galvin and Gagne ©200211.23
General Graph Directory
Silberschatz, Galvin and Gagne ©200211.24
General Graph Directory (Cont.)
How do we guarantee no cycles?
Allow only links to file not subdirectories.
Garbage collection.
Every time a new link is added use a cycle detection
algorithm to determine whether it is OK.
Silberschatz, Galvin and Gagne ©200211.25
File System Mounting
A file system must be mounted before it can be
accessed.
A unmounted file system (I.e. Fig. 11-11(b)) is mounted at
a mount point.
Silberschatz, Galvin and Gagne ©200211.26
(a) Existing. (b) Unmounted
Partition
Silberschatz, Galvin and Gagne ©200211.27
Mount Point
Silberschatz, Galvin and Gagne ©200211.28
File Sharing
Sharing of files on multi-user systems is desirable.
Sharing may be done through a protection scheme.
On distributed systems, files may be shared across a
network.
Network File System (NFS) is a common distributed file-
sharing method.
Silberschatz, Galvin and Gagne ©200211.29
Protection
File owner/creator should be able to control:
what can be done
by whom
Types of access
Read
Write
Execute
Append
Delete
List
Silberschatz, Galvin and Gagne ©200211.30
Access Lists and Groups
Mode of access: read, write, execute
Three classes of users
RWX
a) owner access 7 ⇒ 1 1 1
RWX
b) group access 6 ⇒ 1 1 0
RWX
c) public access 1 ⇒ 0 0 1
Ask manager to create a group (unique name), say G,
and add some users to the group.
For a particular file (say game) or subdirectory, define an
appropriate access.
owner group public
chmod 761 game
Attach a group to a file
chgrp G game

More Related Content

PPTX
File System and File allocation tables
PDF
Run time storage
PPT
Chapter 10 - File System Interface
PPTX
Chapter 2: Operating-System Services.pptx
PPT
Aspnet Caching
PDF
File system
PPTX
Chapter 1: Introduction to Unix / Linux Kernel
PPT
Chapter 8 - Main Memory
File System and File allocation tables
Run time storage
Chapter 10 - File System Interface
Chapter 2: Operating-System Services.pptx
Aspnet Caching
File system
Chapter 1: Introduction to Unix / Linux Kernel
Chapter 8 - Main Memory

What's hot (20)

PPTX
What are thread libraries in operating system
PPT
ch10 Mass Storage Structure .ppt
PPTX
Free Space Management, Efficiency & Performance, Recovery and NFS
PDF
Domino IQ – What to Expect, First Steps and Use Cases
PPTX
File system.
PPT
Case Study 1: Linux
PPT
Linux architecture
PDF
NFS(Network File System)
PPT
3. distributed file system requirements
PPTX
Directory implementation and allocation methods
PPT
File access methods.54
PPTX
Namespaces in C#
PPT
Chapter 9 - Virtual Memory
PPT
Linux basic commands
PDF
Access Control: Principles and Practice
PPTX
Semaphore
PPT
File Management in Operating Systems
PPT
The process states
What are thread libraries in operating system
ch10 Mass Storage Structure .ppt
Free Space Management, Efficiency & Performance, Recovery and NFS
Domino IQ – What to Expect, First Steps and Use Cases
File system.
Case Study 1: Linux
Linux architecture
NFS(Network File System)
3. distributed file system requirements
Directory implementation and allocation methods
File access methods.54
Namespaces in C#
Chapter 9 - Virtual Memory
Linux basic commands
Access Control: Principles and Practice
Semaphore
File Management in Operating Systems
The process states
Ad

Viewers also liked (20)

PPT
Chapter 11 - File System Implementation
PPTX
File System Implementation
PPTX
Operating Systems - File Management
PDF
File System Interface
PDF
File Systems
PDF
Memory Management
PPTX
Chapter 1 swings
DOCX
Os solved question paper
PDF
Operating system concepts (notes)
PDF
10 File System
PPTX
File management
PDF
File System Implementation - Part1
PPTX
Htcia an introduction to the microsoft ex fat file system 1.01 final
PDF
File implementation
PPT
FINAL DEMO TOPIC
PPTX
TKP notes for Java
PPTX
File system implementation
PPTX
java-Unit4 chap2- awt controls and layout managers of applet
PPTX
Chapter iv(modern gui)
PDF
Java Swing Custom GUI MVC Component Tutorial
Chapter 11 - File System Implementation
File System Implementation
Operating Systems - File Management
File System Interface
File Systems
Memory Management
Chapter 1 swings
Os solved question paper
Operating system concepts (notes)
10 File System
File management
File System Implementation - Part1
Htcia an introduction to the microsoft ex fat file system 1.01 final
File implementation
FINAL DEMO TOPIC
TKP notes for Java
File system implementation
java-Unit4 chap2- awt controls and layout managers of applet
Chapter iv(modern gui)
Java Swing Custom GUI MVC Component Tutorial
Ad

Similar to Ch11: File System Interface (20)

PPT
운영체제론 Ch11
PPT
Ch11 OS
 
PPT
PPT
638241896796578949.PPTcfrdrservbvmnbmnbjh
PPT
10.file system interface
PPTX
File system interface ppt chapter 10 Operating systems
PPT
operating system notes for II year IV semester students
PPT
os unit-5-part2.ppt,Disk management file
PPT
ch10.ppt of operating systems of vit bhopal
PDF
ch10operating e systemss.pdf
PPT
DOCX
File system interfacefinal
PPT
ch11.ppt
PPTX
Filesth file handling in language dile
PPT
Lecture10-File Systems-PAfgfgfgfgfgfgf.ppt
PPT
Ch11 file system interface
PPT
operating system File - System Interface
PPT
Unit 3 file management
PDF
CH11.pdf
운영체제론 Ch11
Ch11 OS
 
638241896796578949.PPTcfrdrservbvmnbmnbjh
10.file system interface
File system interface ppt chapter 10 Operating systems
operating system notes for II year IV semester students
os unit-5-part2.ppt,Disk management file
ch10.ppt of operating systems of vit bhopal
ch10operating e systemss.pdf
File system interfacefinal
ch11.ppt
Filesth file handling in language dile
Lecture10-File Systems-PAfgfgfgfgfgfgf.ppt
Ch11 file system interface
operating system File - System Interface
Unit 3 file management
CH11.pdf

More from Ahmar Hashmi (20)

PPT
32 Security in_Internet_IP_SEC_SSL/TLS_PGN_VPN_and_Firewalls
PPT
31 Network Security
PPT
30 Cryptography
PPT
29 Multimedia
PPT
28 Network Management_SNMP
PPT
27 WWW and_HTTP
PPT
26 Remote Logging_Electronic_Mail_and_File_Transfer
PPT
25 DNS
PPT
24 Congestion Control_and_Quality_of_Service
PPT
23 Process to_Process_Delivery_UDP_TCP_and_SCTP
PPT
22 Network Layer_Delivery_forwarding_and_Routing
PPT
21 Network Layer_Address_Mapping_Error_Reporting_and_Multicasting
PPT
20 Network Layer_Internet_Protocol
PPT
19 Network Layer_Logical_Addressing
PPT
18 Virtual Circuit_Networks_Frame_Relay_and_ATM
PPT
17 SONET/SDH
PPT
16 Wireless WANs_Cellular_Telephone_and_Satellite_Networks
PPT
15 Connecting LANs_Backbone_Networks_and_Virtual_LAN
PPT
14 Wireless LAN
PPT
13 Wired Lans_Ethernet
32 Security in_Internet_IP_SEC_SSL/TLS_PGN_VPN_and_Firewalls
31 Network Security
30 Cryptography
29 Multimedia
28 Network Management_SNMP
27 WWW and_HTTP
26 Remote Logging_Electronic_Mail_and_File_Transfer
25 DNS
24 Congestion Control_and_Quality_of_Service
23 Process to_Process_Delivery_UDP_TCP_and_SCTP
22 Network Layer_Delivery_forwarding_and_Routing
21 Network Layer_Address_Mapping_Error_Reporting_and_Multicasting
20 Network Layer_Internet_Protocol
19 Network Layer_Logical_Addressing
18 Virtual Circuit_Networks_Frame_Relay_and_ATM
17 SONET/SDH
16 Wireless WANs_Cellular_Telephone_and_Satellite_Networks
15 Connecting LANs_Backbone_Networks_and_Virtual_LAN
14 Wireless LAN
13 Wired Lans_Ethernet

Recently uploaded (20)

PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
Classroom Observation Tools for Teachers
PDF
Pre independence Education in Inndia.pdf
PDF
RMMM.pdf make it easy to upload and study
PDF
Insiders guide to clinical Medicine.pdf
PPTX
Cell Types and Its function , kingdom of life
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
Microbial disease of the cardiovascular and lymphatic systems
PPTX
Cell Structure & Organelles in detailed.
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PPTX
GDM (1) (1).pptx small presentation for students
PPTX
Pharma ospi slides which help in ospi learning
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
Computing-Curriculum for Schools in Ghana
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
human mycosis Human fungal infections are called human mycosis..pptx
Supply Chain Operations Speaking Notes -ICLT Program
Classroom Observation Tools for Teachers
Pre independence Education in Inndia.pdf
RMMM.pdf make it easy to upload and study
Insiders guide to clinical Medicine.pdf
Cell Types and Its function , kingdom of life
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Microbial disease of the cardiovascular and lymphatic systems
Cell Structure & Organelles in detailed.
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
Pharmacology of Heart Failure /Pharmacotherapy of CHF
GDM (1) (1).pptx small presentation for students
Pharma ospi slides which help in ospi learning
2.FourierTransform-ShortQuestionswithAnswers.pdf
Computing-Curriculum for Schools in Ghana

Ch11: File System Interface

  • 1. Silberschatz, Galvin and Gagne ©200211.1 Chapter 11: File-System Interface File Concept Access Methods Directory Structure File System Mounting File Sharing Protection
  • 2. Silberschatz, Galvin and Gagne ©200211.2 File Concept Contiguous logical address space Types: Data numeric character binary Program
  • 3. Silberschatz, Galvin and Gagne ©200211.3 File Structure None - sequence of words, bytes Simple record structure Lines Fixed length Variable length Complex Structures Formatted document Relocatable load file Can simulate last two with first method by inserting appropriate control characters. Who decides: Operating system Program
  • 4. Silberschatz, Galvin and Gagne ©200211.4 File Attributes Name – only information kept in human-readable form. 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, which is maintained on the disk.
  • 5. Silberschatz, Galvin and Gagne ©200211.5 File Operations Create Write Read Reposition within file – file seek Delete Truncate Open(Fi) – search the directory structure on disk for entry Fi, and move the content of entry to memory. Close (Fi) – move the content of entry Fi in memory to directory structure on disk.
  • 6. Silberschatz, Galvin and Gagne ©200211.6 File Types – Name, Extension
  • 7. Silberschatz, Galvin and Gagne ©200211.7 Access Methods Sequential Access read next write next reset no read after last write (rewrite) Direct Access read n write n position to n read next write next rewrite n n = relative block number
  • 8. Silberschatz, Galvin and Gagne ©200211.8 Sequential-access File
  • 9. Silberschatz, Galvin and Gagne ©200211.9 Simulation of Sequential Access on a Direct-access File
  • 10. Silberschatz, Galvin and Gagne ©200211.10 Example of Index and Relative Files
  • 11. Silberschatz, Galvin and Gagne ©200211.11 Directory Structure A collection of nodes containing information about all files. F 1 F 2 F 3 F 4 F n Directory Files Both the directory structure and the files reside on disk. Backups of these two structures are kept on tapes.
  • 12. Silberschatz, Galvin and Gagne ©200211.12 A Typical File-system Organization
  • 13. Silberschatz, Galvin and Gagne ©200211.13 Information in a Device Directory Name Type Address Current length Maximum length Date last accessed (for archival) Date last updated (for dump) Owner ID (who pays) Protection information (discuss later)
  • 14. Silberschatz, Galvin and Gagne ©200211.14 Operations Performed on Directory Search for a file Create a file Delete a file List a directory Rename a file Traverse the file system
  • 15. Silberschatz, Galvin and Gagne ©200211.15 Organize the Directory (Logically) to Obtain Efficiency – locating a file quickly. Naming – convenient to users. Two users can have same name for different files. The same file can have several different names. Grouping – logical grouping of files by properties, (e.g., all Java programs, all games, …)
  • 16. Silberschatz, Galvin and Gagne ©200211.16 Single-Level Directory A single directory for all users. Naming problem Grouping problem
  • 17. Silberschatz, Galvin and Gagne ©200211.17 Two-Level Directory Separate directory for each user. •Path name •Can have the same file name for different user •Efficient searching •No grouping capability
  • 18. Silberschatz, Galvin and Gagne ©200211.18 Tree-Structured Directories
  • 19. Silberschatz, Galvin and Gagne ©200211.19 Tree-Structured Directories (Cont.) Efficient searching Grouping Capability Current directory (working directory) cd /spell/mail/prog type list
  • 20. Silberschatz, Galvin and Gagne ©200211.20 Tree-Structured Directories (Cont.) Absolute or relative path name Creating a new file is done in current directory. Delete a file rm <file-name> Creating a new subdirectory is done in current directory. mkdir <dir-name> Example: if in current directory /mail mkdir count mail prog copy prt exp count Deleting “mail” ⇒ deleting the entire subtree rooted by “mail”.
  • 21. Silberschatz, Galvin and Gagne ©200211.21 Acyclic-Graph Directories Have shared subdirectories and files.
  • 22. Silberschatz, Galvin and Gagne ©200211.22 Acyclic-Graph Directories (Cont.) Two different names (aliasing) If dict deletes list ⇒ dangling pointer. Solutions: Backpointers, so we can delete all pointers. Variable size records a problem. Backpointers using a daisy chain organization. Entry-hold-count solution.
  • 23. Silberschatz, Galvin and Gagne ©200211.23 General Graph Directory
  • 24. Silberschatz, Galvin and Gagne ©200211.24 General Graph Directory (Cont.) How do we guarantee no cycles? Allow only links to file not subdirectories. Garbage collection. Every time a new link is added use a cycle detection algorithm to determine whether it is OK.
  • 25. Silberschatz, Galvin and Gagne ©200211.25 File System Mounting A file system must be mounted before it can be accessed. A unmounted file system (I.e. Fig. 11-11(b)) is mounted at a mount point.
  • 26. Silberschatz, Galvin and Gagne ©200211.26 (a) Existing. (b) Unmounted Partition
  • 27. Silberschatz, Galvin and Gagne ©200211.27 Mount Point
  • 28. Silberschatz, Galvin and Gagne ©200211.28 File Sharing Sharing of files on multi-user systems is desirable. Sharing may be done through a protection scheme. On distributed systems, files may be shared across a network. Network File System (NFS) is a common distributed file- sharing method.
  • 29. Silberschatz, Galvin and Gagne ©200211.29 Protection File owner/creator should be able to control: what can be done by whom Types of access Read Write Execute Append Delete List
  • 30. Silberschatz, Galvin and Gagne ©200211.30 Access Lists and Groups Mode of access: read, write, execute Three classes of users RWX a) owner access 7 ⇒ 1 1 1 RWX b) group access 6 ⇒ 1 1 0 RWX c) public access 1 ⇒ 0 0 1 Ask manager to create a group (unique name), say G, and add some users to the group. For a particular file (say game) or subdirectory, define an appropriate access. owner group public chmod 761 game Attach a group to a file chgrp G game