0

having my DNS cache configured on a raspberry pi, I was wondering if the IO from local requests could wear out the micro SD in it. In case it can, is there any way to have the cache files to be stored in a memory partition?

flpgdt
  • 467

1 Answers1

1

If you're using the RPi as a client, the DNS cache is not stored at all, so no problems. See here

Otherwise, if you are using the RPi as a server, the answer is the following.

As answered here, the number of writes is pretty high, so it's unlikely it will significantly reduce the life expectancy.

But, let's say you want to create a partition on a separate drive or you want to create a partition in RAM, in order to avoid that problem.

In the first case, I'd say: do you want to connect it via USB? isn't IO speed a factor? because RPi has a shared Ethernet/USB bus, so the requests will take significantly longer. Anyway, you just need to add to the /etc/fstab the line to mount the external drive partition to a folder, which will be the mountpoint.

UUID={volume UUID}  /{mountpoint}   {filesystem}    rw,relatime,data=ordered,noatime,noauto     0   1

Then the DNS cache file should be in that position. You didn't specify the daemon that is doing the DNS relay, so I cannot provide the example.

In case you want to use the RAM. Mind that data will be lost when the RPi is shut down.

The /etc/fstab line to create a partition of size 50MB, then, should be

tmpfs       /{mountpoint}   tmpfs      nodev,nosuid,size=50M        0   0

see the fstab manpage for more infos

pittix
  • 111
  • 9