Cloning a gargoyle install?

Suggest improvements and new features for Gargoyle.

Moderator: Moderators

Post Reply
rockyd
Posts: 131
Joined: Tue Oct 22, 2019 5:49 am

Cloning a gargoyle install?

Post by rockyd »

Has anyone tried cloning a Gargoyle install?

Specifically for restoring a crashed install to a state before whatever change caused the crash. By crash I mean router appears to be function according to lights, but I cannot get the login screen to appear. My solution is factory reset, and either a heap of reconfiguring or restoring a backup, which often still leaves out few tweaks, openvpn usually needs new configs to be downloaded and installed on devices, plugins aren't included in the back up either.
I have learnt how to add some of my tweaks to the backup so that should lessen that. But then I thought why not just clone the whole thing and be sure everything is captured.

Cloning would hopefully get me back to where I was before the router crash with hopefully no messing around.

Would it be as simple as copying every folder and file?

pythonic
Posts: 268
Joined: Mon Mar 11, 2019 5:47 am
Location: Australia

Re: Cloning a gargoyle install?

Post by pythonic »

While you could copy everything, you will only want to restore from the "clone" files that have been changed since the last flash otherwise you're going to consume unnecessary overlay filesystem space with "clones" of existing files in the squashfs root filesystem - possibly to the point of exhausting the overlay filesystem space. You will also need sufficient storage space to create the "clone" in the first place, and then hold the "clone" until you've validated either the tweak or a successful restore from the "clone".

The above concerns may not apply, or be unmanageable, on targets where extfs is used for the root filesystem and/or there are significant amounts of available RAM and storage - e.g. x86 and bcm27xx.

Lantis
Moderator
Posts: 7195
Joined: Mon Jan 05, 2015 5:33 am
Location: Australia
Contact:

Re: Cloning a gargoyle install?

Post by Lantis »

As well as the above, restoring plugin files may not be sufficient to activate the plugins themselves and the system would not necessarily know they are present/installed leading to other complications.

A much more clean suggestion, learn the build environment and customise your own build to have the plugins you want pre installed and the modifications pre-done as well.
You could even have your network preconfigured etc etc.
https://lantisproject.com/downloads/gargoylebuilds for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.
https://lantisproject.com/blog

rockyd
Posts: 131
Joined: Tue Oct 22, 2019 5:49 am

Re: Cloning a gargoyle install?

Post by rockyd »

pythonic wrote:
Sat Nov 22, 2025 9:51 pm
While you could copy everything,
So copying everything to a computer using WinSCP, then copying it all back, once router was in a usable state could work? Maybe after deleting everything first?

A further thought was wonder how you make a custom sysupgrade file. Which is where Lantis post may be leading

rockyd
Posts: 131
Joined: Tue Oct 22, 2019 5:49 am

Re: Cloning a gargoyle install?

Post by rockyd »

Lantis wrote:
Sun Nov 23, 2025 2:16 am
A much more clean suggestion, learn the build environment and customise your own build to have the plugins you want pre installed and the modifications pre-done as well.
You could even have your network preconfigured etc etc.
Love to be able to do that, no idea how to though.

With the backup idea, I had in the other post.
Any ideas on how to find all files that have changed since factory reset, played with grep a bit I think I found the file that contains the Lantis repositories, still need to find the plugins and what ever files that have changed to make the plugins work.

Then will have to do the same with OpenVPN

This is why the clone idea came to mind.

rockyd
Posts: 131
Joined: Tue Oct 22, 2019 5:49 am

Re: Cloning a gargoyle install?

Post by rockyd »

rockyd wrote:
Sun Nov 23, 2025 3:56 am
So copying everything to a computer using WinSCP, then copying it all back, once router was in a usable state could work? Maybe after deleting everything first?
What about changing the create backup file to backup all the root folders and subsequently all the files in them. Wouldn't restoring the backup overwrite existing files. If I knew which folders, would not have changed file in them, then obviously they could be left out. I am guessing this can't be done, because you would need basically twice the storage the current install take up. Which is probably what pythonic was saying.

rockyd
Posts: 131
Joined: Tue Oct 22, 2019 5:49 am

Re: Cloning a gargoyle install?

Post by rockyd »

Apparently
find . -type f -mtime -7

will list files that have changed over the last 7 days.

all 41092 of them.

Will have to do that after I install a plugin

Apparently
find . -mmin -10
works in Linux to find files changed over 10 minutes but not in Gargoyle.

Lantis
Moderator
Posts: 7195
Joined: Mon Jan 05, 2015 5:33 am
Location: Australia
Contact:

Re: Cloning a gargoyle install?

Post by Lantis »

As pythonic pointed out, your device uses an overlayfs style image, which means that the base filesystem is readonly, and any new changes, modifications or deletions are written to a filesystem that runs over the top.

So to delete a file doesn't actually save you space, as you are now writing a "delete record" to a new filesystem.
So to overwrite all of your files you are occupying at least twice the space (probably more due to overheads).

OpenVPN you should only need to save everything at /etc/openvpn/.

Building your own image is reasonably straight forward. I always recommend that you start simple first, build an unaltered Gargoyle build just to make sure that your build environment works.
Then we can iterate through making changes.
For you that means following https://github.com/ericpaulbishop/gargo ... the-source
"Get the source" through to the end of "Building Gargoyle", where your "target" is "mvebu.default".
https://lantisproject.com/downloads/gargoylebuilds for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.
https://lantisproject.com/blog

Post Reply