LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 06-03-2009, 04:23 PM   #1
shadowers
Member
 
Registered: Oct 2008
Posts: 52

Rep: Reputation: 15
Mdadm raid


I have a failed legacy Mdadm raid 1 and need to recover it. One drive has the data still, and the next needs to be added to the array. During the down time I have changed distros to Gentoo. I need to either recreate my legacy array without losing the data on the first drive, or create a superblock array and keep the data in tact.
 
Old 06-03-2009, 05:17 PM   #2
mostlyharmless
Senior Member
 
Registered: Jan 2008
Distribution: Arch/Manjaro, might try Slackware again
Posts: 1,851
Blog Entries: 14

Rep: Reputation: 284Reputation: 284Reputation: 284
Well, I'd imagine that mdadm -B /dev/mdX /dev/device1 missing --level=1 --raid-devices=2 would start your array with the missing drive. You could then mdadm --add /dev/mdX /dev/device2 to rebuild redundancy, or you could copy the data to a new array with superblocks. See man mdadm.
 
Old 06-03-2009, 05:36 PM   #3
shadowers
Member
 
Registered: Oct 2008
Posts: 52

Original Poster
Rep: Reputation: 15
I executed the command and got this:

Code:
mdadm: ADD_NEW_DISK failed for /dev/hdb1: Invalid argument
 
Old 06-03-2009, 05:57 PM   #4
mostlyharmless
Senior Member
 
Registered: Jan 2008
Distribution: Arch/Manjaro, might try Slackware again
Posts: 1,851
Blog Entries: 14

Rep: Reputation: 284Reputation: 284Reputation: 284
Hmm, maybe you can't --add on a legacy array. I presume that it was the second command that gave you an error. You might want to post Exactly what you typed with fdisk -l as well to avoid misunderstanding.

Assuming that's OK, I'd just build a new array, mount both of them and rsync or cp the data over. Something like:
#check the oldarray to make sure it's built and running
mdadm -S /dev/mdX
# mount it
mount /dev/mdX /mnt/oldarray
#make a new array with superblocks somewhere else
mdadm --create /dev/mdY /deviceA /deviceB
#check to make sure it's what you want
mdadm -S /dev/mdY
#mount it
mount /dev/mdY /mnt/newarray
rsync -avH /mnt/oldarray /mnt/newarray

Last edited by mostlyharmless; 06-03-2009 at 05:59 PM. Reason: slight modification
 
Old 06-03-2009, 11:17 PM   #5
shadowers
Member
 
Registered: Oct 2008
Posts: 52

Original Poster
Rep: Reputation: 15
I typed
Code:
mdadm -B /dev/mdX /dev/device1 missing --level=1 --raid-devices=2
It returned

Code:
mdadm: ADD_NEW_DISK failed for /dev/hdb1: Invalid argument
I have the data backed up, and I would have recreated the array a long time ago. Only issue is my dad is wanting me to do everything I can to rebuild it rather than loosing the data on the drives, even though its backed up...
 
Old 06-04-2009, 10:34 AM   #6
mostlyharmless
Senior Member
 
Registered: Jan 2008
Distribution: Arch/Manjaro, might try Slackware again
Posts: 1,851
Blog Entries: 14

Rep: Reputation: 284Reputation: 284Reputation: 284
You mean you typed something like
mdadm -B /dev/md0 /dev/hdb1 missing --level=1 --raid-devices=2
right?
Not something like
mdadm -B /dev/hdb1 /dev/device1 missing --level=1 --raid-devices=2
right?
Just trying to be clear, my syntax was meant as a general example not a specific recipe!
 
Old 06-04-2009, 01:20 PM   #7
shadowers
Member
 
Registered: Oct 2008
Posts: 52

Original Poster
Rep: Reputation: 15
I didnt use the general stuff haha, but I'm working on it. My local Gentoo Guru is helping me =P
 
  


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
Why can't I mount this md0 raid? (mdadm and software raid) cruiserparts Linux - Software 35 01-05-2013 03:35 PM
Dell/Intel ICH7 soft-RAID and mdadm raid-level mistake PhilipTheMouse Linux - General 0 03-14-2009 05:59 PM
Raid whith mdadm leoventura Linux - Software 2 03-07-2009 08:43 AM
RAID mdadm - Sending E-Mails on RAID Failure? rootking Linux - General 1 12-25-2007 03:59 AM
RAID through mdadm rosey Linux - Server 5 04-08-2007 11:57 AM

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

All times are GMT -5. The time now is 06:02 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