Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

So I have a server that has a few harddrives in it, all formatted and mounted. However I'm told there is another drive attached to it. How do I find out what drives are attached? How do I find out the device filename for this new drive (that's not mounted)

share|improve this question

4 Answers 4

up vote 8 down vote accepted

fdisk -l

Plus mandatory extra characters...

share|improve this answer
1  
What "mandatory extra characters"? Just fdisk -l will list all devices mentioned in /proc/partitions, which is just what's needed in this case. –  sleske Dec 16 '09 at 11:26
8  
sorry, serverfault.com doesn't accept answers with less that 15 characters, so sometimes, when you have a very short but appropriate answer you have to add padding before you can click ok :) –  Chopper3 Dec 16 '09 at 11:30

The sg_* utilities might also be useful:

$ sudo sg_map -i
/dev/sg0  /dev/sda  ATA       WDC WD5000BEVT-2  01.0
/dev/sg1  /dev/scd0  Optiarc   BD ROM BC-5500S   1.83
/dev/sg2  /dev/sdb  ATA       WDC WD5000BEVT-0  01.0
/dev/sg3  /dev/sdc  WD        PP III Studio II  0817

There are lots of other commands in the sg utilities such as sg_scan, sg_readcap and so on.

Also if you are booted from a redhat/centos cd you can switch to an alternate console and use the "list-harddrives" command to show disks attached to the system.

share|improve this answer

fdisk -l

dmesg

/var/log/message..

share|improve this answer

Depends on how the drive is attached.

ATA/SATA drives should normally be detected on bootup. Look into the boot log (/var/log/syslog, /var/log/messages, output of dmesg).

There should also be a list of recognized partitions for all partitioned drives under /proc/partitions.

For hotplugged drives (e.g. USB) it depends on how the distribution manages them. Usually modern distros use udev (older might use hotplug or hald). The log is configurable, either a separate log under /var/log, or in the general log messages or syslog).

share|improve this answer

Your Answer

 
discard

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.