9

I'm planning on replacing my laptop's HDD with a 256GB SSD, but I have a dual-boot (12.04 and Windows 7) setup and I'd like to be able to directly migrate Ubuntu over without having to reinstall and lose all of my settings. GParted reports the following partition setup on my HDD. I am, of course, able to modify it if necessary.

/dev/sda1 (NTFS) 66.92 out of 200.00 MB used

I'm honestly not sure what this partition is for. Maybe for Windows 7 system files? I'm hesitant to mess with it. (edit; it turns out it is a partition for Windows recovery files in the event of OS corruption, so I don't want to remove it. Plus it also appears to be a major pain to remove anyways)

/dev/sda2 (NTFS) 116.35 out of 339.06 GB used (boot)

This partition is the C:/ drive on my Windows installation. I don't use it on my Ubuntu installation, except it is the boot partition and thus has grub on it.

/dev/sda4 (extended)
> /dev/sda5 (ext4) 14.49 out of 91.34 GB used
> /dev/sda6 (linux-swap) 5.92 GB 

These are my Ubuntu partitions. /sda5 contains my documents and all of the files I use on Ubuntu, and (as far as I know) the system files for Ubuntu itself (it's the partition I created when prompted by the Live-DVD installer). /sda6 is, of course, the swap partition which I only need for hibernation (6GB of RAM).

/dev/sda3 (NTFS) 9.89 out of 14.75 GB used

This is an annoying partition that Lenovo created to store some drivers and files that I might need later on. For example, it allows me to use OneKeyRecovery for a quick factory recovery if absolutely necessary, not sure if that'll work on an SSD. It also contains not-so-important files for bloatware installation.

In total, my HDD only has about 150GB of files on it so it should fit comfortably on the SSD. The problem is, I want to exactly migrate my files, partitions, OSes, MBR, etc. from my HDD to my SSD and I'm not quite sure how to do this. I've seen CloneZilla referenced before, but I'm not all too experienced and the documentation for it quite frankly seems a bit like a foreign language to me. So, put simply, is there any way I can exactly clone this HDD to an SSD without a massive headache? Also, if it matters, I'll probably be using an external hard drive case (as recommended in online tutorials) to externally attach the SSD to my laptop during the cloning process due to the lack of two hard drive slots in the machine.

5 Answers 5

5

Since you are moving from a large HD to a smaller SSD, you will need to copy partitions rather than "clone" the original hard drive.

Regarding the use of Clonezilla and "the documentation for it quite frankly seems a bit like a foreign language", have you seen the following two references? Both indicate how to resize the HD partitions, and copy the reduced-size partitions to the smaller SSD.

How to Clone Hard Drive to Smaller Drive http://geekyprojects.com/storage/how-to-clone-hard-drive-to-smaller-drive/

Replacing A Disk With A Smaller One Using Clonezilla Live http://preview.tinyurl.com/cnjm6yg

For me, the "foreign language" came in the form of Clonezilla's interface. I have never seen so many error/warning messages and had to fight my way through multiple text-based menu screens. However, the good news is that, once you have prevailed with the setup procedures, Clonezilla actually works flawlessly.

Finally, be prepared to use a Windows Recovery Disk to reset the MBR (since Windows seems to object to partitions being moved around) and perhaps also Rescatux (http://www.supergrubdisk.org/rescatux/) to re-establish the GRUB menu after Windows "thinks" it is back in control.

1
  • quick question: will simple cloning work for a dual boot system? making it a separate question might make it a target for the label duplicate.
    – MycrofD
    Aug 28, 2016 at 17:49
1

You should use Clonezilla Live. It's sort of like the Linux equivalent of Norton Ghost. Just boot off the CD and make an image of the entire disk onto an external hard drive. It does not matter what O/S you are trying to backup or restore. It will take a "snapshot" of the entire disk and lay it back down onto the new disk. It is very useful for whole-disk recoveries when disks sizes may have changed.

1
  1. Make separate images of your partitions to an external usb disk using Clonezilla.
  2. Format your SSD disk and create at least one partition (ntfs).
  3. Copy the image of your windows partition on the SSD disk. Restart the computer.
  4. Install fresh ubuntu beside windows. Restart the computer.
  5. Copy the image of your ubuntu partition on the new ubuntu partition (overwrite it).
  6. Now you can resize or create new partitions with Gparted.
1

Clonezilla allows you to fit the drive data to a smaller drive if there is enough space.

Read the following Question and Answer taken from the "FAQ/Q&A for DRBL and Clonezilla" web page:

Is that possible I can restore to smaller HDD when the image was taken from bigger one? Or to clone a larger disk to a smaller one?

This is always a challenge to Clonezilla because it's block-based tool, not file-based one.
Two possible solutions:

  1. Method 1: If you are sure the used data blocks on the source disk are within the disk boundary of destination one, yes, it's possible to make that with the options "-k1" and "-icds" enabled in the expert mode.
  2. Method 2: Use Clonezilla live >= 2.6.7-28 or 20200703-focal. For older version it does not always work.
  • First use GParted live to resize and move the partitions in the source disk, and make all partitions to be equal to or smaller than the size of that in the destination disk. You have to make sure the boundary of last partition in the source disk is within the limit of destination disk.
  • Then boot Clonezilla live.
    For disk to disk, follow this.
    For image to disk, follow this.
    The only difference is, just remember to choose expert mode, and enable "-icds" (while do not choose any option about "-k*").

You might have to re-install GRUB2 once the cloning process is finished.

0

Recently I faced the same problem. I managed to solve the problem using below method.
Warning: please create a backup if you aren't aware of what you are doing. Since, we are manipulating grub. If there is some error grub, you won't be able to boot into the system.

Since, our main focus is to shift Windows + linux from one disk to other. So, firstly make a clone of all the necessary partition on SSD.

Device             Start       End   Sectors   Size Type
/dev/nvme0n1p1      2048   1023999   1021952   499M Windows recovery environment
/dev/nvme0n1p2   1024000   1228799    204800   100M EFI System
/dev/nvme0n1p3   1261568 312763164 311501597 148.5G Microsoft basic data
/dev/nvme0n1p4 312764416 314572799   1808384   883M Windows recovery environment
/dev/nvme0n1p5 314574848 666136575 351561728 167.6G Linux filesystem

This is my SSD partitions. Window + linux partition. So try to clone all the partition except the other unnecessary partition like D:// or E:// or other.
NOTE: for Cloning you can use Macrinum software. Free version will work for this case.

Now, we have ssd with all the necessary partition(Window + linux + other). So, we just need to add entries in grub for new OS in other drives. Boot to linux and try updating grub using command update-grub in terminal. And, try to reboot the system. Usually this fix the problem.

But, there exist a problem. In my case, when I was trying to enter the SSD partition from the Grub entry during boot. I was facing a problem that it was booting with HDD instead of SSD. The main reason behind this UUID. Since, we are cloning HDD so the new SSD partition have same UUID. It creates a problem as grub confuses which partition to use as two partition have same UUID.

So, we will change the UUID of linux partition in SSD using tune2fs.[https://unix.stackexchange.com/questions/12858/how-to-change-filesystem-uuid-2-same-uuid][1]

Now, we have unique identification of partition. Again, try to upgrade grub using update-grub.

You can use grub-customizer tool in linux for manual modifying the entries of grub. This solved my problems.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .