You are not logged in.
Pages: 1
Is there a way, given some /dev/sdX, to tell whether the device refers to a "real" disk or something as brittle as a USB flash memory stick / sd card / that kind of thing?
I found /sys/dev/block/*/removable, which apparently is a boolean describing whether the device is removable, which is close, but it still wouldn't allow me to tell whether it is a USB disk drive, for example, or an SD Card.
Offline
Offline
Thanks jasonwryan: maybe that's the best we can do. The look-for-usb-in-path trick is cute, but I still can't tell usb hard drive from sd card.
Offline
Udev info is certainly your best bet. If that's not possible, maybe the SCSI subsystem* has enough info to uniquely identify the device.
* See the contents of /proc/scsi/scsi for an idea of the info it makes available.
But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner
Offline
Pages: 1