file system
play

~FILE SYSTEM~ SUNU WIBIRAMA OUTLINE FILE SYSTEM ACCESS METHODS - PowerPoint PPT Presentation

~FILE SYSTEM~ SUNU WIBIRAMA OUTLINE FILE SYSTEM ACCESS METHODS DIRECTORY STRUCTURE FILE SYSTEM MOUNTING PROTECTION EXTERNAL VIEW OF THE FILE MANAGER FILE MANAGEMENT FILE, IS A NAMED AND ORDERED COLLECTION OF INFORMATION COMPUTER SHOULD


  1. ~FILE SYSTEM~ SUNU WIBIRAMA

  2. OUTLINE FILE SYSTEM ACCESS METHODS DIRECTORY STRUCTURE FILE SYSTEM MOUNTING PROTECTION

  3. EXTERNAL VIEW OF THE FILE MANAGER

  4. FILE MANAGEMENT FILE, IS A NAMED AND ORDERED COLLECTION OF INFORMATION COMPUTER SHOULD BE CONVENIENT TO BE USED OPERATING SYSTEM HANDLES IT WITH ITS FILE MANAGEMENT FUNCTION FILE MANAGER’S JOB: - STORING THE INFORMATION ON A DEVICE - MAPPING THE BLOCK STORAGE TO LOGICAL VIEW - ALLOCATING /DEALLOCATING STORAGE - ORGANIZING FILE EFFICIENTLY

  5. FILE STRUCTURE  File represents program (source and object forms) and data  General file structure: sequence of bits, bytes, lines, or records  Simple record structure:  Lines  Fixed length  Variable length  Complex Structures:  Formatted document  Relocatable load file �  Who decides:  Operating system  Program

  6. FILE ATTRIBUTES NAME – ONLY INFORMATION KEPT IN HUMAN- READABLE FORM IDENTIFIER – UNIQUE TAG (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, WHICH IS MAINTAINED ON THE DISK

  7. FILE OPERATIONS  File is an abstract data type  Create  Write  Read  Reposition within file (FILE SEEK)  Delete  Truncate

  8. OPEN AND CLOSE FILE  Open(F i ) – search the directory structure on disk for entry F i , and move the content of entry to memory. OS provides open-file table to containing information about all open files (no need to search directory structures when a file operation is requested)  Close (F i ) – move the content of entry F i in memory to directory structure on disk. Erase the entry in open-file table related to the closed file.

  9. FILE TYPES  Operating System must recognize the file type in order to operate on the file in reasonable ways.  File types are recognized as an extension : *.exe, *.doc, *.psd, etc.

  10. ACCESS METHOD (1)  Sequential Access: � - read next � - write next � - reset � - no read after last write � - rewrite

  11. ACCESS METHOD (2)  Direct Access (Relative Access): � - no restrictions on the order of read or write - read n � - write n � - position to n � - read next � - write next � - rewrite n � n = relative block number HOW TO TRANSLATE SEQUENTIAL-ACCESS ON A DIRECT-ACCESS FILE

  12. BASIC DISK STRUCTURES DISK CAN BE SUBDIVIDED INTO PARTITIONS ENTITY CONTAINING FILE SYSTEM ALSO KNOWN AS VOLUME DIRECTORY IS LIKE A TABLE OF CONTENTS - RECORDS INFORMATION, SUCH AS NAME, LOCATION, SIZE, TYPE OF ALL FILES IN A VOLUME

  13. DIRECTORY SET OF FILES USED TO ORGANIZE FILES TREATED AS A FILE, BUT WITH SPECIAL OPERATIONS ON IT: - CREATE A FILE - DELETE A FILE - SEARCH A FILE - LIST A DIRECTORY - RENAME A FILE

  14. SINGLE-LEVEL DIRECTORY SINGLE DIRECTORY FOR ALL USERS IF THE NUMBER OF FILES INCREASES OR MORE THAN ONE USERS --> PROBLEM OCCURES LENGTH OF FILE NAME LIMITATION: MS-DOS (11) DIFFERS WITH UNIX (255)

  15. TWO-LEVEL DIRECTORY SEPARATE DIRECTORY FOR EACH USER CAN HAVE THE SAME FILE NAME FOR DIFFERENT USER ISOLATES ONE USER TO THE OTHERS

  16. TREE-STRUCTURED DIRECTORY TREE: THE MOST COMMON STRUCTURES

  17. TREE-STRUCTURED DIRECTORY  Efficient searching  Grouping Capability  Current directory (working directory)  Absolute or relative path name CURRENT DIRECTORY ABSOLUTE PATH RELATIVE PATH

  18. TREE-STRUCTURED DIRECTORY  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 � � mail mkdir count copy prt exp count

  19. TREE-STRUCTURED DIRECTORY  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 � � mail mkdir count copy prt exp count what’s happened, if i execute rm -rf /home ?

  20. ACYCLIC-GRAPH DIRECTORIES HAVE SHARED SUBDIRECTORIES AND FILES SHARED FILE SHARED SUBDIRECTORY

  21. ACYCLIC-GRAPH DIRECTORIES ALIASING: DIFFERENT FILE NAMES FOR SAME FILE A POINTER TO SHARED FILE IS NAMED LINK DELETION PROBLEM, IF THE SHARED SUBDIRECTORY “LIST” IS DELETED, WE HAVE DANGLING POINTER SYMBOLIC LINKS: - IF LINK IS DELETED, PRESERVE THE ORIGINAL FILE - IF ORIGINAL FILE IS DELETED, ACCESS TO THE DELETED FILE USING LINKS IS TREATED AS ILLEGAL ACCESS. NON-SYMBOLIC LINKS (HARD LINKS): - PRESERVE THE FILE UNTIL ALL REFERENCES TO IT ARE DELETED - KEEP ONLY A COUNT OF THE NUMBER OF REFERENCES. WHEN THE COUNT = 0, FILE CAN BE DELETED BECAUSE NO REFERENCE TO IT.

  22. GENERAL GRAPH DIRECTORY  How do we guarantee no cycles?  Allow only links to file not subdirectories  Garbage collection: detect when the last reference has been deleted  Every time a new link is added use a cycle detection algorithm to determine whether it is OK, but it’s computationally expensive

  23. ACYCLIC-GRAPH DIRECTORIES LINK IN UBUNTU LINUX 10.10

  24. FILE SYSTEM MOUNTING MOUNTED (A) MOUNTED (B) UNMOUNTED you can see how it works on unix, instead of windows

  25. FILE SYSTEM MOUNTING Mount point: /mnt/public BEFORE MOUNTING SOMETIME YOU SHOULD DEFINE THE TYPE OF YOUR MOUNTED FILE SYSTEM AFTER MOUNTING

  26. FILE SYSTEM MOUNTING Automatic mounting on booting: /etc/fstab mounted file mount point file system type

  27. FILE SHARING Multiple users: problem arises on file sharing, file naming, and file protection Add more attributes to file and directory Most systems use concept of OWNER and GROUP User IDs identify users, allowing permissions and protections to be per-user Group IDs allow users to be in groups, permitting group access rights We will elaborate on the last section : PROTECTION

  28. REMOTE FILE SHARING  Uses networking to allow file system access between systems  Manually via programs like FTP  Automatically, seamlessly using distributed file systems  Semi automatically via the world wide web  Client-server model allows clients to mount remote file systems from servers  Server can serve multiple clients  Client and user-on-client identification is insecure or complicated  NFS is standard UNIX client-server file sharing protocol  CIFS is standard Windows protocol  Standard operating system file calls are translated into remote calls  Distributed Information Systems (distributed naming services) such as LDAP, DNS, NIS, Active Directory implement unified access to information needed for remote computing

  29. PROTECTION  Keep the file safe from physical damage (reliability) and improper access (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. PROTECTION Field Meaning Owner (o) - File type / directory Group (g) rw-r--r-- Permission Public/Universe (p) 1 Hard link number to file sunu owner of file sunu group of file -rwxr-x--- 323 file size in byte 2010-11-18 13:55 modification date execute.txt file name file [p] [o] [g]

  31. PROTECTION  Mode of access and octal: read (r = 4), write (w = 2), execute (x = 1)  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 game chmod 761 Attach a group to a file: chgrp G game

  32. PROTECTION ACCESS CONTROL LIST IN WINDOWS XP ADMIN USERS

  33. /EOF end of file

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend