(Solved) Is a RAID mirror possible?

Once I have finished setting up OpenWrt on my new router I will be replacing my old one with it. My old one is basically an X86-64 Xeon rackmount server that I installed DD-Wrt onto. In it I have a couple of SATA disks configured as a raid mirror so in the event one of them goes bad I do not lose anything. I'm wondering if it is possible to create a similar setup in OpenWrt using the internal SATA disk and a USB disk. If anybody knows if this is possible or could point me to some resources on doing this it would be appreciated. Thanks!

Openwrt have mdadm, which should be pretty much all you need.
Remember, you also need ito install grub2 as boot loader, on both drives.

I have installed mdadm but the only time I have ever used it was on some old NAS boxes that I replaced the proprietary software on with Debian 10 so I don't have a whole lot of experience with it. I normally use ZFS for this sort of thing on my desktop & servers. It would be nice if there were a luci app for this under services like DD-Wrt has.

Don't think there is, setup should however be the same as on any raid1 Linux system.

Aside from that, I would not expect OpenWrt itself (kernel+/boot+rootfs) to boot from mdadm (nor zfs), mere data partitions mounted towards the end of the boot process are another (easier) topic.

I'm not trying to boot from it. I have it installed in flash and a 2GB SD as overlay for extra packages. I just want a mirror attached as a NAS so that I don't lose anything. I have been following this to get it setup.

I notice that my consistency policy is set to bitmap instead of resync in the example though and not sure how to change it or if I should. Like I said I'm not too familiar with Linux RAID because I have been using ZFS for a long time when you still had to build it into the kernel instead of it coming with it like recent Ubuntu for example.

I'm also not sure why it is resyncing if there is no data on there yet. With ZFS you would issue a scrub command and if there are inconsistencies found it will resilver the drive in question.

Ah, well if you're only mirroring it ad hoc, or by cron, you could simply dd the whole image, or rsync?

Don't think continous writes to a SD card would make it last very long.

The SD card is just for overlay because I'm unable to install more packages like minidlna with internal storage. The raid consists of a 1TB SATA & a 1TB USB that will be used to store media files such as my ripped CD collection that I can ftp in there via openssh and have minidlna deliver to the PS3 for example.

I already have all of this setup like this in DD-Wrt but I didn't have a gigabit router at the time so I built one out of an old dual xeon rackmount server with multiple gigabit ports. Now that I have this new one that is not DD-Wrt compatible but Open-Wrt compatible I'm figuring it out. What I have going now is overkill, there is not a dent in the cpu or ram but it does consume more electricity so I'm just trying to get it operable as it was with this new Netgear router.

Anybody know much about this Linux RAID consistency policy that I mentioned or what this resyncing on empty drives is all about?

It always does this, when you add a new or replace a drive, doesn't matter if it's empty or not.

Do a cat /proc/mdstat (i think it is) to get an ETA.

Damn! It says I have like 8 hours left... Seems like an awful lot for nothing when resilvering doesn't take that long but I'm assuming the USB drive is playing a part in that. Do you know about the consistency policy?

I had bad s1150 mobo (or bad Linux driver) for a while, the soft raid5 on it would fail after every reboot, no matter what you did. One drive would alway require a (re)sync.
12TB takes roughly 1.5 day, longer, if you cap the sync speed, so the data can actually be read w/o wait during sync.

It has to be 100% in sync, 100% of the time?

After creating the Linux RAID array and issuing "mdadm --detail /dev/md0" it says that my consistency policy is set to bitmap, whereas in the example I used it was set to resync.

No idea, never looked into it tbh, I'm just glad it's working :slight_smile:

I was reading something about how in power loss if it is set to resync it will start rebuilding when it comes back online, whereas under bitmap you may have to issue commands for it to find and repair faults. I'm not sure how to change it.

Some of those settings can only be configured during the creation of a raid.

Are the two drives identical?
If you want to mirror 100% of the drive space, you could mdadm /dev/sda /dev/sdc, instead of the partitions.

As far as the consistency policy I was reading that it automatically sets it to bitmap if over 100GB so that is why mine came out different than in the example I used. It is my understanding that it is better to mdadm partitions instead of drives so that they are easier to access if you need to put it in a different machine whereas the latter will show up as a blank unformatted disk.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.