The Hardware Abstraction Layer
In Ubuntu Linux, “everything is a file.” This means that physical hardware devices—such as hard drives, USB flash drives, and NVMe SSDs—are represented as special files within the operating system. Specifically, storage drives that read and write data in buffered “blocks” are known as Block Device files (usually residing in the /dev/ directory, like /dev/sda). If you are a system administrator writing an automation script to format newly inserted hard drives, you cannot use a standard search for normal text files. You must explicitly instruct the search engine to look for block devices.
Using the find Command with -type b
The Linux find command utilizes the -type b flag to exclusively search for hardware Block Device files, ignoring all standard data files and directories.
- Open your Terminal application (Ctrl + Alt + T) or log into your server via SSH.
- To scan the
/dev/directory and return a list of all attached physical block storage drives, type the following command exactly: find /dev/ -type b- Press Enter.
Identifying Physical Storage
The -type flag is incredibly powerful. While -type f finds normal files and -type d finds directories, -type b restricts the search strictly to block-oriented hardware interfaces. The output will list the primary drives (like sda, nvme0n1) and their partitions (like sda1, sda2), alongside loopback devices (loop0) used by snap packages. This command allows you to programmatically verify exactly what physical storage hardware the Linux kernel has successfully recognized and mapped, completely ignoring the terabytes of actual data stored on those drives.