How to identify a faulty raid drive?

drag

Elite Member
Jul 4, 2002
8,708
0
0
hdparm -i /dev/hda

This will tell you the serial number of the drive in question.

Especially if your using Linux software raid it's very important to identify and correctly label the drives in question. This will make it possible to migrate the drive array from one machine to another in case of something like a motherboard failure.

Otherwise if your using proper hardware raid setup you can just look at the lights on the front of the case. :p

Otherwise it's possible find more information about drives in a few other ways.
 

Netopia

Diamond Member
Oct 9, 1999
4,793
4
81
How about:

less /proc/mdstat

Then you'll know which drive by linux designation (hda, sdc ... whatever) and can then use drag's command to get the specific one?

Joe
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
How about:

less /proc/mdstat

Then you'll know which drive by linux designation (hda, sdc ... whatever) and can then use drag's command to get the specific one?

But technically /dev/hda could point to anything since those designations are handed out first come first serve so all you have to do is switch around the module loading order (which can happen on it's own at bootup since udev loads them all asynch) and poof your drives have switched names.
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
Stuff like this makes me wish that distributions would start using Udev's ability to uniquely identify hardware and make intelligent dev labels.

first-come-first-serve on device naming was the old way, udev is designed to fix that but nobody is using it! Just goes to show how ingrained tradition is in Linux I suppose.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
The real names (i.e. /dev/sda, /dev/hda) are still first-come-first-serve with udev because it can't rename block devices, all of the extra stuff in /dev/disk/* is just symlinks.
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
No, you can give intellegent names to block devices the first time you make them. Udev makes all of them on the fly.

Instead of /dev/hda you can have /dev/disk/WD-WMAMY1530024 (serial number for my drive) or whatever you want. Then have /dev/hda be a symbolic link to that.

If you make local udev rules you have to then update the initrd image so that any rules you make will happen when it first boots up. local rules get copied to the initrd, too.

Udev is just setup to emulate the old stuff because it's what users expect and what programs I expect, I suppose.

It's the same thing with upstart init stuff in Ubuntu. Using upstart you should be able to do all sorts of cool stuff...

For example if you have your laptop and your running Samba to share out your home directory while your at home you should be able to set it up so that when network-manager is trolling around for new wireless networks that Samba is shutdown by default unless you connect to your home network.. then it'll start up automaticly.

but nobody does that yet since all Ubuntu has done so far is make it emulate the old sysv init style.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
No, you can give intellegent names to block devices the first time you make them. Udev makes all of them on the fly.

Instead of /dev/hda you can have /dev/disk/WD-WMAMY1530024 (serial number for my drive) or whatever you want. Then have /dev/hda be a symbolic link to that.

Sure, you can mknod the device to be whatever filename you want but then it won't match up to the device name in any of the kernel logs.