![Page 1: Some basic concepts and information on file systems Portions taken and modified from books by ANDREW S. TANENBAUM](https://reader035.vdocument.in/reader035/viewer/2022070404/56649f345503460f94c50dd7/html5/thumbnails/1.jpg)
Some basic concepts and information on file systems
Portions taken and modified from books by ANDREW S. TANENBAUM
![Page 2: Some basic concepts and information on file systems Portions taken and modified from books by ANDREW S. TANENBAUM](https://reader035.vdocument.in/reader035/viewer/2022070404/56649f345503460f94c50dd7/html5/thumbnails/2.jpg)
Essential for long-term information storage:
• It must be possible to store a very large amount of information.
• The information must survive the termination of the process using it.
• Multiple processes must be able to access the information concurrently.
Why do we need files and file Systems
![Page 3: Some basic concepts and information on file systems Portions taken and modified from books by ANDREW S. TANENBAUM](https://reader035.vdocument.in/reader035/viewer/2022070404/56649f345503460f94c50dd7/html5/thumbnails/3.jpg)
Think of a disk as a linear sequence of fixed-size blocks and supporting reading and writing of blocks. Questions that quickly arise:
•How do you find information?
•How do you keep one user from reading another’s data?
•How do you know which blocks are free?
Files on disks
![Page 4: Some basic concepts and information on file systems Portions taken and modified from books by ANDREW S. TANENBAUM](https://reader035.vdocument.in/reader035/viewer/2022070404/56649f345503460f94c50dd7/html5/thumbnails/4.jpg)
File Naming & Estensions
![Page 5: Some basic concepts and information on file systems Portions taken and modified from books by ANDREW S. TANENBAUM](https://reader035.vdocument.in/reader035/viewer/2022070404/56649f345503460f94c50dd7/html5/thumbnails/5.jpg)
Three kinds of files. (a) Byte sequence. (b) Record sequence. (c) Tree.
File Structure
![Page 6: Some basic concepts and information on file systems Portions taken and modified from books by ANDREW S. TANENBAUM](https://reader035.vdocument.in/reader035/viewer/2022070404/56649f345503460f94c50dd7/html5/thumbnails/6.jpg)
(a) An executable file. (b) An archive.
File Types and Formats
![Page 7: Some basic concepts and information on file systems Portions taken and modified from books by ANDREW S. TANENBAUM](https://reader035.vdocument.in/reader035/viewer/2022070404/56649f345503460f94c50dd7/html5/thumbnails/7.jpg)
Some Common file attributes
![Page 8: Some basic concepts and information on file systems Portions taken and modified from books by ANDREW S. TANENBAUM](https://reader035.vdocument.in/reader035/viewer/2022070404/56649f345503460f94c50dd7/html5/thumbnails/8.jpg)
Common system calls relating to files
• Append• Seek• Get Attributes• Set Attributes• Rename
• Create• Delete• Open • Close• Read• Write
![Page 9: Some basic concepts and information on file systems Portions taken and modified from books by ANDREW S. TANENBAUM](https://reader035.vdocument.in/reader035/viewer/2022070404/56649f345503460f94c50dd7/html5/thumbnails/9.jpg)
Hierarchical Directory Systems
![Page 10: Some basic concepts and information on file systems Portions taken and modified from books by ANDREW S. TANENBAUM](https://reader035.vdocument.in/reader035/viewer/2022070404/56649f345503460f94c50dd7/html5/thumbnails/10.jpg)
Path Names - A UNIX directory tree
![Page 11: Some basic concepts and information on file systems Portions taken and modified from books by ANDREW S. TANENBAUM](https://reader035.vdocument.in/reader035/viewer/2022070404/56649f345503460f94c50dd7/html5/thumbnails/11.jpg)
System calls for managing directories:
Directory Operations
• Readdir
• Rename
• Link
• Uplink
• Create
• Delete
• Opendir
• Closedir
![Page 12: Some basic concepts and information on file systems Portions taken and modified from books by ANDREW S. TANENBAUM](https://reader035.vdocument.in/reader035/viewer/2022070404/56649f345503460f94c50dd7/html5/thumbnails/12.jpg)
Typical (Unix) File System Layout
![Page 13: Some basic concepts and information on file systems Portions taken and modified from books by ANDREW S. TANENBAUM](https://reader035.vdocument.in/reader035/viewer/2022070404/56649f345503460f94c50dd7/html5/thumbnails/13.jpg)
a) Contiguous allocation of disk space for 7 files.
(b) The state of the disk after files D and F have been removed.
Contiguous Allocation
![Page 14: Some basic concepts and information on file systems Portions taken and modified from books by ANDREW S. TANENBAUM](https://reader035.vdocument.in/reader035/viewer/2022070404/56649f345503460f94c50dd7/html5/thumbnails/14.jpg)
Linked List Allocation
![Page 15: Some basic concepts and information on file systems Portions taken and modified from books by ANDREW S. TANENBAUM](https://reader035.vdocument.in/reader035/viewer/2022070404/56649f345503460f94c50dd7/html5/thumbnails/15.jpg)
Linked List Allocation – File Allocation Table
![Page 16: Some basic concepts and information on file systems Portions taken and modified from books by ANDREW S. TANENBAUM](https://reader035.vdocument.in/reader035/viewer/2022070404/56649f345503460f94c50dd7/html5/thumbnails/16.jpg)
I-nodes
![Page 17: Some basic concepts and information on file systems Portions taken and modified from books by ANDREW S. TANENBAUM](https://reader035.vdocument.in/reader035/viewer/2022070404/56649f345503460f94c50dd7/html5/thumbnails/17.jpg)
(a) A simple directory containing fixed-size entries with the disk addresses and attributes in the directory entry.
(b) A directory in which each entry just refers to an i-node.
Implementing Directories
![Page 18: Some basic concepts and information on file systems Portions taken and modified from books by ANDREW S. TANENBAUM](https://reader035.vdocument.in/reader035/viewer/2022070404/56649f345503460f94c50dd7/html5/thumbnails/18.jpg)
Shared Files
![Page 19: Some basic concepts and information on file systems Portions taken and modified from books by ANDREW S. TANENBAUM](https://reader035.vdocument.in/reader035/viewer/2022070404/56649f345503460f94c50dd7/html5/thumbnails/19.jpg)
(a) Situation prior to linking. (b) After the link is created. (c) After the original owner removes the file.
![Page 20: Some basic concepts and information on file systems Portions taken and modified from books by ANDREW S. TANENBAUM](https://reader035.vdocument.in/reader035/viewer/2022070404/56649f345503460f94c50dd7/html5/thumbnails/20.jpg)
Operations required to remove a file in UNIX:• Remove the file from its directory.• Release the i-node to the pool of free i-nodes.• Return all the disk blocks to the pool of free disk
blocks.
Journaling File Systems
Log (journal) is kept so that the operation is all or nothing – atomic.
![Page 21: Some basic concepts and information on file systems Portions taken and modified from books by ANDREW S. TANENBAUM](https://reader035.vdocument.in/reader035/viewer/2022070404/56649f345503460f94c50dd7/html5/thumbnails/21.jpg)
Abstract layer is added to make all file systems appear to be the same.
Virtual File Systems
![Page 22: Some basic concepts and information on file systems Portions taken and modified from books by ANDREW S. TANENBAUM](https://reader035.vdocument.in/reader035/viewer/2022070404/56649f345503460f94c50dd7/html5/thumbnails/22.jpg)
Percentage of files smaller than a given size (in bytes).
![Page 23: Some basic concepts and information on file systems Portions taken and modified from books by ANDREW S. TANENBAUM](https://reader035.vdocument.in/reader035/viewer/2022070404/56649f345503460f94c50dd7/html5/thumbnails/23.jpg)
(a) Storing the free list on a linked list. (b) A bitmap.
Keeping Track of Free Blocks
![Page 24: Some basic concepts and information on file systems Portions taken and modified from books by ANDREW S. TANENBAUM](https://reader035.vdocument.in/reader035/viewer/2022070404/56649f345503460f94c50dd7/html5/thumbnails/24.jpg)
The UNIX V7 File System