Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我希望能够使用 C/C++ 或 bash 脚本在 Linux 中确定驱动器/设备的类型(CDROM、软盘、固定硬盘驱动器、可移动驱动器等)。
我将获得一个挂载点路径,并且我需要显示该挂载点的源驱动器类型。
拥有设备节点本身后,您可以查看/sys/block或/sys/dev/block查看其各种特征。
/sys/block
/sys/dev/block