Computer Operating System - Lecture 11: File system - Nguyen Thanh Son

File Concept
 Access Methods
 Directory Structure
 File System Mounting
 File Sharing
 Protection 
pdf 30 trang xuanthi 30/12/2022 2060
Bạn đang xem 20 trang mẫu của tài liệu "Computer Operating System - Lecture 11: File system - Nguyen Thanh Son", để tải tài liệu gốc về máy hãy click vào nút Download ở trên.

File đính kèm:

  • pdfcomputer_operating_system_lecture_11_file_system_nguyen_than.pdf

Nội dung text: Computer Operating System - Lecture 11: File system - Nguyen Thanh Son

  1. Chapter’s Content  File Concept  Access Methods  Directory Structure  File System Mounting  File Sharing  Protection BK TP.HCM 07-Feb-17 Faculty of Computer Science & Engineering 2
  2. 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. BK TP.HCM 07-Feb-17 Faculty of Computer Science & Engineering 4
  3. File Types – Name, Extension BK TP.HCM 07-Feb-17 Faculty of Computer Science & Engineering 6
  4. 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 BK TP.HCM 07-Feb-17 Faculty of Computer Science & Engineering 8
  5. Simulation of Sequential Access on a Direct-access File BK TP.HCM 07-Feb-17 Faculty of Computer Science & Engineering 10
  6. Directory Structure  A collection of nodes containing information about all files. Directory Files F 2 F 4 F 1 F 3 F n Both the directory structure and the files reside on disk. Backups of these two structures are kept on tapes. BK TP.HCM 07-Feb-17 Faculty of Computer Science & Engineering 12
  7. 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) BK TP.HCM 07-Feb-17 Faculty of Computer Science & Engineering 14
  8. Main Purpose of File Directory  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, ) BK TP.HCM 07-Feb-17 Faculty of Computer Science & Engineering 16
  9. Two-Level Directory  Separate directory for each user. •Path name •Can have the same file name for different user •Efficient searching •No grouping capability BK TP.HCM 07-Feb-17 Faculty of Computer Science & Engineering 18
  10. Tree-Structured Directories (Cont.)  Efficient searching  Grouping Capability  Current directory (working directory)  cd /spell/mail/prog  type list BK TP.HCM 07-Feb-17 Faculty of Computer Science & Engineering 20
  11. Acyclic-Graph Directories  Have shared subdirectories and files. BK TP.HCM 07-Feb-17 Faculty of Computer Science & Engineering 22
  12. General Graph Directory BK TP.HCM 07-Feb-17 Faculty of Computer Science & Engineering 24
  13. 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. BK (a) Existing. (b) Unmounted Partition TP.HCM 07-Feb-17 Faculty of Computer Science & Engineering 26
  14. 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. BK TP.HCM 07-Feb-17 Faculty of Computer Science & Engineering 28
  15. 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 Attach a group to a file chmod 761 game chgrp G game BK TP.HCM 07-Feb-17 Faculty of Computer Science & Engineering 30