LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-30-2009, 01:12 AM   #1
anoneironaut
LQ Newbie
 
Registered: May 2009
Posts: 5

Rep: Reputation: 0
Programatically determine if device is in RAID array


Hey all,

I'm writing a bash script that needs to know whether or not a device node is part of a RAID array. I'm just curious if anyone knows of a good way to determine if a device node is in a RAID array. I know that you can run mdadm -Q or mdadm --examine on the device node and that will tell you. But I don't want to rely on screen scrapping and would rather have something that would return a boolean. Any ideas?

-Anon
 
Old 10-30-2009, 06:50 PM   #2
ShadowCat8
Member
 
Registered: Nov 2004
Location: San Bernardino, CA
Distribution: Gentoo, Arch, (RedHat4.x-9.x, FedoraCore 1.x-4.x, Debian Potato-Sarge, LFS 6.0, etc.)
Posts: 260

Rep: Reputation: 52
Well,

To start with, is this for just one of your boxes, or is this going to be for software that is going out to end-users with 'gawd-knows-what' running on their system?

Quote:
Originally Posted by anoneironaut
I know that you can run mdadm -Q or mdadm --examine on the device node and that will tell you.
Well, if you were running from a hardware RAID, it might not tell you. To tell what is going on with a 3Ware card, you need to use their tw_cli or 3dm2 interfaces.

I would think that if you are definitely looking for a local software RAID that was set up with mdadm, you may want to see what is created under /sys for the drive/filesystem after setting up a RAID with mdadm and try to key on that.

HTH.
 
Old 11-02-2009, 02:37 PM   #3
anoneironaut
LQ Newbie
 
Registered: May 2009
Posts: 5

Original Poster
Rep: Reputation: 0
This only needs to run on RHEL4. Its always going to be software RAID. I'll take a look through those.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Method to determine if a device is a usb device (RHEL5 / RHEL6) mholden64 Linux - Kernel 4 08-15-2009 07:45 PM
how to programatically determine if hyperthreading is enabled in linux kernel shawshank_blr Linux - Kernel 2 07-03-2009 07:14 AM
How to detect programatically if a USB device is is plugged-in / plugged out? franc Linux - Software 3 02-01-2007 04:01 AM
How to determine major, minor programatically markjuggles Programming 1 04-15-2005 01:09 PM
software raid - add device wrongly marked faulty back into array? snoozy Linux - General 2 06-27-2003 02:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration