[CentOS] Identifying physical disks

Tue May 3 19:05:02 UTC 2011
Andy Holt <centos-list at orgdotuk.org.uk>

> -----Original Message-----
> From: centos-bounces at centos.org On Behalf Of Jussi Hirvi
> Sent: 30/04/2011 10:31
> To: CentOS mailing list
> Subject: [CentOS] Identifying physical disks
> 
> I am sure this is really simple.
> 
> I have a setup of 2 disks (sda, sdb) which are outwardly 
> identical, and 
> are mirrors of each other. Together they form 3 raid1 devices. Both 
> disks can boot.
> 
> Now sda has bad sectors, and I should replace it. But which 
> one of the 
> physical disks is sda??
> 
> The machine boots fine from either one of the disks, (and the booting 
> disk of course is always called sda).
> 
> In the messages log I see entries like this:
> 
> Apr 29 02:21:07 a134-224 kernel: ata2: SATA link up 3.0 Gbps (SStatus 
> 123 SControl 300)
> 
> By noticing which SATA link (ata1, ata2) is up and which is 
> down, I can 
> find out which physical disk is connected to ata1 and which to ata2.
> 
> If both disks are connected, will the hd in ata1 become sda, 
> and the hd 
> in ata2 become sdb??
> 
> - Jussi

How about:

ls -l /dev/disk/by-id

which on my system gives me:

lrwxrwxrwx 1 root root  9 Mar  6 14:34 scsi-SATA_SAMSUNG_HD154UIS1XWJ1BZ900317 -> ../../sdc
lrwxrwxrwx 1 root root  9 Mar  6 14:34 scsi-SATA_SAMSUNG_HD154UIS1XWJ1BZ900318 -> ../../sdb
lrwxrwxrwx 1 root root  9 Mar  6 14:34 scsi-SATA_SAMSUNG_HD154UIS1XWJ9CZA00454 -> ../../sdd

which are my three identical Samsung HD154UI disks.  Their serial numbers are the S1XWJ... bits at the end.

hth  Andy