Search code examples
linuxstoragezfs

Risk of ZIL working on single SSD


I'm trying to make a storage for my home server which is made by ZFS. I have only 1 SSD but by quick googling I found many people set ZIL on mirror-ed array. Only 1 SSD for ZIL is risk?

I understand I will lose some logs on ZIL when the SSD is broken. It's ok that small data will be lost because the storage is only for personal use. Without the lost logs can the raidz work well? For example, can I revert the raidz to the latest snapshot without the broken ZIL?

I'm using Debian 7.0 and ZFS on Linux 0.6.1.


Solution

  • You would need to check your zpool version, if it's >= 19 then it supports "Log device removal" or ZIL removal.

    $ zpool upgrade -v
    This system is currently running ZFS pool version 28.
    
    The following versions are supported:
    
    VER  DESCRIPTION
    ---  --------------------------------------------------------
     1   Initial ZFS version
     2   Ditto blocks (replicated metadata)
     3   Hot spares and double parity RAID-Z
     4   zpool history
     5   Compression using the gzip algorithm
     6   bootfs pool property
     7   Separate intent log devices
     8   Delegated administration
     9   refquota and refreservation properties
     10  Cache devices
     11  Improved scrub performance
     12  Snapshot properties
     13  snapused property
     14  passthrough-x aclinherit
     15  user/group space accounting
     16  stmf property support
     17  Triple-parity RAID-Z
     18  Snapshot user holds
     19  Log device removal
     20  Compression using zle (zero-length encoding)
     21  Deduplication
     22  Received properties
     23  Slim ZIL
     24  System attributes
     25  Improved scrub stats
     26  Improved snapshot deletion performance
     27  Improved snapshot creation performance
     28  Multiple vdev replacements
    

    This means I have version 28 (>=19), thus, I can remove my ZIL device anytime from my pool. I doubt you'll break your single ZIL drive within a year or two unless you are performing synchronous writes all the time which your ZIL helps even out. There have been a lot of improvements on ZFS and from what I've read when your ZIL device breaks, the pool will simply revert to writing directly to the data pool. Of course, you can still rollback to a 'good' snapshot (do make sure you have snapshots).