Mohammad Saddam Mashuri's OS202
File Concept
Surprised to see File Concept to be on the top? Well, in my experiece, to understand the good stuff, you need to understand the foundation / fundamentals of something. I think, people neglect the file concept (Again, I assume this statement), which is understandable since in this modern times, people already interact with files traditionally and digitally. But what is a file really?
A file is a named collection of related information that is recorded on secondary storage. In an OS, to a user, the file is the smallest unit of storage on a computer system. The computer store information into a storage media, such as disk, and optical drives. The user then performs file operations like read and write. After that, the information stored in files are non-volatile. There types of files such as a text file, image file, source file, executable file, and etc. These files have attributes, like names, type, and size. The user usually edits the name as it is easier for users to recognize said file.
FHS: Filesystem Hierarchy Standard
I’ll admit, I was quite biased in placing this topic in the top 3. Why? Although the FHS has a lot to cover and for general users, they don’t interact with 95% of the directories there (I made up this number), for the first time researching this, I was quite fascinated that the filesystem has many directories. I’ve always thought that, “There are only ‘/root’ and some other directory in order for the system to function.” To my surprise, there are LOTS of directory that exists there. Directories such as ‘/bin’, ‘/sbin’, ‘/home’, ‘/lib’, ‘/tmp’, and much more, are inside the root filesystem. I haven’t even mentioned the other hierarchies, such as the ‘/usr’ and ‘/var’ that exists within the Linux annex.
Anyway here’s a simple definition of the FHS. Filesystem Hierarchy Standard (FHS) is the directory structure of the Linux distributions.
Filesystem in Userspace (FUSE)
FUSE lets us create our own file systems without editing kernel code. THAT is interesting. Non-priveleged and priveleged users can achieve this by running file system code in user space while the FUSE module provides only a “bridge” to the actual kernel interfaces. FUSE is a free software available for LINUX, macOS, and etc.
Virtual File System (VFS)
The virtual file system (VFS) interface, also known as the v-node interface, provides a bridge between the physical and logical file systems. The purpose of a VFS is to allow client applications to access different types of concrete file systems in a uniform way. A VFS can, for example, be used to access local and network storage devices transparently without the client application noticing the difference.
Data Integrity and Protection
Hard drives are not perfect and can fail (on occasion). Modern disks will occasionally seem to be mostly working, but have trouble successfuly accessing one or more blocks. These failures are common and there are two types of errors: latent-sector errors (LSEs) and block corruption.
LSEs arise when a disk sector has been damaged in some way. In contrast, a disk block becomes corrupt in cases, when a buggy disk firmware write to a block in the wrong location.
Handling an LSE is quite straightforward, as they are easily detected. To combat this issue, some systems add an extra degree of redundancy. When an LSE is discovered during reconstruction,the extra parity helps to reconstruct the missing block. To detect corruption, which is a key problem, use a checksum. A checksum is simply the result of a function that takes a chunk of data (say a 4KB block) as input andcomputes a function over said data, producing a small summary of thecontents of the data (say 4 or 8 bytes).
Network File System (NFS)
NFS? Need For Speed? (A racing video game if you’re wondering) Nah, it’s Network file System which is a mechanism for storing files on a network. I’ll be honest with you, I rarely store files on a closed network, but it’s probably used very often in an enterprise or a company. Anyway, NFS distributes file system that allows users to access files and directories located on remote computers and treat those files and directories as if they were local. Users may use operating system commands to create, remove, read, write, and set file attributes for remote files and directories.
Sources:
Abraham Silberschatz - Operating System Concepts -Wiley (2018)
http://pages.cs.wisc.edu/~remzi/OSTEP/
https://en.wikipedia.org/wiki/Virtual_file_system