I did some experiments because I wanted to see how bad the data integrity issues were. In particular, these Seagate 2TB external drives are an awesome deal at $99, for my particular application:
http://www.amazon.com/gp/product/B00FRHTTJE/ref=oh_aui_detailpage_o03_s00?ie=UTF8&psc=1 (mac mini ZFS server with low power consumption) — even if I end up throwing out the enclosures and just using the drives inside.
I bought four of them and filled the USB ports on my mac mini, created a stripe/mirror pool, and started 10 processes writing random data into separate files:
- Code: Select all
for x in 0 1 2 3 4 5 6 7 8 9; do
cat /dev/urandom > /tmp/random$x&
done
then I pulled the cables. A scrub revealed that basically every one of the files was corrupted. It's my understanding that if the enclosures were properly transmitting write barriers to the drives, there would have been no corruption. Some of the data that never reached the physical disk media would be lost, but none of the data that
was written would have been altered.
My first inclination was to look for external enclosures that honor write barriers, but it's actually really hard to find any enclosures that promise to do so (presumably eSATA doesn't have this issue, but there's no eSATA on the mini). It seems the public at large is ignorant of the problem, so there's little incentive for vendors to worry about it. I'm not really worried that cables will be pulled or broken while the machine is running, but a similar problem can occur due to a power outage. The answer I came up with actually costs a lot less than most enclosures: a UPS. This one seems to do the job really well for a low price:
http://www.amazon.com/gp/product/B00429N18S/ref=oh_aui_detailpage_o00_s00?ie=UTF8&psc=1.
I think I'll boot from an external USB drive, take two of the drives out of their enclosures and put them inside the mini where write barriers should be honored, and set ZFS as RAIDZ2. So even if the UPS fails, write barriers should protect the internal drives, which is enough to save all the data if nothing else goes wrong. That also leaves two USB ports free on the mini, which can be mighty handy.
In that configuration I'll try the test again, pulling the power cord on the mini, just to see if it makes a difference. I'll report the results here.
I'm still finding my way here a bit, so if you have any thoughts about this plan, I'd love to hear them.