How to Find disk SCSI ID on Linux

Updated: Feb 2

On Linux disk SCSI ID uniquely identifies each SCSI device on the SCSI bus. A unique SCSI ID is generated when a scsi disk is added to Linux system.


SCSI ID can be used for representing a disk in the configuration file because the disk name like sda sdb sdc may change after server reboot. The scsi id will be not changed and reboot persistent.


Get disk scsi id on Linux

we can use two methods to get the disk scsi id.

# lsscsi --scsi_id

[0:0:0:0] disk DGC RAID 10 0430 /dev/sda 360060160c0002900d6a0d8cd4a14eb11

[0:0:0:1] disk DGC RAID 5 0430 /dev/sdb 360060160c000290046fe939f4a14eb11

[0:0:0:2] disk DGC RAID 5 0430 /dev/sdd 360060160c0002900b24cf4b64a14eb11

[0:0:0:3] disk DGC RAID 10 0430 /dev/sdp 360060160c0002900b272c3a9a229eb11

[0:0:1:0] disk DGC RAID 10 0430 /dev/sdf 360060160c0002900d6a0d8cd4a14eb11


# /usr/lib/udev/scsi_id -g -u -d /dev/sda

360060160c0002900d6a0d8cd4a14eb11


Understanding Disk SCSI ID on Linux

A disk usually has more than one name in a multipath environment. For the example below, this disk has four names sdd,sdj,sdg,sdl because of four paths. The scsi id is same for four disks.


# lsscsi --scsi_id|grep 360060160c0002900b24cf4b64a14eb11

[0:0:0:2] disk DGC RAID 5 0430 /dev/sdd 360060160c0002900b24cf4b64a14eb11

[0:0:1:2] disk DGC RAID 5 0430 /dev/sdj 360060160c0002900b24cf4b64a14eb11

[5:0:0:2] disk DGC RAID 5 0430 /dev/sdg 360060160c0002900b24cf4b64a14eb11

[5:0:1:2] disk DGC RAID 5 0430 /dev/sdl 360060160c0002900b24cf4b64a14eb11

Related Post:

15 Linux multipath examples for Linux Beginners first part

148 views

Join our mail group. Get a free Linux account on Cloud.

Never miss a post!

Want a free Linux account?  This account can be used to login to our cloud server and practice Linux commands.

 
kamateravps.gif
topbackgroud.png

✔ Linux Commands   ✔ Linux Skills    ✔ LinuxPerformance   ✔ Linux Interview

Some articles are from the public internet. If you find your article misused or undesired here and you don't want us to display it, please let us know and we'll remove it immediately.