[CentOS] info about hdds in raid

Tue Nov 3 00:54:30 UTC 2009
Robert Heller <heller at deepsoft.com>

At Mon, 2 Nov 2009 14:47:23 -0800 (PST) CentOS mailing list <centos at centos.org> wrote:

> 
> 
> 
> How can I tell wich HDD to swap, when the "cat /proc/mdstat" says one
> HDD of the RAID1 array has died?

Use '/sbin/mdadm --detail /dev/md<mumble>' and note the drive name
(/dev/sd<mumble> for SCSI or SATA, and /dev/hd<mumble> for IDE).

Then '/usr/sbin/smartctl -A <drive name from mdadm's listing>'

/usr/sbin/smartctl will give you lots of information.  Near the
beginning is the serial number.

You *should* be running smartd and you *should* be enabling all of your
disks to be monitored with smartd.

> 
> 
> 
> Does the HDD's has some serial numbers, that I can see in "reality",
> and I can get that number from e.g.: a commands output?

Yes.  smartctl will list the disk's info, including serial number.

> 
> 
> 
> How could I know wich HDD to swap in e.g.: a RAID1 array?

Presumably, you know which disk is connected to which controller port. 
mdadm will give you the name assigned by the O/S.  For IDE this would be

/dev/hda -- primary master
/dev/hdb -- primary slave
/dev/hdc -- secondary master
/dev/hdd -- secondary slave

for SCSI, the disks get a letter a, b, c, d, etc. on a 'first come first
served' basis: disks are scaned in controller order, in id order:
controller 0, disk 0, disk 1, disk 2 ... controller 1, disk 0, disk 1
..

ahci SATA treats each SATA port as a separate 'controller', with only
one device (0) and the ports are scanned in order.

Some SATA controllers can be (are) set up to behave like IDE (PATA)
disks, this maps a pair of SATA ports as a master and slave pair of
'IDE' (PATA) disks.  This can make things 'interesting'.  The Dell
PowerEdge 840 is like that.  With the SCSI-layer Linux drive, the
mapping becomes (when all four are in use):

Port 0: (primary master)	/dev/sda
Port 1: (secondary master)	/dev/sdc
Port 2: (primary slave)		/dev/sdb
Port 3: (secondary slave)	/dev/sdd

Letters are assigned in the order port 0, port 2, port 1, port 3, with
unoccupied ports being skipped.

> 
> 
> 
> thank you
> 
> 
> 
> 
>       
> MIME-Version: 1.0
> 
> _______________________________________________
> CentOS mailing list
> CentOS at centos.org
> http://lists.centos.org/mailman/listinfo/centos
> 
>       

-- 
Robert Heller             -- 978-544-6933
Deepwoods Software        -- Download the Model Railroad System
http://www.deepsoft.com/  -- Binaries for Linux and MS-Windows
heller at deepsoft.com       -- http://www.deepsoft.com/ModelRailroadSystem/