Fundamental RAID1 questions, which confuse me for a while!
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's 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.
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.