Move AdGurard To USB Drive

My original procedure was only to move only the /etc/AdGuardHome/AdGuardHome program to the USB drive, which is why the original symbolic link is “program-to-program”:

cd /etc/AdGuardHome
ln -s /mnt/usb_drv/AdGuardHome/AdGuardHome ./AdGuardHome

This does not work when you move the entire /etc/AdGuardHome directory to the USB drive, which is why the new symbolic link is “directory-to-directory”, as in Post 35:

cd /etc
ln -s /mnt/usb_drv/AdGuardHome ./AdGuardHome

If you are sure you completely copied /etc/AdGuardHome to /mnt/usb_drv/AdGuardHome, then you have to delete the original /etc/AdGuardHome directory (or rename it with the mv command above).

No /etc/AdGuardHome can exist in /etc or the symbolic link cannot be created because it has the same name. It is not enough to “delete everything in /etc /AdGuard apart from the symbolic link”. The /etc/AdGuardHome directory itself and the symbolic link(s) you already created have to be deleted, as I indicated.

OK nothing exists in the directory /etc/AdGuardHome
image
using this symbolic link
ln -s /mnt/usb_drv/AdGuardHome ./AdGuardHome
every thing is on the USB and it still don’t up-to-date BUT it still blocks adds and Blocked services, BUT don’t update blocklists

You still did not create the symbolic link correctly. You did not remove the /etc/AdGuardHome directory first and have created the symbolic link WITHIN that directory. The /etc/AdGuardHome must be deleted or renamed first:

cd /etc
mv ./AdGuardHome ./AdGuardHome.SAVE
ln -s /mnt/usb_drv/AdGuardHome ./AdGuardHome

Afterwards, /etc/AdGuardHome wil only be a symbolic link, not as a directory.

Can you copy&paste and run each command in SSH, then post a screenshot to show all 3 commands?

1 Like

I’ve had a good go at this and with the SSH command
ln -s /mnt/usb_drv/AdGuardHome ./AdGuardHome
this causes a symbolic link to the folder AdGuardHome but does nothing
the symbolic link ln -s /mnt/usb_drv/AdGuardHome/AdGuardHome ./AdGuardHome
WORKS but you must put the data folder with the symbolic link
image

Sorry for the delay I did follow your very good and easy to understand instructions.
Here is my detailed step by step
first SSH in
cd /etc

Then
mv ./AdGuardHome ./AdGuardHome.SAVE

This put the .SAVE on the original AdGurard directory.
Then
ln -s /mnt/usb_drv/AdGuardHome ./AdGuardHome

This put a symbolic link directory and all the files appeared in it.

