LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices



Reply
 
Search this Thread
Old 04-25-2006, 07:49 AM   #1
keith ralph
LQ Newbie
 
Registered: Apr 2006
Posts: 5

Rep: Reputation: 0
RAID - mdadm.conf


Hi - I have a configuration issue with mdadm RAID1
I have 4 LUNS - sda/sdb on 1 path and sdc/sdd on 2nd path
I have /dev/sda mirrored to /dev/sdc and sdb mirrored to sdd.On a reboot mdadm seems to establish the mirrors starting at sdd then sdc then sdb then sda. I want to force sda to be the primary disc and resync with sdc.
I have expilictly updated /etc/mdadm.conf so that theree is no DEVICE=partitions ie


ARRAY /dev/md1 level=raid1 num-devices=2 UUID=8ca1bd25:449a5a09:9aab01a9:ca68cbfa
devices=/dev/sda2
ARRAY /dev/md2 level=raid1 num-devices=2 UUID=1af61e1f:5e49f5ab:39b62b46:626daaea
devices=/dev/sdb1
ARRAY /dev/md0 level=raid1 num-devices=2 UUID=25889e7a:e6f01deb:b9487c5a:06fd043d
devices=/dev/sda1

but it still forms the array from /dev/sdc

Any help much appreciated
 
Old 04-26-2006, 01:22 AM   #2
WhatsHisName
Senior Member
 
Registered: Oct 2003
Location: /earth/usa/nj (UTC-5)
Distribution: RHL9;F1-10; CentOS4-5; DebianSarge-Squeeze
Posts: 1,151

Rep: Reputation: 46
Donít think you can change the member device order without recreating the raids.

Or said another way, you would need to stop each raid and recreate it with member devices in the desired order. Be sure to backup everything first.

Also, mdadm.conf isnít used to create or manage the raids. Itís more there to tell the OS what to expect. mdadm-based raids are self sufficient and are not OS dependent.
 
Old 05-03-2006, 10:42 AM   #3
keith ralph
LQ Newbie
 
Registered: Apr 2006
Posts: 5

Original Poster
Rep: Reputation: 0
I'm not sure how I stop the raid and recreate it in the right order - looking at /var/log/messages it seems to interogate sdd first then sdc then b then a.

Thanks whatsyourname :-)
 
Old 05-03-2006, 11:53 AM   #4
WhatsHisName
Senior Member
 
Registered: Oct 2003
Location: /earth/usa/nj (UTC-5)
Distribution: RHL9;F1-10; CentOS4-5; DebianSarge-Squeeze
Posts: 1,151

Rep: Reputation: 46
Everything listed below can be found in the (incredibly long) mdadm man page.

Don’t blindly use the following commands. Be sure you understand what they do before you proceed.

With md1 and md2 unmounted:

Code:
# # Verify that md1 and md2 are synced and clean
#
# mdadm -D /dev/md1   # OR “cat /proc/mdstat”
# e2fsck -f /dev/md1  # OR fsck whatever type of filesystem you are using
#
# # Stop and recreate raid1
#
# mdadm -S /dev/md1
# mdadm -C /dev/md1 -l1 -n2 /dev/sda1 missing
# e2fsck -f /dev/md1  # OR fsck whatever type of filesystem you are using
#
# #  Then mount md1 and verify that the contents look OK.
# #  If md1 looks fine, then:
#
# mdadm /dev/md1 -a /dev/sdc1
# cat /proc/mdstat
#
# #  If md1 does not look correct, then unmount it and:
#
# mdadm -S /dev/md1
# mdadm -A --run /dev/md1 /dev/sdc1
# e2fsck -f /dev/md1  # OR fsck whatever type of filesystem you are using
# mdadm /dev/md1 -a /dev/sda1
# cat /proc/mdstat
And likewise for md2 after md1 is rebuilt.

As a warning, I don’t recall doing this on a real filesystem, but since the partitions are already set up for software raid1, the recreation should work fine. As always, be sure to back up everything before you start.

Last edited by WhatsHisName; 05-03-2006 at 12:39 PM.
 
Old 05-05-2006, 10:10 AM   #5
keith ralph
LQ Newbie
 
Registered: Apr 2006
Posts: 5

Original Poster
Rep: Reputation: 0
Thanks for your help - I'll give it a try
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why can't I mount this md0 raid? (mdadm and software raid) cruiserparts Linux - Software 35 01-05-2013 04:35 PM
Linux Software RAID 1+0 (using mdadm) barrulus Fedora 2 02-07-2006 10:21 AM
Linux raid with mdadm eyt Linux - Newbie 6 02-07-2006 06:26 AM
Mdadm Raid question stefaandk Linux - General 12 08-16-2005 03:11 AM
Mailing with MDADM RAID rootking Linux - Hardware 1 07-26-2005 05:47 PM


All times are GMT -5. The time now is 01:46 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration