Chapter 7 & 8 File Systems: Computer Department SPIT, Piludara
Chapter 7 & 8 File Systems: Computer Department SPIT, Piludara
File Systems
File :
Logical Storage unit
Is the collection of related information
• But also file contains some important aspects like : the date
and the time the file was created, the size of data, the
protection of file……..etc.
• Random access
Figure 4-3.
(a) An
executable
file.
(b) An archive.
File Types
• As in figure (a), An executable files contains five sections :
header, text, data, Relocation bits, Symbol table.
• Header contains Magic number, text size, data size, BSS
size, Symbol table size, Entry point.
• Magic number specify that the file is executable or not.
• Then sizes of various pieces of the files.
User Dir
C Files
A B B
1. Contiguous Allocation
• Disadvantages :
• The entire table must be in main memory all the time when it used, so
memory overload will be increased.
I-nodes Allocation
Implementing Directories (1)
Figure 4-14. (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.
Figure 4-17. (a) Situation prior to linking. (b) After the link is
created. (c) After the original owner removes the file.
Computer Department SPIT, Piludara
Journaling File Systems
Operations required to remove a file in UNIX
Figure 4-21. The solid curve (left-hand scale) gives the data rate of a disk. The
dashed curve (right-hand scale) gives the disk space efficiency. All files are 4 KB.
Figure 4-22. (a) Storing the free list on a linked list. (b) A bitmap.
Computer Department SPIT, Piludara
Keeping Track of Free Blocks (2)
Figure 4-23. (a) An almost-full block of pointers to free disk blocks in memory and three blocks of
pointers on disk. (b) Result of freeing a three-block file. (c) An alternative strategy for handling
the three free blocks. The shaded entries represent pointers to free disk blocks.
Figure 4-25. A file system to be dumped. Squares are directories, circles are files. Shaded items
have been modified since last dump. Each directory and file is labeled by its i-node number.
Figure 4-27. File system states. (a) Consistent. (b) Missing block.
(c) Duplicate block in free list. (d) Duplicate data block.
Computer Department SPIT, Piludara
Caching (1)
Figure 4-32. Maximum partition size for different block sizes. The
empty boxes represent forbidden combinations.
Computer Department SPIT, Piludara
The UNIX V7 File System (1)