I have a simple wish, with a probably not so simple solution.

I recently started with linux (Arch kde), I’m loving it, I quickly realized that this OS and almost all apps, are highly customizable, I’m laving that as well. My problem is the unavoidable reinstalls and that I have a laptop.

Is there any way that I can save all my configs, apps and my apps’ configs, and transfer them over to my laptop, while almost having a very quick back-up. I realize that I could turn it into an ISO somehow, but that wouldn’t work (I think) because my laptop has vastly different hardware. I also realize the partitioning problem. So in my idealistic world, there should be a solution that requires a clean install (from scripts or manual) and some .sh file, that installs all my apps, pastes all my configs and reboots.

So is this possible? and if yes, how should I go about this? did someone make a tool for this already? Or(!) can I burn it to a flash and the drivers will correct themselves/I’ll deal with them later?

For final words I’d like to say that I’m far from finished configurating, but I’d like to know the proccess, to not shoot myself in the foot somewhere along the way of configing, thanks!

  • @bizdelnick@lemmy.ml
    link
    fedilink
    242 years ago

    Reinstall? Why?

    Create a separate partition for /home and don’t format it when reinstalling, so you will keep all your stuff.

      • @30p87@feddit.de
        link
        fedilink
        22 years ago

        I just copied my whole root partition to a new Laptop over netcat. It still has close hardware (Intel CPU, no extra GPU, etc.), but some differences in interfaces etc.

        Things one might have to consider:

        • /etc/fstab will need to be redone
        • All interfaces changed, so network configs may need to be updated
        • Other programs relying on hardware or paths that don’t exist anymore need to be updated (eg. conky did not work due to i8k being not supported, other interface ids etc.)

        But literally nothing that would break anything. Because Arch is usually installed manually, one knows what needs to be cared for, what could break or could cause certain issues.

    • Analyzing your comment in a different light. What your saying is if I copy my /home (someone said /etc too) over to my laptop, and back it up as well, I’m golden?

      would different hostnames and usernames make a problem? As far as my knowledge goes it won’t as long as I also bring /etc over, but I have no Idea if /etc is connected to something deeper or not.

      And also also, might seem like a dumb question but I had to edit a file to automount my other disks at startup, won’t it like break everything if my system only gets /home after boot or something? Caz I have enought free space to copy over my existing /home, delete it, partition, and mount it back. What’d the benefits and dangers be?

  • @iopq@lemmy.world
    link
    fedilink
    152 years ago

    There’s a distro called NixOS that is created for this purpose. It also has a tool called home manager that will manage your dot files for you. Once you back up like two or three configuration files you can recreate your system (minus any actual data)

    When you do this in Arch there’s no guarantee you get the same package versions and there’s no guarantee everything works

    • Lupec
      link
      fedilink
      6
      edit-2
      2 years ago

      To add to this, another viable path is using Nix, the package manager, on its own. That way you can get Home Manager to manage your applications and dotfiles independently of your base system, as long as you are able to install Nix.

      It’s my general workflow, run Determinate Nix Installer, install Home Manager, clone my config and I’m off to the races. Been sharing that config between Debian, Ubuntu on WSL and Bazzite for a while and it’s served me well so far.

  • @TechAdmin@lemmy.world
    link
    fedilink
    English
    102 years ago

    For the OS side a few ways.

    • Clone & then rename+change drivers
    • Ansible/chef
    • NixOS

    For home folder side of things a dotfile manager, cloud services, and file sync tool will take care of most things. I use chezmoi for dotfiles & nextcloud for file syncing. Firefox is only cloud synced service I still use for now. I have yet to find any decent sources of information on dotfiles so gonna be stuck going through those stupid things to figure out what you want to sync.

  • @cerement@slrpnk.net
    link
    fedilink
    82 years ago

    heading in a completely different direction that what you were aiming for, but the declarative distros (currently a subset of immutable distros) like NixOS and Guix are trying to solve just this sort of issue – their main focus is on dealing with development environments but a lot of people have been enjoying them on desktop environments as well

    ex. with NixOS, your entire system configuration is stored in one master config file /etc/nixos/configuration.nix (that you can optionally keep synced with git) – the main config can be modularized (ie. break out the hardware definitions into its own include so you can still use the master config on both desktop and laptop) – and Nix has been making big strides with Home Manager, their own way of being able to collect and define all of your home directory config files and theming

    currently, NixOS is not for the faint-of-heart, documentation (both quality and lack of) regularly gets critiqued – NixOS and Nix package manager are all configured in the Nix language, a functional language used nowhere else

    Guix comes out of the GNU project so dealing with proprietary drivers is harder than it needs to be – Guix is configured in Guile Scheme

    • You’re not the only one who mentioned NixOS. But you warned me about the quality. Thank you.

      Also, I’d really not want to switch of my current system. I already have data, configs and everything. I probably could re-do it in days, but seems like a lot of struggle to use a worse distro in the other 99% of the time when I’m not thinking about moving configs to my laptop.

      • @iopq@lemmy.world
        link
        fedilink
        32 years ago

        It’s a better distro, not a worse one. This is because it has easy rollbacks, upgrades, etc. You never get stuck with a broken system since the previous state is in another entry when you boot. You only need to hit down arrow and enter to go back to the previous configuration even if you can’t boot right now

  • @KISSmyOS@lemmy.world
    link
    fedilink
    62 years ago

    I think you could install your system using a generic kernel, package it up as ISO and just boot it on basically any other machine with the same architecture. Proprietary bits like NVidia driver and firmware could pose a problem.
    That’s basically what a live USB is.

  • dblsaiko
    link
    fedilink
    6
    edit-2
    2 years ago

    mkstage4 is exactly for this. It’s basically just a wrapper for tar which excludes unneeded directories for you already.

  • @tvcvt@lemmy.ml
    link
    fedilink
    52 years ago

    You could likely use dd or clonezilla to create a duplicate of your boot drive and boot your laptop right from that, but that’s not quite what you’re after.

    There are some distros lately that use a declarative config file to set the whole thing up that I think is much more what you have in mind. The big ones that come up a lot are nixOS and Fedora Silverblue. Maybe one of those systems would be to your liking.

  • @alt@lemmy.ml
    link
    fedilink
    4
    edit-2
    2 years ago

    I don’t know by heart if it’s able to do your bidding, but perhaps it’s worth checking out penguins-eggs. I guess the following would be its elevator pitch:

    "penguins-eggs is a console tool, under continuous development, that allows you to remaster your system and redistribute it as live images on usb sticks or via PXE.

    The default behavior is total removal of the system’s data and users, but it is also possible to remaster the system including the data and accounts of present users, using flag --clone. It is also possible to keep the users and files present under an encrypted LUKS file within the same resulting iso file, flag --cryptedclone.

    You can easily install the resulting live system with the calamares installer or the internal TUI krill installer."

  • @Drito@sh.itjust.works
    link
    fedilink
    4
    edit-2
    2 years ago

    There is a pacman command that prints the list of all packages installed by users. I don’t remenber the command sorry but you’ll find that here:

    https://wiki.archlinux.org/title/Pacman/Tips_and_tricks

    Its probably “pacman -Qe”.

    Then it should be easy to create a script that install all that automaticcally. If your are cautious you should have a backup of your home anyway on some storage device .

      • Limitless_screaming
        link
        fedilink
        4
        edit-2
        2 years ago

        Unfortunately not every app follows that convention. A lot of them just dump config files into your home directory, including Firefox.

        There’s a script called XDG-Ninja that can list some of the apps that do that. You can probably get it from the AUR

      • @Drito@sh.itjust.works
        link
        fedilink
        3
        edit-2
        2 years ago

        Sorry I edited my post, I was wrong.

        .config stores many apps settings. But unfortunately some apps stores that directly in ~ as hidden files and directories. Personnally I make a backup of my whole home.

  • @taladar@sh.itjust.works
    link
    fedilink
    42 years ago

    Usually with most Linux distributions you can just make a tarball of the entire system (don’t forget the p to preserve ownership,…) and unpack it to a new partition, install the boot loader again and it should work on a new system, as long as the kernel does work with the hardware on the new system. Alternatively you can reinstall and keep your home directory to keep all your user config.

  • @flashgnash@lemm.ee
    link
    fedilink
    12 years ago

    NixOS and to a lesser extent nix package manager is great for this. Write a config for your entire setup, which will take a long time, but then you can carry that config with you through any and all future machines, and have every one of them setup just the way you like from the beginning

    I would highly suggest using NixOS for something like this, however if you don’t want to/can’t the following should apply to pretty much any other distro

    Most applications in Linux save their config in ~/. config/ or ~/.configname , if you copy these files and directories over to your new machine all your old settings should persist (this won’t copy applications themselves but will copy their settings for when you reinstall them)

    (though be warned this is a messy way to do it if you just copy absolutely everything without thinking, some settings you probably don’t want copied over)