LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Fundamental RAID1 questions, which confuse me for a while! (https://www.linuxquestions.org/questions/linux-newbie-8/fundamental-raid1-questions-which-confuse-me-for-a-while-828173/)

RWTH 08-24-2010 06:21 AM

Fundamental RAID1 questions, which confuse me for a while!
 
Hi,

I have fundamental RAID1 questions, which confuse me for a while.

1) Once I want to built a RAID array with two HDs, then I create it with the following command:

"mdadm --create --verbose /dev/md0 --level=linear --raid-devices=2 /dev/sde1 /dev/sdf1".

With this command I specify the RAID array with the device labellings "sde1" and "sdf1", which are not the only HDs on the system. There are the other HDs sda, sdb, sdc and sdd.

Let's assume after a while I had to remove the HD sdc completely. Once I reboot the system, since there is one less HD, the labeling of the HDs could be shifted down, such that sde might become sdd and the sdf might become sde. In this case, how does the system take care about the RAID array?

Basically, how does the system know which fixed HDs are in the array and they are synced correctly, because sdf doesn't exist anymore and sde is changed to sdd?

2) Let's assume in a different scenario, that I have one HD in the system, namely the sda. There was no RAID array and therefor, I want to build a RAID array and bring the second HD sdb.

Once I build a RAID array with the following command:
"mdadm --create --verbose /dev/md0 --level=linear --raid-devices=2 /dev/sda1 /dev/sdb1".

What is the direction of the syncing for the data? How does the RAID array know, that the data on the sda1 has to be synced to sdb1. Other wise, if the RAID array syncs the data from sdb1 to sda1, then I will loose my useful/original data on sda1.

The same problem could occur also, when there is a HD failure. Once I take out the faulty HD and bring a new healthy HD, how does the RAID array know which way to sync (like in the above scenario)? May be in this last case, if I use the mdadm command with the "add" option and because of that the RAID array can distinguish the new HD from the old one.

Thanks,
RWTH

jf.argentino 08-24-2010 12:04 PM

Quote:

how does the system take care about the RAID array?
Not sure but I think you have to delete your mdadm.conf file, re-assemble your array with something like "mdadm --assemble /dev/md0 /dev/sdd1 /dev/sde1" then re-create your mdadm.conf file. I don't think you're removing hd everyday? And if it's the case, maybe mdadm can handle partitions by their UUID like "mount" does? If so you have nothing to do.

And for your 2nd question, far to be sure too, but when using "mdadm --create", all devices used by the array need to be present, and you can add new device with "mdadm --add", so syncing goes from existing array to the device you've added. And so does work when replacing a failed hd.

Hope it helps

RWTH 08-25-2010 02:23 AM

Quote:

Originally Posted by jf.argentino (Post 4076324)
Not sure but I think you have to delete your mdadm.conf file, re-assemble your array with something like "mdadm --assemble /dev/md0 /dev/sdd1 /dev/sde1" then re-create your mdadm.conf file. I don't think you're removing hd everyday? And if it's the case, maybe mdadm can handle partitions by their UUID like "mount" does? If so you have nothing to do.

And for your 2nd question, far to be sure too, but when using "mdadm --create", all devices used by the array need to be present, and you can add new device with "mdadm --add", so syncing goes from existing array to the device you've added. And so does work when replacing a failed hd.

Hope it helps

Thanks for your inputs jf.argentino


All times are GMT -5. The time now is 02:15 AM.