Made directory to act as /dev/null

linux mint 22.2 - host

I need to to make /dev/null directory (black-hole directory) for whole /var/log/

Why: Host OS not used directly. I have only QEMU (to run whonix) on it.

Due to specific needs of my environment i want to reduce all (even little) info stored on host OS.

For now mounted it as tmpfs (i read guide here) but i still feel uneasy.

I already stopped journald and system-level journal.

But some apps creates logs with different names each time so ln -s to dev/null wont help :frowning:

So i need to make this dir never write nowhere (not on disk, not even in ram), but avoid errors and make app think that file written.

And, please, for things that sane and holy, do not advice scripts that will automatically delete files from disk. It won’t help for multiple reasons:

  • App will create new file, wich will increase tearing down of my ssd
  • It still can be recovered by advanced methods

Main idea not to write NOWHERE (not disk, not ram, NOTHING). FDE won’t help too, as it can raise suspicions.

Soo… Can anyone help me?

1 Like

To my knowledge, what you’re describing isn’t possible on Linux. /dev/null works because it’s a kernel device, not a directory. Any directory must involve a filesystem, which means writes go somewhere. Using tmpfs for /var/log is already the safest and closest achievable approach.

P.S. Welcome to the forums! :handshake:

1 Like