Thursday, 11 October 2012

How do I find out what hard disks are in the system?

On modern udev installations,here are symbolic links to storage media in subdirectories of/dev/disk, that let you look up a disk or a partition by serial number (/dev/disk/by-id/), by UUID (/dev/disk/by-uuid), by filesystem label (/dev/disk/by-label/) or by hardware connectivity (/dev/disk/by-path/).

[sankar@new-host ~]$ cd /dev/disk
[sankar@new-host disk]$ ls
[sankar@new-host disk]$

Under Linux 2.6, each disk and disk-like device has an entry undr /sys/block.
disks and partitions are listed in /proc/partitions
Alternatively, you can use lshw:lshw -class disk.(lshw - list hardware)

lshw -class disk -class storage command . it will show detailed information on disk configuration. you will get the vendor,type of disk etc all information.
cat /proc/scsi/scsi and parted --list shows the RAID controller.

# lshw -class disk
       description: SCSI Disk
       product: 9650SE-4LP DISK
       vendor: AMCC
       physical id: 0.0.0
       bus info: scsi@0:0.0.0
       logical name: /dev/sda

# cat /proc/scsi/scsi 
Attached devices:
Host: scsi0 Channel: 00 Id: 00 Lun: 00
  Vendor: AMCC     Model: 9650SE-4LP DISK  Rev: 4.06
  Type:   Direct-Access                    ANSI SCSI revision: 05

# parted --list

Model: AMCC 9650SE-4LP DISK (scsi)
Disk /dev/sda: 2000GB

No comments:

Post a Comment