At this point everything was working UNTIL I rebooted the router afterwards the AdGurard menu was showing under Applications, went into AdGuardHome noticed no statistics showing, clicked on settings and page was not found (http://192.168.8.1:3000/).
The USB and AdGurard directories were fine I also check the cd /etc still showing fine as above, I also checked in /usr/bin/AdGuardHome to make sure nothing had happened to the original symbolic link.

At this point I tried to reverse the first operations, deleted the symbolic link directory, removed the .SAVE at the end of the original AdGuardHome directory rebooted, at this point whatever I tried I could not get AdGurard to work, so I reloaded the firmware and settings and it worked fine with AdGurard back in cd /etc.

I tried this three times same result every time.

I did think the symbolic link was not pointing at the USB but that would not explain why I could not restore it back.

Has anyone else using an GL-AX1800 had trouble attempting to use symbolic links as I read on another website that in certain circumstances symbolic links can fail to work, if you read my posters you will see that every attempt to move AdGuard home to a usb fails and resorting the original symbolic links to put things back as per factory defaults still don’t work only restoring the firmware achieves this.
The kind person helping me thinks it’s me, but I’ve tried as much as I can with the knowledge I have.

Hi, I’m New

So i guess no one succeeded in moving adguard anywhere ::

…and here, I was having crazy idea of installing some LZ4 app and extract zipped adguard on RamDisk and run such a critical app ONLY from there (while only saving configuration on flash disk and that too with compression)

Hi and welcome, you guessed write no i could not get the symbolic links to work i even tried changing the default symbolic link at cd /usr/bin i restarted the router every time, but the real strange thing is backing up the original symbolic link and putting everything back it never works again that is AdGuard only way is to reinstall the firmware i even run a command ls | awk ‘{printf(“%s ->”, $1); system("readlink -f " $1)}’ that shows what the symbolic link path.
The bottom line is i would rather of paid a little more and had a decent Internal Flash Storage to start with, because even with a fresh firmware its practically half gone to start with.
Anyway i just keep an eye on how large AdGuard gets and keep its size down.

I successfully moved AdGuardHome to SD card on my GL-MV1000W Brume and to USB drive on my GL-AR300M16 Shadow. Both AdGuardHome work after rebooting the routers.

I do not work for and I am not directly associated with GL.iNet

1 Like

Works first time on my GL-MV1000W as well but sadly not the GL-AX1800
using this method
mv ./AdGuardHome ./AdGuardHome.SAVE
ln -s /mnt/usb/AdGuardHome ./AdGuardHome

I know this is off topic. What does AdguardHome offer that adblock doesn’t?

I’m really new to openwrt; my experience has mostly been with Asus Merlin so dns poisoning is familiar and adblock was no stretch. I’ve had no issues adding it to my Mango & Beryl.

Here is one person’s opinion on Adguard vs Adblock:

I do not work for and I am not directly associated with GL.iNet

Moving AdGuardHome to SD card or USB drive may not actually save much internal storage space.

If the AdGuardHome package is built into the firmware, then the ~18MB program cannot be deleted from /rom and the /etc/AdGuardHome/AdGuardHome program is a “virtual” /rom copy. If you try to move it to SD or USB, then it becomes a “physical” /rom copy without saving internal storage.

On my GL-MV1000W Brume, it turned out that AdGuardHome 0.104 is built into firmware 3.203, but AdGuardHome 0.103 is also physically installed in /etc/AdGuardhome. This mean 2X internal storage is wasted since I do not run it in production on the router anyway.

I do not work for and I am not directly associated with GL.iNet

I tried Adblock when I borrowed an Asus router and it had no blocked services as far as I could tell, AdGuard does have almost all the services, also works really well, I used P.I. Hole for about three years and that blocked too much and broke a lot of websites, AdGuard I’ve never deactivated it and works brilliantly, and has a nice interface as well to boot, but don’t like being moved on a GL-AX1800.

How to move AdGuard to SD on AXT1800 Slate.
After inserting microSD, it was mounted as /tmp/mountd/disk1_part1. For example, we don’t want to keep AdGuardHome directory in /etc at all, we want everything to be stored in

/tmp/mountd/disk1_part1/AdGuardHome directory

a) Modify symlink /usb/bin/AdGuardHome to point to /tmp/mountd/disk1_part1/AdGuardHome/AdGuardHome

b) Modify the script adguardhome in /etc/init.d./adguardhome and replace all paths /etc/AdGuardHome with /tmp/mountd/disk1_part1/AdGuardHome as shown below

Now, AdGuardHome will store all data on microSD (I have done that mostly for keeping the log of DNS requests), the easiest way to check that is to check for updates of filters in the AdGuardHome GUI and after that look at the timestamp of the files in the /tmp/mountd/disk1_part1/AdGuardHome/data/filters directory.

Step ‘a’ can be omitted if one creates a symlink /etc/AdGuardHome pointing to /tmp/mountd/disk1_part1/AdGuardHome.

I hope this helps.

2 Likes

To simplify for all USB users, this one worked for me:

cd /etc
mv ./AdGuardHome ./AdGuardHome.SAVE
(copy files from /etc to /disk1)
ln -s /tmp/mountd/disk1_part1/AdGuardHome ./AdGuardHome
1 Like

Hi just noticed your post I have been trying unsuccessfully to put AdGuard on a microSD I have changed the symlink to

/tmp/mountd/disk1_part1/AdGuardHome ./AdGuardHome

But noticed you had no ./ in your link

/tmp/mountd/disk1_part1/AdGuardHome/AdGuardHome

Is that correct using WinSCP I can delete and add files using the symlink with the ./ code but I have not edited the init.d./adguardhome either only to force the upgrade of AdGuard Home.
Is this why my AdGuard isn’t working because I have not changed the parths in the init.d./adguardhome, I’m using a GL-AXT1800 Slate AX by the way my old flint just had the symlink changed but that was on USB and used the ./ as well in the symlink.
Thanks

Would this work with the SD?