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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
06-03-2009, 04:23 PM
|
#1
|
Member
Registered: Oct 2008
Posts: 52
Rep:
|
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.
|
|
|
06-03-2009, 05:17 PM
|
#2
|
Senior Member
Registered: Jan 2008
Distribution: Arch/Manjaro, might try Slackware again
Posts: 1,851
|
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.
|
|
|
06-03-2009, 05:36 PM
|
#3
|
Member
Registered: Oct 2008
Posts: 52
Original Poster
Rep:
|
I executed the command and got this:
Code:
mdadm: ADD_NEW_DISK failed for /dev/hdb1: Invalid argument
|
|
|
06-03-2009, 05:57 PM
|
#4
|
Senior Member
Registered: Jan 2008
Distribution: Arch/Manjaro, might try Slackware again
Posts: 1,851
|
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
|
|
|
06-03-2009, 11:17 PM
|
#5
|
Member
Registered: Oct 2008
Posts: 52
Original Poster
Rep:
|
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...
|
|
|
06-04-2009, 10:34 AM
|
#6
|
Senior Member
Registered: Jan 2008
Distribution: Arch/Manjaro, might try Slackware again
Posts: 1,851
|
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!
|
|
|
06-04-2009, 01:20 PM
|
#7
|
Member
Registered: Oct 2008
Posts: 52
Original Poster
Rep:
|
I didnt use the general stuff haha, but I'm working on it. My local Gentoo Guru is helping me =P
|
|
|
All times are GMT -5. The time now is 06:02 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|