![]() |
Convert RAID 1 system into RAID 1+0
Hi
I am wondering how I can convert my RAID 1 system inte RAID 1+0 (RAID 10). The system has data on it that should NOT be destroyed! I am using software RAID with mdadm now. |
A minimal RAID-1 is typically two drives + spares. A minimal RAID-10 is typically four drives + spares. What do you have to work with, and what drives will you be using to build the new array?
|
what I have
I have 2 SATA-II disks that are used in the RAID-1 and 2 unused disks (same model). The chassi doesn't have room for more than 4 disks, so thats the limit.
|
OK, I'll assume your existing RAID-1 is /dev/md0, composed of /dev/sda and /dev/sdb. The unused drives I'll call /dev/sdc and /dev/sdd. The process is:
- Create a new RAID-1, /dev/md1, with the two unused disks. mknod /dev/md1 b 9 1 mdadm --create /dev/md1 --level=1 --raid-devices=2 /dev/sd[cd] mke2fs -j /dev/md1 - Split the original RAID-1, /dev/md0, by failing and removing one of the drives. mdadm /dev/md0 --fail /dev/sdb --remove /dev/sdb - Create the RAID-10 (RAID-0 of the RAID-1 arrays) /dev/md2: mknod /dev/md2 b 9 2 mdadm --create /dev/md2 --level=0 --raid-devices=2 /dev/md[01] - Initialize the RAID-10 array (your data is safe on the split drive, /dev/sdb): mke2fs -j /dev/md2 - Mount the new RAID-10: mkdir mount1 mount -t ext3 /dev/md2 mount1/ - Mount the drive split off from the original RAID-1 (/dev/sdb): mkdir mount2 mount -t ext3 /dev/sdb mount2/ - Copy the data from the split drive (/dev/sdb) to the RAID-10: rsync -avHxl --progress --inplace --exclude 'lost+found' mount2/ mount1/ - Re-add the drive that was split from the original RAID-1 (/dev/sdb): umount mount1 umount mount2 mdadm /dev/md0 --re-add /dev/sdb - Done! At each step you have your data safe. Don't proceed to the next step unless you have confirmed data integrity from the previous step. |
Hi there! That's a very concise recipe you've supplied, macemoneta. Thanks!
However, I have a situation in which I don't think I can use your approach, or perhaps it may indeed be able to be used, but because I don't properly understand what's going on, I'm left wondering how I'd be able to apply it to my case. What if the existing RAID-1 device, composed of /dev/sda2 and /dev/sdb2, is where /root, /usr, /var, /proc, /swap, /lib... and all the system files are residing? How can one create the RAID-10 device (which would be RAID-0 of the RAID-1 arrays) without killing your system in the process? I understand that you must first split the original RAID-1, /dev/md0, by failing and removing one of the drives, but wouldn't you still bring your system down in the process of striping /dev/md0 and /dev/md1? The striping destroys your data, and even though you have a healthy copy of all the files and data, you wouldn't then be able to boot into it to resume the operation. Again, I probably have not understood what you're suggesting, so I'd really appreciate you shedding some more light on the topic. Thanks in advance for your elucidations. |
4 = drives but slight diff in size
NEVER MIND... it's always more obvious when you re-read AFTER saving.... the one mirror is sdb & sdc... the other is sde1 & sdd1!
DELETE ME! |
can't format /dev/md2
Code:
sudo mkfs.ext3 /dev/md2Code:
cat /proc/mdstatsda is the Ubuntu v8.10(Dotsch/UX) OS drive and is not involved. md0 is normally mounted and has been running w/o problems for weeks. md0 is normally comprised of /dev/sdb and /dev/sdc. I have md0 and md1 in /etc/mdadm/mdadm.conf: Code:
# by default, scan all partitions (/proc/partitions) for MD superblocks.Code:
Disk /dev/sdb: 40.0 GB, 40000000000 bytesNote that mdadm detailed scan doesn't see a /dev/md2 but I have done these: Code:
sudo mknod /dev/md2 b 9 2Code:
sudo mdadm -DsCode:
udo mdadm -vv --examine --scan /dev/md2PS: Actually I'm tempted to try and tar off md0 and really start from ground 0 with all 4 drives just to make sure I get it down and get them all exactly the same... but that may be overkill. |
On the off chance....
That somebody someday reads this thread and happens into some of my same questions... Here's what I found out so far (and you'll notice any commands shown have been ubuntuized):
Quote:
The md1 devices were each formatted prior to building the array with fdisk as detailed here: Quote:
Quote:
Code:
sudo mdadm -S /dev/md1Since I had the GUI up I went ahead and used Gparted (System->Parition Editior in Ubuntu) and deleted sdd1 and sdde1 leaving essentially bare metal drives. OK, Now with sdd and sde void of any partitions I redid the mdadm create as described above (I didn't redo the mknod). The array md1 started and began sync'ing. While it was still sync'ing I decided to see if the suggestion that you can format during that process would work so went ahead and did: Code:
sudo mkfs.ext3 /dev/md1Code:
sudo head /proc/mdstatCode:
sudo fdisk -lI'll add anything of possible value here once I get md2 built. |
Similar situation
Hi guys
My situation is fairly similar, except I already have md0 & md1 on each of the first two existing drives. They consist of sdb1 (swap) and sdb2 (/) each and the same on sdc1 and sdc2. This is currently Raid 1. To follow the guide earlier published, can anyone tell me how to go about this procedure to drives 3 & 4 to make the new RAID 10 configuration?? Would appreciate any help. Mike |
| All times are GMT -5. The time now is 02:16 PM. |