Hacker News new | ask | show | jobs
by codethief 2130 days ago
I'm not sure I'd ever want to replicate or clone my Linux install, including all hardware-related settings and all those applications that I installed at some point via apt and used only once or twice.

What I do need to replicate from time to time (whenever I deal with multiple machines) are 1) my data and 2) my settings / dotfiles. For the former, I use Syncthing (and of, course, backups because syncing can easily go wrong). As for the latter, I've been curating my dotfiles for ten years now and over time added various install scripts, which not only put the dotfiles in the right place but also install and set up the software they are for. One install script e.g. installs zsh, sets it as my default shell and creates a symlink from `~/.zshrc` to my zsh config. Basically, whenever I set up a new machine, I just need to run those scripts and I'm good to go within a few minutes.

1 comments

An example where such a clone is useful : I run Ubuntu 18.04 and wild like to switch to 20.04.

Since the 18.04 has a history of experiments more or less successful, I want to start from scratch.

I want to be able to rollback in case something goes wrong, but I have only one M2 drive for my system.

So cloning to an external drive, making sure I can boot from it and then delete the existing system gives me peace of mind.

I would counter that by suggesting that you create a second root partition (on which you then install Ubuntu 20.04) and remove the first partition (containing Ubuntu 18.04) when you're done. This is similar to how A/B upgrades work in recent Android versions. (Of course you'd have to have /home on a separate partition. Personally, I've been doing that for years, anyway, because I want to be able to reinstall quickly without overriding /home when a software upgrade happens to mess up my system.)