Software RAID

Hi There,

I used a hardware raid controller but my new acer mobo doesn’t seem to play with it and instead just shows me two disks (instead of one RAID1 array).
Anyways, I thought I could make it play by just assigning these two disks into a software RAID. But now, how can I (can I do this at all) create a RAID1 array id there’s data on the disks already i don’t want to lose?

Thanks,
Ron

I would also like to know the answer to this one. I’m thinking of going RAID-0 on my system.

Before you start messing with your hard drives, you should get your data safely backed up somewhere.

I’m not aware of any way to convert in-situ to RAID-1 since that involves reformatting the partitions.

It’s been years since I worked with this and my memory is probably faulty (and @ken_yap may very well know better) . . . having said that, I thought that in the past I had created an array with an existing drive, added a second, and then used the “resync” option to synchronize the second to the first. Take a look at the mdadm man page and do some googling. It would of course be easier to create the array, reformat it, and copy the data from a backup source.

This is entirely different. RAID-0 is striping, so blocks are distributed between the 2 disks. The array needs to be created and copied to thereafter. While I use RAID-0, I only do so with a mirror behind it.

Of course but since the RAID array already needs two disks…i would need to get a third large one in order to get all the data backed up…but since the price of 1TB disks is coming down as well. I probably should consider buying one and start with an empty array… or i’ll do some googling first i think :slight_smile:
Thanks anyways! :slight_smile:

cheers,
Ron

Any clue if this would work?:

Create a RAID-1 volume from two drives.

 mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sdc /dev/sde

To add RAID device md0 to /etc/mdadm.conf so that it is recognized the next time you boot.

mdadm -Es | grep md0  >>/etc/mdadm.conf

View the status of a multi disk array.

 mdadm --detail /dev/md0

View the status of all multi disk arrays.

 cat /proc/mdstat

But the problem is, when it’s resyncing i don’t know if it’s taking data from /dev/sdc or /dev/sde (in this example)

from: mdadm - Wikipedia, the free encyclopedia
Does any one have any further information? :o

I think the presumption is that everything on each disk should be on the other, but I’m not sure about that. Take a look at creating an array with a single disk (you’ll have to use --force), then adding the second with --update resync; I think this presumes you want the second to be identical to the first.

As far as a 3rd disk: IMO, you want that anyway. RAID is for fault-tolerance, but not a backup strategy. I use 3 arrays on 2 disks for my production instance, and have a 3rd disk in this workstation which is a consolidated mirror of the arrays. I run an rsync script via cron to periodically update the mirror; it runs very fast and is barely noticeable. (Being a firm believer in Murphy’s Law, I also have a nightly job which updates a mirror on my LAN server - just in case the workstation gets literally fried.)

Will look this up…

Well, right but RAID-1 is writing data to the disks simultaneously and should one go faulty you can load all data back from the other one. That’s been safe enough for myself. For your rsync script, are you just running it with the incremental option or something?
I’m not sure if i need this since it’s “just” for my personal data anyways…not that i wanna lose them (that’s why RAID1 :wink: )

I understand. In my situation, I have a great deal of critical data on this workstation, hence the extra precautions.

I did find this Setting up a RAID 1 (mirrored) file system during installation but I’m not positive it’s applicable; this could be in the context of the installation/tools so it may not be conclusive.

You might check the Fedora Core and Gentoo forums; a heckuva lot of hw geeks (like I should talk :wink: ) over there. Perhaps also linuxquestions.com.

Okay,

I believe to create I have to go this way:

mdadm --create /dev/md0 --level=mirror --force --raid-devices=2 /dev/sdc --spare-devices=1 /dev/sdb 

and then to merge in my 2nd disk (/dev/sdb) I have to:

mdam --assemble but i couldn't figure out what other arguments i need...crap

>:(

-U resync?

Uhm right, this would then be:

mdadm --assamble --uuid=/dev/md0 resync

is that right? I’m not quite sure what the uuid is…

No, the -U is equiv to --update; check the man page - it’s “assemble --update resync”. Hope you have a backup, or perhaps you could create 2 small partitions to use as a test case.

Could someone list an example of how to recover a partition that has been kicked out of a RAID1 array. I can see where mdadm is very powerful, and I’m confused coming from a raidtools environment.

What do you meanm by “kicked out”? As soon as you put the disk back in the defined array mdadm starts the synchronizing process

Let me explain. I have a two drive radi1 array, All the partions on the second drive on boot have been kicked out (that’s what the software is saying) of the raid1 set. I’m presuming because the data is out of sync. I need a command that I can run on each partition to join them back to the array. I would assume I would been to enter it four times for the associated partitions. ie md0 = /boot, md1 = swap, md2 = /, and md3 = /home. With raidtools I would type raidhotadd /dev/sdb1 /dev/md0 and the partition would be resynced into the array, or something similar.

As usual lately, I answered my own question.

mdadm --add /dev/md0 /dev/sdb1

is a good example.