19
submitted 1 year ago by Herbstzeitlose@feddit.de to c/linux@lemmy.ml

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?

top 3 comments
sorted by: hot top controversial new old
[-] melmi@lemmy.blahaj.zone 14 points 1 year ago* (last edited 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 1 points 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 12 points 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.

this post was submitted on 02 Sep 2023
19 points (100.0% liked)

Linux

48033 readers
962 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS