My company has inherited a Centos based machine that has 7 hard drives and a software based raid system. Supposedly one of the drives has failed. I need to replace the hardrive.
How can I about telling which hard drive needs replacing? I have looked in the logs and there clearly is a problem there is no way I can tell which physical drive seems to have a problem. Advice?
Linux software RAID is usually managed through the mdadm tool. To see the status of the drives enter (replace /dev/md0 with the path to your actual RAID)
In your case, /dev/md0 is the software RAID device. It's a RAID1 without any errors, using 2 devices, neither of them degraded or with errors. But none of the 2 is a physical device, but they are logical devices inside LVM volume groups. Which physical devices belong to it you'll see by checking the output of vgdisplay.
From my point of view, it's been set up exactly the wrong way around. If a device fails, you'll have to rescue the volume group and logical devices before you'll be able to rescue the RAID. Also, any data not in the RAID will probably be lost, or at least will have to be restored from backup.
Usually, you create a RAID (in hard- or software), on top of which you create logical devices. That way, if a drive fails it's easy to replace, and the LVM won't even notice a part of it went missing for a while.
I do not see which physical groups they belong to after I run vgdisplay:
--- Volume group ---
VG Name VolGroup00
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 3
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 2
Max PV 0
Cur PV 1
Act PV 1
VG Size 18.53 GB
PE Size 32.00 MB
Total PE 593
Alloc PE / Size 593 / 18.53 GB
Free PE / Size 0 / 0
VG UUID w7Ta2Z-Dx90-jg8v-28ZS-XT2x-zal6-Z7q3r1
--- Volume group ---
VG Name VolGroup_a
System ID
Format lvm2
Metadata Areas 3
Metadata Sequence No 6
VG Access read/write
VG Status resizable
MAX LV 256
Cur LV 1
Open LV 1
Max PV 256
Cur PV 3
Act PV 3
VG Size 460.95 GB
PE Size 4.00 MB
Total PE 118004
Alloc PE / Size 118004 / 460.95 GB
Free PE / Size 0 / 0
VG UUID ql9Zv1-wqXJ-4lPb-mmsM-lyaf-Bj10-rJGU1s
--- Volume group ---
VG Name VolGroup_b
System ID
Format lvm2
Metadata Areas 3
Metadata Sequence No 6
VG Access read/write
VG Status resizable
MAX LV 256
Cur LV 1
Open LV 1
Max PV 256
Cur PV 3
Act PV 3
VG Size 460.95 GB
PE Size 4.00 MB
Total PE 118002
Alloc PE / Size 118002 / 460.95 GB
Free PE / Size 0 / 0
VG UUID RcIQpm-krvC-i3LD-eDQs-00Zy-mHoj-KChH9D