查找连接到一台Linux机器的所有存储设备 [英] Find all storage devices attached to a Linux machine

查看:149
本文介绍了查找连接到一台Linux机器的所有存储设备的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有必要找到所有连接到给定的机器的可写存储装置,的是否它们安装

I have a need to find all of the writable storage devices attached to a given machine, whether or not they are mounted.

在迷迷糊糊的方式做这将是的尝试的在的/ dev 每个条目对应于写设备( *高清和标清* )......

The dopey way to do this would be to try every entry in /dev that corresponds to a writable devices (hd* and sd*)......

有没有更好的解决办法,还是应该坚持这个吗?

Is there a better solution, or should I stick with this one?

推荐答案

的/ proc /分区将列出所有块设备和系统能够识别的分区。然后,您可以尝试使用文件-s<装置> 来确定什么样的文件系统是该分区上的present,如果任何

/proc/partitions will list all the block devices and partitions that the system recognizes. You can then try using file -s <device> to determine what kind of filesystem is present on the partition, if any.

这篇关于查找连接到一台Linux机器的所有存储设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