Operating System Lecture 15 File Systems Manoj Kumar
- Slides: 32
Operating System Lecture 15: File Systems Manoj Kumar Jain M. L. Sukhadia University Udaipur
Outline n n n File Concept Access Methods Directory Structure File System Mounting File Sharing Protection Manoj Kumar Jain Professor Computer Science MLSU Udaipur 2
File Concept n Contiguous logical address space n Types: n Data n n numeric character binary Program Manoj Kumar Jain Professor Computer Science MLSU Udaipur 3
File Structure n n None - sequence of words, bytes Simple record structure n n Complex Structures n n Lines Fixed length Variable length Formatted document Relocatable load file Can simulate last two with first method by inserting appropriate control characters. Who decides: n n Operating system Program Manoj Kumar Jain Professor Computer Science MLSU Udaipur 4
File Attributes n n n n 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. Manoj Kumar Jain Professor Computer Science MLSU Udaipur 5
File Operations n n n n 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. Manoj Kumar Jain Professor Computer Science MLSU Udaipur 6
File Types – Name, Extension Manoj Kumar Jain Professor Computer Science MLSU Udaipur 7
Access Methods n Sequential Access n Direct Access read next write next reset no read after last write (rewrite) read n write n position to n read next write next rewrite n n = relative block number Manoj Kumar Jain Professor Computer Science MLSU Udaipur 8
Sequential-access File Manoj Kumar Jain Professor Computer Science MLSU Udaipur 9
Simulation of Sequential Access on a Direct-access File Manoj Kumar Jain Professor Computer Science MLSU Udaipur 10
Example of Index and Relative Files Manoj Kumar Jain Professor Computer Science MLSU Udaipur 11
Directory Structure n A collection of nodes containing information about all files. Directory Files F 1 F 2 F 3 F 4 Fn Both the directory structure and the files reside on disk. Backups of these two structures are kept on tapes. Manoj Kumar Jain Professor Computer Science MLSU Udaipur 12
A Typical File-system Organization Manoj Kumar Jain Professor Computer Science MLSU Udaipur 13
Information in a Device Directory n n n n n 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) Manoj Kumar Jain Professor Computer Science MLSU Udaipur 14
Operations Performed on Directory n n n Search for a file Create a file Delete a file List a directory Rename a file Traverse the file system Manoj Kumar Jain Professor Computer Science MLSU Udaipur 15
Organize the Directory (Logically) to Obtain n n Efficiency – locating a file quickly. Naming – convenient to users. n n n 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, …) Manoj Kumar Jain Professor Computer Science MLSU Udaipur 16
Single-Level Directory n A single directory for all users. Naming problem Grouping problem Manoj Kumar Jain Professor Computer Science MLSU Udaipur 17
Two-Level Directory n Separate directory for each user. • Path name • Can have the same file name for different user • Efficient searching • No grouping capability Manoj Kumar Jain Professor Computer Science MLSU Udaipur 18
Tree-Structured Directories Manoj Kumar Jain Professor Computer Science MLSU Udaipur 19
Tree-Structured Directories (Cont. ) n Efficient searching n Grouping Capability n Current directory (working directory) n n cd /spell/mail/prog type list Manoj Kumar Jain Professor Computer Science MLSU Udaipur 20
Tree-Structured Directories (Cont. ) n n 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”. Manoj Kumar Jain Professor Computer Science MLSU Udaipur 21
Acyclic-Graph Directories n Have shared subdirectories and files. Manoj Kumar Jain Professor Computer Science MLSU Udaipur 22
Acyclic-Graph Directories (Cont. ) n Two different names (aliasing) n If dict deletes list dangling pointer. Solutions: n n n Backpointers, so we can delete all pointers. Variable size records a problem. Backpointers using a daisy chain organization. Entry-hold-count solution. Manoj Kumar Jain Professor Computer Science MLSU Udaipur 23
General Graph Directory Manoj Kumar Jain Professor Computer Science MLSU Udaipur 24
General Graph Directory (Cont. ) n How do we guarantee no cycles? n n n 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. Manoj Kumar Jain Professor Computer Science MLSU Udaipur 25
File System Mounting n A file system must be mounted before it can be accessed. n A unmounted file system (i. e. Fig. 11 -11(b)) is mounted at a mount point. Manoj Kumar Jain Professor Computer Science MLSU Udaipur 26
(a) Existing. (b) Unmounted Partition Manoj Kumar Jain Professor Computer Science MLSU Udaipur 27
Mount Point Manoj Kumar Jain Professor Computer Science MLSU Udaipur 28
File Sharing n n 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. Manoj Kumar Jain Professor Computer Science MLSU Udaipur 29
Protection n File owner/creator should be able to control: n n n what can be done by whom Types of access n n n Read Write Execute Append Delete List Manoj Kumar Jain Professor Computer Science MLSU Udaipur 30
Access Lists and Groups n n Mode of access: read, write, execute Three classes of users RWX 111 110 001 name), say G, a) owner access 7 b) group access 6 c) public access 1 Ask manager to create a group (unique and add some users to the group. For a particular file (say game) or subdirectory, define an appropriate access. owner chmod group 761 public game Attach a group to a file chgrp G game Manoj Kumar Jain Professor Computer Science MLSU Udaipur 31
Thanks Manoj Kumar Jain Professor Computer Science MLSU Udaipur 32
- File-file yang dibuat oleh user pada jenis file di linux
- Operating systems lecture notes
- File system in operating system
- File system in operating system
- File system in operating system
- Module 4 operating systems and file management
- Os file management
- File management in android operating system
- File management components
- Remote file access in distributed file system
- In a file-oriented information system, a transaction file
- Manoj radhakrishnan
- Manoj magician
- Manoj mehta ficci
- Manoj abichandani
- Manoj toshniwal dubai
- Dr manoj das products
- Measurement and scaling
- Manisha has secured 79 marks in the college exam
- Manoj chatlani
- 01:640:244 lecture notes - lecture 15: plat, idah, farad
- Operating system architecture in os
- Physical image vs logical image
- File sharing management system
- An html file is a text file containing small markup tags.
- Buddy system operating system
- Lecture sound systems
- Lecture sound systems
- File system modules in distributed system
- Flat file service
- Examples of operating systems
- Evolution of operating systems
- Components of operating systems