Mark As Completed Discussion

One Pager Cheat Sheet

  • This lesson will discuss the role of the operating system in managing and organizing files and persistent storage devices for good performance and reliability.
  • The operating system provides abstractions in the form of files and directories 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 an inode number.
  • The Operating System divides hard disk drive or solid-state device space into blocks, stores each file's metadata in an inode, and uses allocation structures and a superblock 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 which blocks of data have been used in the data region, and if a block is free, 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.
  • 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 caching and buffering techniques to reduce I/O overhead.
  • Caching and buffering techniques are used to optimize both read and write operations, allowing for increased system performance.
  • Inodes manage the file mappings on disk, helping the Operating System (OS) quickly locate files and optimize disk access.
  • A read operation only retrieves data from disk and does not modify the existing number of allocated blocks.