M13: The OS File System Flashcards
fseek() :
sets the position of the stream to the given offset, allowing
seeking a specified part of the file
disk block
basic logic unit of storage on disk of a contiguous set of bytes
Disk partitions:
logical split of the actual disk drive. The operating system views each partition as a distinct disk, and different operating systems may be run in each split; each partition has at least one directory, in which all the partition’s files are listed.
The typical internal structure of the disk partition includes:
Boot block
Superblock
Free space data structure
i-node list
Boot block:
contains information on the disk layout and code for loading the operating system into the kernel space
Superblock:
contains basic information about the file system, including
the file system size, list of free blocks, list of allocated blocks, and time of the last modification to the partition; the superblock can be read into
memory at boot time
Free space data structure:
tracks the free blocks in the disk
I-nodes list :
stores information about the individual files stored on disk, and allocatable blocks for directories and file systems
Master boot record :
stores information about the entire drive
Partition table:
specifies the beginning of each partition
Disk space allocation
managing data in the disk with the aims to ensure fast
sequential access, fast random access, the ability to grow a file system quickly, and to minimize fragmentation
Contiguous allocation :
each file occupies a contiguous region of blocks
Linked-list allocation :
hold a linked list of blocks for each file such that
each block contains a pointer to the next block
File allocation table :
stores a condensed version of the linked list to be
stored at the beginning of the file system; the file is stored in allocated
clusters
Linked list with indexing or i-nodes
supports direct access to the file’s
blocks by storing files in the i-node data structure
i-node (index node) :
kernel structure storing information about
each file in the file system; contains a pointer to the disk blocks
containing the file’s data, and information such as the file
permissions, ownership, modification time, and file type
directory
file that holds the list of filenames and their inodes; provides
information needed to find the disk data blocks of a file
Hard links:
to represent two different paths for a file, create a single i-node and
have two directory entries that point to the same i-node; relies on the link-counter
Link-counter:
counts the number of ways that an i-node can be retrieved
along different paths
Symbolic/soft link:
the original file has its own i-node and for each reference or
path to the file, there is a separate i-node, of type LINK, for a file that just
contains the path name to the original file
Free space management:
tracking unallocated blocks in a portion of the disk
partition
Approaches: A) Bitmap B) Linked List
Bitmap - free space management
maintains for the entire disk partition with one encoding the fact
that the block of a particular number is free and zero otherwise
Linked list:
list storing the free blocks
In-memory cache :
uses a scheme to store blocks that are likely to be requested
from disk, to shortcut the need for a disk search and propagate the data to the
requesting process
LRU scheme :
given the limited in-memory cache size, evicts the least
recently used block from the cache when new blocks are being added in
Incremental backups :
every time you synchronize with your server, it will only
backup files that have been changed since the last time
Physical backup:
physically copy block by block from one disk to another
Logical backup:
copies files from one disk to another