How to clone linux install in secure and private way

Greetings )
I just purchased second PC and i want to make two identical systems (so i can conveniently work on both).
First is Asus Tuf A17, second is GEEKOM A6 Mini PC
Is there any way to achieve this?
System Ubuntu 25.10

I am thinking how better do this. And if i use flash drive for this, i at least should format it with zeros after this, right?

If and when you do this, how do you plan to keep everything in sync between the two if you plan to use both for the same purpose for which you’re trying to clone?

I am using NAS for files. The nain issue is to move all custom configs and settings, scripts and privacy tweaks, because it is huge hassle to move them one by one.

Some of them was configured 2 years ago and i cannot even remember paths, so search and check will be waste of time

Besides it not being the best practice for various reasons (different hardware from system A to B, potential corruption of small files, etc…), it is also not simple to do on Linux unfortunately.

But a few ways to still achieve that:

  • you can use regular bash scripts that would cp, mv, apt install etc… all of your .dotfiles that you could store on a private Github repo :green_circle:
  • using something a bit more professional like Ansible, there is definitely a learning curve and it might be slow/quite some maintenance :yellow_circle:
  • by far the best but also hardest way to go, NixOS, this is literally the purpose of this distro and would guarantee you 100% integrity and reliability to have parity between both systems but it’s a huge investment (learning a new language to pretty much use your Linux distro) :red_circle:
  • a dirty way :-1:t2: would be to clone the entire Linux partition, but this is by far the dirtiest and worst way possible (yet, also quite simple). :skull:

The first one (.dotfiles) and some personal documentation looks like the most accessible way to go. If you’re looking for the simplest, and quickest way to go, this is the way.
I know it’s unpopular, but spending 4 hours copying things back and forth might be by far the most reliable and fastest way given all the other ways of cloning a system.

Also, if it’s only a matter of convenience to have your tools setup, it is not worth spending time learning actual sysadmin tools like Ansible/Nix…

2 Likes

What about Rescuezilla, and just clone the drive

Thing is, an OS is plenty of small files and the architecture/specifics of each system can make quite a difference regarding how system is built.
Cloning a partition into another one won’t produce a clean and stable system, especially in the long run and given how different OP’s devices are.

Well… Is there way to “clean” it after this approach?

Well… Should i look then for something more “matching” in hardware? For ex amd - amd, intel - intel etc

Not really.
I mean, it’s like having a shirt that you pass from one child to the other. It can fit but there is no way to make it work for both in a perfect way.

Again, does it even matter to have a clone? Isn’t copy-pasting just simpler and fine given your use case?

If you pass a shirt from a girl to a girl, it’s better indeed.
But still, everyone’s body is different and it will not be 100% parity.
But maybe it doesn’t matter?

YMMV but I think that I exposed all the available solutions above.
I’d say, give it a try and see how it goes for you. :+1:t2: