Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

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

I've got a couple WD 1TB drives in my computer and I want to give them labels. Right now, I've two identical disks (save logical size, no partitions, yet different content). I want to give them the right label, but I can't tell which is /dev/sdb and which is /dev/sdc

share|improve this question
up vote 3 down vote accepted

One way would be to do df -mh. I'm assuming here that, as they have different content, there are a different number of bytes on the drives. You'll see something like this printed:

Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1             272G  195G   64G  76% /
none                  2.0G  280K  2.0G   1% /dev
none                  2.0G  984K  2.0G   1% /dev/shm
none                  2.0G  772K  2.0G   1% /var/run
none                  2.0G     0  2.0G   0% /var/lock
none                  272G  195G   64G  76% /var/lib/ureadahead/debugfs
/dev/sdb1             587G  490G   92G  85% /media/data

From this you'll be able to infer which is /dev/sdb and which is /dev/sdc.

share|improve this answer
    
Perfect thanks, I'll accept this is 4 minutes when I can. – n0pe Apr 24 '11 at 21:01
    
No problem at all. :) – boehj Apr 24 '11 at 21:04

hdparm -i /dev/sdX will let you read the serial number, which you can then compare with the physical label on the drive.

share|improve this answer
    
Good answer, and the most direct one, but the one above is more practical (don't need to open the case). – n0pe Apr 24 '11 at 21:00
    
You can also list /dev/disk/by-id/ directory to see serials. It could be faster than running hdparm or smartctl for every disk – Cougar Nov 19 '11 at 21:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .