Ok, I’m attempting to clone the 500GB HDD in my Thinkpad to a 480GB SSD in an external USB enclosure.
While booted to live Linux Mint USB;
First, I shrank the main partition on the HDD with GParted so that the total size of all partitions would fit within the 480GB on the SSD.
Next, I ran the dd command to copy sda1(the HDD) to sdc1(the SSD) which was about 30GB and that completed without error. It filled the SSD with that partition, so I shrank it to 30GB with GParted so that the rest of the SSD is unallocated.
I then ran fdisk /dev/sdc and created a new 2nd partition on the rest of the SSD (sdc2) which showed up fine as ‘linux file system’ under fdisk -l.
Now, when I try to run dd to copy sda2 to sdc2, it runs and gets to about 4.1GB copied, then says; No space left on device and stops.
I’m not sure what the problem is or what I’m doing wrong. There’s definitely enough space on the SSD for the 2nd partition.
The HDD has an Arch Linux installation which I’m trying to clone to the SSD to swap into this device.
Thanks in advance.
EDIT: I was also using the following parameters with the dd command: bs=64K conv=noerror,sync status=progress
as per the Arch Linux wiki instructions for cloning partitions.
Don’t know if anything here will help you Mike, you might have already looked through it :https://forums.linuxmint.com/viewtopic.php?t=290781 There are also a few Youtude things on how to do so as well, but I am not sure if they’ll answer your question for you or not.
i ran into an interesting issue when cloning with gparted (not saying it was why your drive didn’t boot, just that i found the behavior odd/interesting) in that even when i chose what i knew to be my internal partition to boot (say sda3), i very clearly saw my computer boot into the external partition (sdb2 for example) as i watched the external drive light blink while running. this happened on my 32-bit machine as well when booting into the clone (sd3) that was originally sda5 (i was trying to consolidate). it got me wondering if there weren’t some kind of embedded info that pointed to the specific partition.
When dealing with cloning drives, I seem to run into the same flag that is turned off. The boot flag needs to be on and can be changed using gparted or kparted. I don’t remember which. Maybe someone with partition knowledge can pipe in with solid information.
I tried reinstalling the grub and running boot repair, but it wouldn’t let me past a certain point and I don’t know enough how to proceed past that. Thanks for the help though. Will keep this in mind for the future.
You should purge and reinstall GRUB2 using chroot. I used this method and it works, definitely. At first it might look scary if you have never done it, but if you follow the standard guide step by step, precisely, it is actually very easy to execute.
As far as I remember, I successfully omitted step 10. The instructions are also way shorter than they seem at first, as they cover a range of special cases. Omitting these, as most users would do, will make the process even easier.
When cloning a drive, I always make sure I shrink to well below the total of the new drive. Next I dd the entire drive and move all partitions in one hit. Then I expand the partitions to fill any vacant space.
If cloning only spacific partitions, I create a throwaway partiton (eg. sdc1 and sdc2 already exist so I shrink and create an sdc3 as a target) then I dd into it (eg. sda1 to sdc3) then resize as required. If there are more partitions, it’s rinse and repeat.