Came here because of log error: [fatal] initing hosts container: hosts container: path at index 0: stat etc/hosts: os: DirFS with empty root
There is a known issue with adguardhome which has been rectified in later verison, current supported (https://openwrt.org/packages/pkgdata/adguardhome) version 107.6 has this flaw and I am unable to start AdGuard on my openwrt install:
just be aware that the opkg version does a few things different to if you use agh regular version. If you have a scroll in my thread I believe James and I detail the differences but from what I recall...
The config file lives in /etc/config/adguardhome rather than AGH's default of /opt/AdGuardHome
the filters logs etc are saved in /tmp and thus are lost on reboot.
I think there may have been a few other bits but that's the main parts.
The official OpenWrt package uses the following paths and directories by default:
The AdGuardHome application will be installed to /usr/bin/AdGuardHome.
The main adguardhome.yaml configuration file is stored at /etc/adguardhome.yaml.
The default working directory is /var/adguardhome (By default /var is a symlink to /tmp).
The working directory can be configured in /etc/config/adguardhome
An init.d script is provided at /etc/init.d/adguardhome.
The default configured working directory will mean query logs and statistics will be lost on a reboot. To avoid this you should configure a persistent storage path such as /opt or /mnt with external storage and update the working directory accordingly.
You can use my thread to update/use the stable 107 tree by using my scripts and just removing the beta script part. (so it installs the stable 107 rather than beta 108)
That would give you a install to /opt that is in line with the manual install detailed on the AGH wiki.
:edit: It seems you have managed by using their install script. Just check to see that its properly installed in /opt and remove the old opkg files.
Seems you were correct in your warnings, although I tested while power cycling the router after a power outage it seems the install went to default and adguard isn't starting once more... back to square one, have the error again:
[fatal] initing hosts container: hosts container: path at index 0: stat etc/hosts: os: DirFS
with empty root
Really hope openwrt will update the official package.
Using the below states I already have it installed:
curl -s -S -L https://raw.githubusercontent.com/AdguardTeam/AdGuardHome/master/scripts/install.sh | sh -s -- -v
At a loss :\
UPDATE
I'm an idiot:
[fatal] writing config file: write /opt/AdGuardHome/.AdGuardHome.yaml2240086222: no space left on device
I figured the retention span could be a problem on such a small device so to get it back running I deleted /opt/AdGuardHome/data/querylog.json which was about 20MB, restarted the service and reduced retention to 24H instead of default 90 days
I'd have suggested removing the opkg version completely and then reinstalling the stable AGH from their script but you have managed.
You do need about 100mb of space in /opt for AGH. You may need 6hr logs only if you only have 20mb free. Also as the AGH binary is 35mb you will not be able to upgrade as it will run out of space.
Its detailed in my thread.
I've also added a usb stick in hopes I can direct logs there instead of anything else, I'm going to look if all possible to have the logs rotate into that and if not just create a cron job to do this and delete.
Base root is only 55.8 in total, how am I to get it to 100 when this is on the actual router? (don't want to repartition /tmp)
if you mount your usb stick as /opt you can install all of AGH directly onto the usb stick and thus not worry about space. just make sure you are in the /opt folder when you run the script.
Great idea. Was trying to edit my main to add the storage issue that came up after but for some reason am unable to do so - need to add there to use your suggestion to remove the opkg installed adguardhome, dumb down the retention and optionally add usb stick as /opt instead.
mount your usb as /opt and use my thread to install the manual version. Either install the stable or beta version (I suggest using the beta as they do fixes faster and its been stable for me and others.)
That way you don't need to worry about logs as your usb drive will have plenty of space for it all.
ahhh but this is where AGH trips you up. While the 107 branch is technically the stable release, fixes are rolled into the 108 branch and I know some were not back ported to 107. Technically AGH is really still beta in its workings thus why I recommend the 108 branch to use as that is the primary fix tree.
check the date and times of the files in those folders. In theory you should be able to purge them as they are left over from your attempt to install AGH directly on your router which is now not required as you have it on the USB key via /opt.