Idea for keeping a home server's HDD spun down using an SSD cache

A operator runs a 1TB SSD alongside a 16TB HDD to power services like , Copyparty, Jellyfin, and , and wants the HDD to stay spun down most of the time while those services keep running off the SSD. The plan is to present a virtual showing all files on the HDD, while the actual file index, , and full copies of the most recently accessed files live permanently on the SSD.

Writes would always land on the SSD first, with updates batched to the HDD later, so the HDD would only spin up for scheduled writes or when a file outside the cache is requested. Options considered include with fscache, ZFS with a persistent L2ARC, and bcachefs, but each eventually evicts files from cache and sends most reads back to the HDD.

unRAID reportedly has the same issue, with most reads still hitting the HDD. A NixOS-configurable solution is preferred, and the goal is to keep the cache permanently near full.

Key points

  • Setup: 1TB SSD + 16TB HDD, goal is to keep the HDD spun down while services run off the SSD
  • Plan: permanent SSD-resident file index, , and recently accessed file copies; writes hit SSD first and batch to HDD later
  • +fscache, ZFS with persistent L2ARC, and bcachefs all eventually evict cached files and send reads back to the HDD
  • unRAID has a similar issue where most reads still go to the HDD
  • Prefers a NixOS-configurable solution
Read original