Looking at the representation of block devices
When discussing VFS, we saw that abstractions are at the heart of the kernel’s I/O stack. The block layer is no exception to this rule. Regardless of the differences in the physical make and model, the kernel should be able to work with storage devices uniformly. To implement a standard interface for all devices, the operations should be independent of the properties of the underlying storage device.
As explained in Chapter 1, almost everything is represented in the form of a file, including hardware devices. A block device is a special file and is named as such because the kernel interacts with it using a fixed number of bytes. Depending on the nature of the devices, the files representing them are created and stored at specific locations in the system. The block devices in the system are present in the /dev
directory. Filenames representing disk drives in the system start with sd
, followed by a letter representing the order...