ZFS cache with mirrored SSDs?

peterka

Member
Dec 23, 2020
42
3
13
60
Does it make sense to use mirrored SSDs for the ZFS-cache to avoid data loss (e.x. in case of ssd-hardware-failure)?
Does this creat a zfs-pool with mirrored SSDs?
zpool create -f -o ashift=12 <pool> mirror <hdd1> <hdd2> cache <ssd1> <ssd2>
 
For l2arc it doesn't really make sense, there is no data loss.

For slog always use a mirror.
 
My small beginners-roundup about setting up a ZFS-Raid-5 with 3 HDDs and 2 SSDs:

Always use an UPS, a high-quality power supply, HDDs for continuous usage with CMR, SSDs with Power-loss Protection.

# zpool create -f -o ashift=12 <pool> raidz1 <HDD1> <HDD2> <HDD3> log mirror <partition1-on-SSD1> <partition1-on-SSD2> special mirror <partition2-on-SSD1> <partition2-on-SSD2> cache <partition3-on-SSD1> <partition3-on-SSD2>

prepare partitions for log/special/cache on SSDs with parted or gdisk with GPT-partition-tabel ; log on first partition, size half of RAM-size; size of special >= 0,3% of HDD-pool-size; rest for cache.

OPTION log OPTION mirror: this is ZIL (ZFS intent log) write "cache" (log), so use ssd; if not mirrored and ssd fails, loss of about last 5 seconds of written data.

OPTION cache; this is L2ARC (ZFS read cache on disk), so use ssd. more than one <device> -> stripped (there is no mirror OPTION, does not make sense).

OPTION special OPTION mirror: metadata-storage, so use ssd; size >= 0,3% of HDD-pool-size; speeds up more when using many small files on the HDDs; you should use mirror or you can loose much data when special-ssd/partition fails.
 
  • Like
Reactions: avladulescu