Unable to Read USB pihole.log

I followed the directions: Moving the Pi-hole log to another location/device

It all works well except the next day (and a reboot), I am unable to read the pihole.log file from the usb flash drive. WebGui also has issues reading it (doesn't display and stats or graph). Interesting thing is that the log file is getting written to as I see the size changing.

When I went to open the log file (text editor), permission denied. I am assuming there is a permissions settings that needs to be applied so pihole can read it?

Help would be appreciated. bit of a noob here. :sweat_smile:

Can you still read the file using e.g.

tail -n10 /var/log/pihole.log

?

Also, what is the output of

ls -lh /var/log/pihole.log

(note that the color is important if available!).

Permissions error. Attached screenshot.

Okay, all good so far. How about

ls -lh /media/usb/pihole.log

Okay, so this file can only be accessed by dnsmasq and root. Let me explain to you why:

rw- : user (dnsmasq) has read + write permissions
r-- : group (root) has only read permissions
---: All others (i.e. incl. you and the web interface) have absolutely no permissions on the file - not even read.

Adding read permissions to all users should solve your problems:

sudo chmod a+r /var/log/pihole.log
1 Like

Awesome that worked.

Kinda had the same thought process. Appreciate the explanation.

Think adding that last bit to the FAQ article would help.