Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Suppose in a linux machine you have both SATA and USB devices present, and if they are all detected properly, how do you know whether a specific device(sda1/ sdb1) is USB device OR SATA device. Note: devices needs to be manually mounted. Note: dmesg is cleared already. we cannot use /var/log/messages as that too is cleared.

Question is : Is there other way, say from /proc or any other command by which we know that the specific device(sda1/sdb1) is SATA OR USB ?


share|improve this question

You can get that information from /sys virtual file system.

Run find /sys -name \*sd[ab]\*. Some of the lines from my station are:


There is "usb" in the line with sdb, there's none in the line with sda, so the USB drive is sdb.

Another piece of information that you can get is from

cat /sys/class/block/sda/removable
cat /sys/class/block/sdb/removable

files. If file's contents is 0, then the device isn't removable, so it cannot be an external USB drive. Some SATA drives report themselves as removable, so it may not be definitive.

share|improve this answer
Thanks! Also I find this useful: /dev/disk/by-id/XXX-usb . Here XXX-USB links to the device(sda/sdb) – kumar May 18 '11 at 15:49
It is under /proc directory – kumar May 18 '11 at 15:54

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.