I installed a new ssd drive in my computer and want to move my current ubuntu partition to that drive. I plan to use clonezilla to move the partition but I have a few questions that remain:
When I check my current ubuntu partition using Gparted, I find not 1 but 3 and that is where I am unsure how I should handle them: sdc4 which is the parent of sdc5 (ext4) and sdc6 (swap).
Another thing that puzzles me is that only the partitions sdc5 and sdc6 shows up with the command blkid on the terminal. Sdc4 is not there.
So what partition should be cloned?
Moving Ubuntu partition to another drive
Here is a method of copying your Ubuntu to a SSD that will boot in either BIOS or UEFI mode. (This could be handy if you ever upgrade your Windows disk to UEFI).
Download the mkusb ISO boot template: https://phillw.net/isos/linux-tools/uefi-n-bios/dd_grub-boot-template-for-uefi-n-bios.img.xz
Flash the image to the SSD using Rufus, Etcher, mkusb, Disks, dd, etc. This will overwrite everything on the new SSD.
The SSD will now have a 1MB bios_grub boot partition and a 250MB boot,esp partition and a lot of unformatted space.
There is no need to copy the extended partition and the swap partition can be created new.
Copy /boot/grub/grub.cfg from Ubuntu on the old disk and paste it into /boot/grub/ in the new boot,esp partition overwriting the one there.
Edit /boot/grub/grub.cfg in boot,esp to confirm the boot path. ie your
hd0,msdos6
may now behd0,gpt3
. I useFind and Replace
to change all instances ofmsdos
togpt
in the menuentry.The new UUID should be the same as the old. You can change the partition UUID on the new SSD using GParted. This is necessary if you plan on keeping both Ubuntus
If there are any doubts when editing grub.cfg you can boot the old Ubuntu and run
sudo update-grub
with the new drive plugged in. This will automatically create a correct new menuentry that can be used when updating the new SSD GRUB. Best to change the UUID as above first.