Member-only story

DevOps in Linux — /sys/block Directory

Deep dive into Linux /sys directory

Tony
4 min readApr 7, 2023

Note, full mind map is available at: “DevOps in Linux Mind Map

/sys/block

What is /sys/block

In Linux, the /sys/block directory is a virtual file system that contains information about block devices. A block device is a storage device that can read and write data in fixed-size blocks, such as hard drives, solid-state drives, and USB drives.

Inside the /sys/block directory, there are subdirectories for each block device attached to the system, such as sda, sdb, mmcblk0, and so on. Each subdirectory contains files that provide information about the device, such as its size, model name, firmware version, and partition layout.

For example, the /sys/block/sda directory contains files such as:

  • size: The size of the device in bytes.
  • device/model: The model name of the device.
  • device/vendor: The vendor name of the device.
  • queue/scheduler: The I/O scheduler algorithm used by the device.
  • partition: A directory containing information about the partitions on the device.

--

--

Tony
Tony

No responses yet