I’m trying to configure a Rapsberry 3 with an 16GB micro-SD card so that it doesn’t wear the microSD card, i.e. with a read-only rootfs (I had several SD cards breaking in the past with an older Raspberry 1 and a writable rootfs).
Now the question is whether I should prevent it from being a directory service/mirror, because this feature seems to need some persistent memory. My setting for this currently is
DataDirectory /var/lib/tor
DirCache 1
DirPort 9030
so my relay is working as a “directory service”.
My understanding (or my guess) is that Tor writes the “directory data” into the following files in /var/lib/tor
:
cached-certs
cached-consensus
cached-descriptors (109M)
cached-descriptors.new (17M)
cached-microdesc-consensus
cached-microdescs (20M)
cached-microdescs.new (9M)
diff-cache
Some of those files are rather big, I wrote the current size behind those above. My relay has been running only for a few days, and it seems that those files don’t grow much anymore.
Does it make sense to write those files into a tmpfs
(as I do currently), with the disadvantage that they are getting lost at rebooting the device once in a while?
Or should I rather use DirCache 1
and prevent my relay from being a directory mirror?
btw: To have static keys, I restore the files fingerprint
and fingerprint-ed25519
before starting the Tor service from persistent memory.
I also mount a separate writable partition to /var/lib/tor/keys
(a configuration from some time ago, probably because I assumed that Tor needs to be able to make some – but few – changes that are persistent in this directory).