Community discussions

MikroTik App
 
Zig
just joined
Topic Author
Posts: 8
Joined: Thu Feb 09, 2023 11:15 am

PiHole / files not persistent

Fri Dec 06, 2024 5:18 pm

Hi,

When using a container on RouterOS (7.16.2) with disk nvme, I have a problem with file persistence.
Same non-persistence fault for adlist, whitelist, queries, activity etc.. (error config mount / rights ???)

Example
The container is PiHole, which allows you to define local custom dns.
local dns.png
These are then saved in the /etc/custom.list file.
custom_list_changed.png
As long as I don't update (stop/remove/add) the container, everything's fine.
But as soon as I update the default (empty) config, the mounts config is overwritten.
custom_files_reset.png
Have you ever encountered this problem?

mounts.png
env.png
create container.png
container print.png
You do not have the required permissions to view the files attached to this post.
 
optio
Forum Veteran
Forum Veteran
Posts: 948
Joined: Mon Dec 26, 2022 2:57 pm

Re: PiHole / files not persistent

Sat Dec 07, 2024 11:50 am

But as soon as I update the default (empty) config, the mounts config is overwritten.
What does this means? Reset Pi-hole to default config with its Teleporter feature or directly on fs? If is that, this is expected, mount just holds files (in this case current Pi-hole config files) which will not be deleted after container is removed and it will be mounted at same path when again adding container if mount is added in container mounts. If you made Pi-hole config changes it would be persisted, mount is not recovery backup/restore in this case.
 
Zig
just joined
Topic Author
Posts: 8
Joined: Thu Feb 09, 2023 11:15 am

Re: PiHole / files not persistent

Sat Dec 07, 2024 12:49 pm

But as soon as I update the default (empty) config, the mounts config is overwritten.
What does this means? Reset Pi-hole to default config with its Teleporter feature or directly on fs? If is that, this is expected, mount just holds files (in this case current Pi-hole config files) which will not be deleted after container is removed and it will be mounted at same path when again adding container if mount is added in container mounts. If you made Pi-hole config changes it would be persisted, mount is not recovery backup/restore in this case.
This means I lose the configuration after a stop/remove/pull/start when I update the container.
So the configuration present in the nvme disk (mount /nvme1/docker/pihole/etc : /etc/pihole) is overwritten.
 
optio
Forum Veteran
Forum Veteran
Posts: 948
Joined: Mon Dec 26, 2022 2:57 pm

Re: PiHole / files not persistent

Sat Dec 07, 2024 1:24 pm

This shuld not happen if Pi-hole configuration is not touched before and after creating container. I'm using Pi-hole in ROS container, never had such issues and also having some config in custom.list file. Check FS for errors on Linux, maybe there are some FS issues.
 
holvoetn
Forum Guru
Forum Guru
Posts: 6825
Joined: Tue Apr 13, 2021 2:14 am
Location: Belgium

Re: PiHole / files not persistent

Sat Dec 07, 2024 3:02 pm

Possibly an issue with the mount location ?

On RB5009 there is a confirmed issue with startup of some USB3 stick so I have to be really careful with my containers too after restart/ reboot.
 
Zig
just joined
Topic Author
Posts: 8
Joined: Thu Feb 09, 2023 11:15 am

Re: PiHole / files not persistent  Topic is solved

Sat Dec 07, 2024 5:10 pm

I've found MY mistake!
It's in the mounting and creation of the container :
/container/add remote-image=pihole/pihole:latest interface=veth-pihole root-dir=/nvme1/docker/pihole mounts=etc_pihole,dnsmasq_pihole envlist=pihole_envs start-on-boot=yes comment=pihole
And mounts was :
/container/mounts/add name=etc_pihole src=/nvme1/docker/pihole/etc dst=/etc/pihole
/container/mounts/add name=dnsmasq_pihole src=/nvme1/docker/pihole/etc-dnsmasq.d dst=/etc/dnsmasq.d
So the mount points were identical to the root dir and were overwritten with every upgrade !

by correcting with a dir configs it works immediately better
container/mounts/add name=etc_pihole src=/nvme1/docker/configs/pihole/etc dst=/etc/pihole
/container/mounts/add name=dnsmasq_pihole src=/nvme1/docker/configs/pihole/etc-dnsmasq.d dst=/etc/dnsmasq.d

Thank you for your feedback, which helped me with the correction.
 
holvoetn
Forum Guru
Forum Guru
Posts: 6825
Joined: Tue Apr 13, 2021 2:14 am
Location: Belgium

Re: PiHole / files not persistent

Sat Dec 07, 2024 5:26 pm

Good catch !

Who is online

Users browsing this forum: No registered users and 3 guests