I run a Raspberry Pi as a TOR node and use an SD card. The last SD card died, probably due to too much data being written to it.
I'm already using the setting
AvoidDiskWrites 1
So I've set up Raspbian with two read-only filesystems (boot
and rootfs
).
/var/log
is a tmpfs
, I have a file /var/log/tor/notices.log
where TOR can write to.
I have one writable filesystem which is mounted to /var/lib/tor
, because I've seen that TOR is writing to that directory.
That's the files there are:
/var/lib/tor
cached-certs
cached-consensus
cached-descriptors
cached-descriptors.new
cached-microdesc-consensus
cached-microdescs
cached-microdescs.new
fingerprint
lock
state
cached-status/
keys/ed25519_master_id_public_key
keys/ed25519_master_id_secret_key
keys/ed25519_signing_cert
keys/ed25519_signing_secret_key
keys/secret_id_key
keys/secret_onion_key
keys/secret_onion_key_ntor
keys/secret_onion_key_ntor.old
keys/secret_onion_key.old
stats/dirreq-stats
stats/hidserv-stats
Now I see via /sys/fs/ext4/mmcblk0p3/lifetime_write_kbytes
that there's quite some amount of data continuously written to that folder.
The files which get updated often are
cached-consensus
cached-descriptors
cached-descriptors.new
cached-microdesc-consensus
cached-microdescs.new
lock
state
And cached-descriptors
is by far the biggest.
I'd like to have that data written to a tmpfs
, if possible.
Questions
Do those files need to be persistent (e.g. for sure fingerprint
and everything in folder keys
, but they don't change during runtime), or is it okay if I have them in a tmpfs
.
I could not find anything in the relay documentation.
AvoidDiskWrites 1
in yourtorrc
. "If non-zero, try to write to disk less frequently than we would otherwise. This is useful when running on flash memory or other media that support only a limited number of writes."