One Pager Cheat Sheet
- This lesson will
discussthe role of the operating system inmanagingand organizing files andpersistent storagedevices for goodperformanceandreliability. - The operating system provides abstractions in the form of
filesanddirectoriesto enable data storage. - Files can be anything from images and text to code and they have an associated
inode numberwhich the OS is unaware of. - Directories are
special fileswhich 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 structuresand asuperblockto manage it all. - System data is
reserved elsewhereand not stored in the data region as it is only for user data. - A bitmap
structureis used to track whichblocksof 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 methodsin a file system, allowing for programs to access its contents. Theopen()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 theread()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
cachingandbufferingtechniques to reduce I/O overhead. - Caching and buffering techniques are used to optimize both
readandwriteoperations, allowing for increased system performance. - Inodes
managethe file mappings on disk, helping the Operating System (OS) quickly locate files andoptimizedisk access. - A read operation only
retrievesdata from disk and does notmodifythe existing number ofallocated blocks.


