Logfile on USB drive

In OpenWrt 24.10.1, I have sucessfully mounted a USB stick (/mnt/sda1) using the block-mount kmod-usb-storage-uas kmod-usb3 luci-app-hd-idle packages.

Now, I want the logfile on the USB-drive.

In Luci's System-Settings, I set the lofgile to /mnt/sda1/system.log

Everything is working fine, but only up to the next boot. If the router reboots, no new entries are added to the logfile.

I guess the reason might be that the USB-drive is mounted only after the logging-process started. f I just restart the log-service (service log restart), everything is working as expected and new logs are appended to the logfile on the USB-drive.

Is there any way to set this up properly so that the logs are always written to the USB drive?

I've never tried this but it should work:

or create a script that checks if /mnt/sda1 is mounted and restarts the "logd" server

1 Like

thanks for the idea of restarting the log service.

I just added a restart to local startup and that does the trick!

2 Likes