There's no point in re-inventing the wheel. I know that Synology and QNAP use mdadm (all bets are off with Netgear hardware). It's a tried and true solution, and in a NAS a huge cost saving and performance is OK. Given that new file systems like ZFS basically make hardware-level raid redundant, this is an OK thing.

The only time when it's not so great is for high throughput on heavy protocols like iSCSI. Then the challengine of pushing all that data, the iSCSI protocol and the RAIDing system will run the system to 100% CPU and 100% RAM easily.

Do any "pro-sumer" grade NAS boxes use hardware RAID?
I have a number of files I want to update by replacing one multi-line string with another multi-line string. Something along the lines of:

* Some text, 
* something else
* another thing


And I want to replace it with:

* This is completely
* different text


The result would be that after the replacement the file containing the first block of text, will now contain the second string (the rest of the file is unchanged).

Part of the problem is that I have to find the list of files to be updated in the file system, I guess I can use grep for that (though again that's not as easy to do with multiline strings) then pipe it in sed maybe?

Is there an easy way to do this? Sed is an option but it's awkward because I have to add \n etc. Is there a way to say "take the input from this file, match it in those files, then replace it with teh content of this other file" ?
I can use python if need be, but I want something quick and simple, so if there is an utility available, I rather use that than write my own script (which I know how to do).
