3

In some cases when we are not near the HW Linux machine, we are only able to see disks as the following:

/dev/sdd                  20511312   199536  20295392   1% /grd/sdd
/dev/sdb                  20511312   487852  20007076   3% /grd/sdb
/dev/sde                  20511312    91572  20403356   1% /grd/sde
/dev/sdf                  20511312    45192  20449736   1% /grd/sdf

but do not get the info if the disks are in the HW machine or come from an external JBOD.

How to know where are the disks located? Maybe by dmidecode or something else?

U880D
  • 1,120
  • 10
  • 24
yael
  • 12,598
  • 51
  • 169
  • 303

1 Answers1

3

You can try hdparm -i {device}, like:

# hdparm -i /dev/sda

/dev/sda:

 Model=SAMSUNG MZ7TD512HAGM-000L1, FwRev=DXT05L0Q, 
SerialNo=S151NYADA01701
 Config={ Fixed }
 RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=0
 BuffType=unknown, BuffSize=unknown, MaxMultSect=16, MultSect=16
 CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=1000215216
 IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}
 PIO modes:  pio0 pio1 pio2 pio3 pio4 
 DMA modes:  mdma0 mdma1 mdma2 
 UDMA modes: udma0 udma1 udma2 udma3 udma4 udma5 *udma6 
 AdvancedPM=no WriteCache=enabled
 Drive conforms to: unknown:  ATA/ATAPI-2,3,4,5,6,7

 * signifies the current active mode

The above is correct output for standard disk drive. I believe it should fail for virtual disks, like JBOD or RAID. Then it displays something like:

# hdparm -i /dev/sdb

/dev/sdb:
SG_IO: bad/missing sense data, sb[]:  70 00 05 00 00 00 00 0a 00 00 00 00 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 HDIO_GET_IDENTITY failed: Invalid argument

However if your local disks are also of RAID type provided by some HW controller, the hdparm isn't much usefull. Then you may try the udevadm:

udevadm info -a -p  $(udevadm info -q path -n /dev/sdb)

The output of it is quite long, so I won't paste it here all, but there is enough information to distinguish types of sdX devices on your node, when you compare outputs.

Jaroslav Kucera
  • 9,422
  • 5
  • 15
  • 28