Block device
A block device is an operating-system device abstraction that exposes storage through addressable blocks, whether its backing is physical, virtual or memory-resident.
Identity: In Linux, a block special file has type S_IFBLK. Its st_rdev identifies the represented device; st_dev instead identifies the device associated with the filesystem containing that inode. The device node and the storage it represents are different objects. [1]
Backing: A loop device maps blocks to a regular file or another block device. A filesystem image in a file can therefore be accessed through a block-device interface without becoming a physical disk. Linux permits LOOP_CHANGE_FD only for a read-only loop device whose replacement backing store matches the old store in size and type. Consequently, an unchanged device node is not proof of an unchanged backing image. [2]
Persistence: zram stores compressed pages in RAM and can optionally write selected pages to a configured backing device. Block addressing alone does not establish persistence after power loss. [3]
Requests: Linux blk-mq connects userspace or filesystems to block-device drivers. Requests may be merged or reordered, and the block layer does not itself guarantee completion order. [4]
Relations
- related
- Block storage, Linux block-device read-only flag, zram, Zoned block device (ZBD), Character device
Citations
- Linux man-pages: inode(7), file type and represented-device identity
- Linux man-pages: loop(4), file-backed and block-backed loop devices
- Linux 6.12: zram, compressed RAM backing and optional writeback
- Linux 6.12: Multi-Queue Block IO Queueing Mechanism
Further reading
Sources & caveats
- The concrete identity fields and driver examples describe Linux, not a universal device API.
- Documentation synthesis, not a native block-device or power-loss experiment.