One Pager Cheat Sheet
- This lesson will
discuss
the role of the operating system inmanaging
and organizing files andpersistent storage
devices for goodperformance
andreliability
. - The operating system provides abstractions in the form of
files
anddirectories
to enable data storage. - Files can be anything from images and text to code and they have an associated
inode number
which the OS is unaware of. - Directories are
special files
which store information about other files and directories, and are associated with aninode number
. - The Operating System divides hard disk drive or solid-state device space into
blocks
, stores each file's metadata in aninode
, and usesallocation structures
and asuperblock
to manage it all. - System data is
reserved elsewhere
and not stored in the data region as it is only for user data. - A bitmap
structure
is used to track whichblocks
of data have been used in the data region, and if a block isfree
, its corresponding bit will be set to 1. - Reading and writing are the two most important
access methods
in a file system, allowing for programs to access its contents. The
open()system call is issued to traverse the file system through multiple blocks, starting from the root directory, to find the desired file's inode and then its contents using the
read()system call, possibly updating the inode with its metadata.
- Writing files involves locating and allocating the blocks to data and can be I/O expensive, so most systems use
caching
andbuffering
techniques to reduce I/O overhead. - Caching and buffering techniques are used to optimize both
read
andwrite
operations, allowing for increased system performance. - Inodes
manage
the file mappings on disk, helping the Operating System (OS) quickly locate files andoptimize
disk access. - A read operation only
retrieves
data from disk and does notmodify
the existing number ofallocated blocks
.