[Solved] Cloning Partitions On Same SSD - Help Needed

This forum is dedicated to advanced help and support :

Ask here your questions about advanced usage of Mageia. For example you may post here all your questions about network and automated installs, complex server configurations, kernel tuning, creating your own Mageia mirrors, and all tasks likely to be touchy even for skilled users.

[Solved] Cloning Partitions On Same SSD - Help Needed

Postby yankee495 » Feb 22nd, '20, 05:48

I have a fully functional Mageia 7 install on a 512GB NVMe SSD.
I can boot to another M7 installed on a second SSD so the 512GB NVMe isn't mounted. I can work on it from there.
I want a Mageia 7 install and Mageia Cauldron on the same SSD (256GB of space each).

Today, I used GParted to copy partitions from a 256GB NVMe to the 512GB NVMe in a USB enclosure.
I copied and pasted the partitions, then booted to a M7 DVD and reinstalled the bootloader on the 512GB. It worked and I'm familiar with this process.

Now I have a 512GB NVMe with M7 that's only half full.

My partitions are:

|_300MB EFI_| |__70GB /__| |__4GB swap__| |___165GB /home___| |____________238GB Free Space_____________|


I want to clone / and /home onto the same SSD so that I have two bootable M7 installs.
Then I'm going to change one of them to Cauldron repos.

I'm confused about what to do with duplicate UUID's on the same drive. I know I can generate new random UUIDs with GParted but I don't know what to do beyond that. How do I fix the bootloader so both will boot? I can figure out which I'm booted to once I'm in there but I think I need new UUIDs and to fix the bootloader.

Also, can the swap be shared between them? I assume on a fresh boot swap doesn't retain anything that's needed, but is only used on suspend etc.

I think I can use the EFI to boot, and share the swap, and clone only the / and /home.

Is that right or do I need to clone the swap too?
Last edited by yankee495 on Feb 22nd, '20, 23:08, edited 1 time in total.
There are 10 types of people, those who understand binary & those who don't.
Main Desktop
http://www.overclock.net/lists/display/view/id/3960066
yankee495
 
Posts: 433
Joined: May 25th, '12, 13:10
Location: Carthage, Mo. USA

Re: Cloning Partitions On Same SSD - Help Needed

Postby filip » Feb 22nd, '20, 12:54

Besides new UUID and added new entries to your bootloader you also need to adjust /etc/fstab file with those new UUID.

You assume right AFAICT that if you don't use suspend you can use the same swap.
filip
 
Posts: 475
Joined: May 4th, '11, 22:10
Location: Kranj, Slovenia

Re: Cloning Partitions On Same SSD - Help Needed

Postby yankee495 » Feb 22nd, '20, 23:07

Hello Filip, and thank you.
I took a break and used Google Maps to drive around Kranj, Slovenia. No kidding. It's like a vacation.

Ok, back to work.
I copied /, swap, and /home, just in case I want to Hibernate. I'll edit my first post to be correct (Suspend vs Hibernate).

All partitions are named nvme0n1pX where the PX is the partition number. So now I have:
Code: Select all
|_EFI_| |_/_| |_swap_| |_/home_|   |_/_| |_swap_| |_/home_|
  p1     p2      p3       p4         p5     p6        p7


I used GParted to copy the partitions and assign new UUIDs to the new /, swap and /home.

I rebooted to the original / and /home and everything went as expected. I set up the boot loader using MCC and it made boot to Mageia 7 on nvme0n1p5 as a boot option so I thought I was good. When I rebooted I found out I was booted to the original / on p2, not on the new / on p5.

MCC> Boot> Setup Boot System doesn't give you a chance to edit menu entries anymore, or the order. At least it didn't for me.
I used Grub Customizer and right clicked the Mageia 7 on nvme0n1p5 boot entry and sure enough, it had the UUID of p2, not p5.
I used blkid as root to get the IDs.

I used a Super Grub2 Disk to boot to p5, then ran Grub Customizer with p5 and p7 mounted and saved it.

Then I booted back to the original M7 on p2 and P4 and ran Grub Customizer and it fixed all of the UUIDs in the boot menu entries.
I wanted to do this with all Mageia tools to make it easier for the next user, but I took the quickest path to success, that I know.
I believe I could've edited the "Mageia 7 on nvme0n1p5 boot entry" with Grub Customizer and changed the UUID to the UUID of p5 and I wouldn't have needed the Super Grub2 Disk. I knew I could figure this out but I have been trying to post and share things for other users. New users are attracted by solutions.

Now I'm going to change my repos on p5 & p7 to be Mageia Cauldron. I'm using the end of the disk so I can wipe it out if need be and not fiddle with the first install and bootloader. I'll mark this solved and hopefully others will find it useful. Now..the next mug of coffee and on to Cauldron.

Thanks again!

Note: Grub Customizer has a "Change Environment" option where I could select the nvme0n1p5 partition. I wasn't sure if it would save to p5 or copy things from p5 to p2, so I didn't try it. If this in fact edits booting to p5 and stores all info for p5 on p5, then I may have been able to fix it right there while booted to the original M7 the very first time I rebooted after copying the partitions. If someone could verify how that option works it'd be a really nice shortcut.
There are 10 types of people, those who understand binary & those who don't.
Main Desktop
http://www.overclock.net/lists/display/view/id/3960066
yankee495
 
Posts: 433
Joined: May 25th, '12, 13:10
Location: Carthage, Mo. USA


Return to Advanced support

Who is online

Users browsing this forum: No registered users and 1 guest

cron