Linux - GeneralThis 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
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.
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.
I just built a new system and had intended on running 4 identical drives in raid1+0, but one of the drives was bad, so to get the system up and running while I waited for a replacement, I created a raid0 array with two of the drives. I now have the replacement, and was wondering what the best way was to add the other two drives and migrate to raid1+0.
Conceptually, the two drives currently in a raid0 array just need to be mirrored in individual raid1 arrays - assuming I understand this correctly (I'm new to raid). I'm just not sure how to accomplish this with mdadm.
Well, it's funny you should mention that, because that's how I have my system configured, sort of. So hopefully I can help you.
Just to make sure we're all on the same page, please describe your raid0 setup.
Is it
(1) firmware raid relying on dmraid (usually on the mobo)?
(2) hardware raid seen by Linux as a regular drive?
(3) software raid using mdadm loaded from a separate boot drive?
And, we'll need to know your distro as part of the description, as raid setups vary slightly..
Well, it's funny you should mention that, because that's how I have my system configured, sort of. So hopefully I can help you.
Just to make sure we're all on the same page, please describe your raid0 setup.
Is it
(1) firmware raid relying on dmraid (usually on the mobo)?
(2) hardware raid seen by Linux as a regular drive?
(3) software raid using mdadm loaded from a separate boot drive?
And, we'll need to know your distro as part of the description, as raid setups vary slightly..
Great!
I have both drives partitioned in to three parts. One for /boot, one for swap, and the rest for the root. Each partition is type fd. I have the boot partition in raid1 (which I didn't mention, because I'll just create the same partition structure on the two new drives and add the boot partition to the raid1 array). I have the swap partition in a raid0 array (I don't know what I'm going to do with that space on the two other drives - I didn't properly plan this out, I should have made the partition on each drive 1/4 of my total swap and put them all in to a raid0 array). Then the last partition is in a raid0 array.
I use mdadm with raid support built in to the kernel, here's the grub entry:
Code:
title Gentoo Linux 2.6.30-vanilla
root (hd0,0)
kernel /boot/kernel-2.6.30-vanilla root=/dev/md3
My distro is Gentoo and I'm using a vanilla kernel from kernel.org.
where sda, sdb are your current disk and sdc, sdd are the new disks. Obviously this locks you into your existing choices with your swap partition space sizes for now, but you can always change those partitions later.
BTW, I didn't specify partitions in the above post; you probably need to do that when you make "md4" above. Post your fdisk -l and mdadm -D /dev/md{1,2,3...} if you have problems.
where sda, sdb are your current disk and sdc, sdd are the new disks. Obviously this locks you into your existing choices with your swap partition space sizes for now, but you can always change those partitions later.
where md2 is the name of your previous raid0 array you want mirrored.
Now you should be able to mount md5 rather than md2 as root. Don't forget
mdadm -D --scan >> mdadm.conf (wherever Gentoo keeps it) And add a new Grub entry to try it out. Hope that works...
Thank you very much for the help!
Doesn't this create a raid 0+1 array? A mirrored array consisting of striped arrays? I was looking to create a raid 1+0 array - which I believe is supported as its own level (10) rather than creating the mirrored sets and striped sets separately (I'm not sure if there's a difference there or not), but I could be wrong.
Is there a performance difference between raid 0+1 and 1+0?
I don't think that with your given configuration that you can convert to raid 10; I suppose you could do the above steps and then assemble them this way:
I'm not sure it'll work, and you'd better backup first!
You're right, otherwise you get raid 0+1, which is not quite as nice. If not, just start from scratch with raid10
Last edited by mostlyharmless; 07-17-2009 at 07:03 PM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.