Sample Header Ad - 728x90

How to make /var/log persistent through reboots on an embedded linux device

0 votes
3 answers
5367 views
**Scenario** I am on an embedded Linux system. As usual /var/log/ is the directory when all the logs are stored. I have a directory called /safepath which is created during image creation and it is on persistent memory. It means that whatever I place under /safepath persists across reboot sessions. I want the logs in /var/log/ to not be lost on every reboot and wish to make it persistent through the reboots. So I thought to mount /var/log/ on to /persists by doing a mount --bind /var/log /safepath which I read from this interesting discussion [here](https://unix.stackexchange.com/questions/198590/what-is-a-bind-mount) **Question:** But doing this still causes me to lose the data in /var/log/. Is this correct? How can one force /var/log/ to persist across reboot sessions?
Asked by TheWaterProgrammer (159 rep)
Oct 24, 2018, 03:13 PM
Last activity: Feb 27, 2024, 01:06 PM