How do I get mdadm to assemble a raid using local and nbd devices
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
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.
If the nbd0 is actually more up to date, the changes get lost in the resync. What I need to do is assemble them both at the same time so that raid can determine which is the more up to date and do the resynch in the right direction. But mdadm refuses to add them to the array at the same time.
Probably this is a simple minded question, but if you DO add them sequentially, and let them resync fully, then shutdown and restart the system, does mdadm still refuse to add them?
Quote:
If the nbd0 is actually more up to date, the changes get lost in the resync
BTW, I'm guessing the only reason they'd get out of sync is that /dev/nbd0 would miss writes if the network goes down, so how would it get more up to date?
Probably this is a simple minded question, but if you DO add them sequentially, and let them resync fully, then shutdown and restart the system, does mdadm still refuse to add them?
BTW, I'm guessing the only reason they'd get out of sync is that /dev/nbd0 would miss writes if the network goes down, so how would it get more up to date?
To answer the last question: nbd0 can be more up to date if there is a failure of the local disk. I think I've got an unreliable SATA connector, but I've certainly seen failures of the local hard disk component. When this happens nbd0 continues to support the raid component (as it's supposed to), and then the local disk is out of date.
Nothing I found works automatically. I can force the correct update by adding nbd0 first with --run, and then sdb6 with --re-add.
I think the moral of this story is: 1. make sure the raid is started after init 2 processing. After a RAID failure, to boot into single mode (init 2 I think), use mdadm --examine to determine which is the more up to date component, manually assemble --run the more up to date component, then --re-add the out of date one. Wait for the sync and reboot into normal operation.
By the way, I had a hang about once per day. Although I've not localized it, I suspect the raid/nbd combination, and I'm going to remove the nbd raid component, and instead do a periodic unison backup to the remote server. Less high tech, but I'm guessing I'll have less trouble with it.
To answer the last question: nbd0 can be more up to date if there is a failure of the local disk.
Well, yeah, but I meant under normal circumstances. If failure of the disk is a regular worry, then you have bigger problems. RAID 1 is a bit like harddisk insurance; there in the unlikely event that you need it - but NOT as a substitute for regular backups. So you are probably much better off with your current plan to do periodic backups. But if you have a faulty SATA connector then (a) replace it (b) don't use it (c) use local RAID (ie. another local harddisk)as insurance in addition to your backups.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.