Okay, so I want to do something stupid and I’d like the input of smarter people to make sure I don’t screw it up. This is what I’ve got:

p1: EFI partition, p2: Linux install, p3: /home partition, p4: other Linux install, p5: another Linux install. Long story.

I use the third install (on p5) exclusively now. I want to clean up the mess seen above by moving it to p2 (currently occupied by the first install), and removing p4 and p5. What I thought I’d do (on a live USB) is:

  1. Overwrite p2 with the data of p5. (probably with rsync?)
  2. Edit fstab on p2 to change the UUID of the root partition to the new one.
  3. Try to boot from p2
  4. If it works, remove p4 and p5

Would that work the way I want it to? Anything obvious I’m missing?

  • Melmi@lemmy.blahaj.zone
    link
    fedilink
    English
    arrow-up
    12
    ·
    edit-2
    1 year ago

    I’ve done this before, it’s definitely a bit of a hack but it went without a hitch for me. Depending on your bootloader you’ll probably have to edit/regenerate your bootloader config as well.

    Good call on rsync, just make sure to use the right flags. I’m on Arch so I used the command from the Arch page on full system backup using rsync, but it should work for any distro.

    • damium@programming.dev
      link
      fedilink
      English
      arrow-up
      2
      ·
      1 year ago

      When rsync copying the active root I like to bind mount / to /mnt/root_fs first. This avoids the issue with needing to exclude folders with sub-mounts and will expose files to copy that might be hidden by the mounts.

  • TedvdB@feddit.nl
    link
    fedilink
    English
    arrow-up
    11
    ·
    1 year ago

    I think your idea is pretty much correct. One step that might be missing is updating your boot loader to boot into the correct partition, depending on your configuration.