What is FreeNas/ZFS resiliance to sudden power loss?

Status
Not open for further replies.

anRossi

Dabbler
Joined
Feb 1, 2014
Messages
36
Searching the forum has returned a few threads that show sometimes Really Bad Things(TM) can happen when a FreeNAS box suddenly loses power (e.g. unrecoverable zpool). However, I can't tell if this is expected or typical. Based on my understanding of ZFS and filesystems in general, the pool should be mountable, data at rest should be readable, but any data that was being written at the time of power loss is probably FUBAR.

What are the experiences other people have had in this regard? Generally positive and stable (minimal or no data loss) or complete catastrophe (loss of all data, loss of OS, etc.)?

For the record, I have a UPS and NUT is monitoring it and it has shutdown my FreeNAS box when the power has gone out. I'm just curious what the effects could be in case there's an emergency and I need to grab the FreeNAS box and go, and I don't have the 45 seconds it takes to shutdown.
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
I think that's a hard risk to quantify. It won't destroy everything every time. If your choice is definitely lose all data in a fire or pull it without shutdown (with some risk), pull it. Or better yet, have off site backup and get the heck out without dilly-dallying around.
 

mjws00

Guru
Joined
Jul 25, 2014
Messages
798
I had a server that got the power cord kicked out of it frequently. Hard Crashed dozens and dozens of times. ZFS never blinked. Lots of those were just idling, but some had data streaming and transferring. Certainly as robust as any other file system.

Obviously you'll never get much beyond anecdotal evidence on things like this. But there is nothing stopping you from building a test pool and whacking the power to it over and over again. That is exactly why I left that server in the precarious position it was. To be even meaner, it was also virtualized. I couldn't hurt it. YMMV. :)
 

anRossi

Dabbler
Joined
Feb 1, 2014
Messages
36
I figured the best I could do was get a random sampling of anecdotal evidence and draw my own, not-very-scientific conclusions from them.
I think I'll just get an external drive and sync the latest copy of data from the NAS to that, weekly, and grab that and go, since it's small and will be offline most of the time.
 

SirMaster

Patron
Joined
Mar 19, 2014
Messages
241
Due to the copy-on-write nature of ZFS it is more resilient to sudden power loss than most other file systems. Disk writes are for the most part atomic. It does not suffer from things like the RAID 5 write hole.
 
Last edited:

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
Transaction group updates are made to appear atomic, writes only do if they're written sync. There are other possible failure modes, especially where the hardware stabs you in the chest by caching data unexpectedly.
 

anRossi

Dabbler
Joined
Feb 1, 2014
Messages
36
Ah, so is there any way to find out of the hardware is caching data before disaster strikes? I'm not using anything fancier than an Atom server board and some NAS drives, so I would think that there's no caching other than OS and disk cache. (i.e. no RAID controller)
 

anRossi

Dabbler
Joined
Feb 1, 2014
Messages
36
Thanks for the link, jgreco!
Looks like this is a script best used on a file system before it is deployed. I guess I'll save it for my next deployment and not tempt fate by pulling the power on this one.
 
Status
Not open for further replies.
Top