TransWikia.com

Clone Ubuntu and Windows to new SSD

Ask Ubuntu Asked by Yogi Katba on November 15, 2020

I want to switch to SSD from HDD. I have dual boot on my hp laptop. My C drive in Windows and Ubuntu / directories have less size than new SSD.

But the whole HDD is of 1 TB and SSD of 240 GB. I am putting my SSD inside laptop using hard disk candy into the CD/DVD slot. And I’m not planning to use the DVD port for DVD again.

How can I clone both systems (only C drive + Ubuntu /) without reinstalling everything if that’s possible? I want to use SSD for the operating systems and the old HDD for storage. Noob here. Thanks in advance.

One Answer

  • Connect both HDD and SSD to the PC.

  • (optional) Boot Windows installation, install drivers for SSD, shutdown.

  • Boot PC from live cd/usb (Ubuntu will be ok).

  • Open gparted. Resize all partitions to smallest possible size, but leave around 100 mb of free space on each one. And move partitions closer to "left border". Apply this operation.

  • Open terminal. Detect which drive is your HDD and which one is SSD (see cat /proc/partitions)

  • sudo dd if=HDD_DEVICE bs=1M of=SSD_DEVICE - it will take some time

    (for example: sudo dd if=/dev/sda bs=1M of=/dev/nvme0n1)

  • sudo partprobe SSD_DEVICE (for example: /dev/nvme0n1)

  • Probably, you'll need to expand partition table and file systems again, so you can use gparted again.

  • Shutdown. Remove HDD.

  • Try to boot again.

Next:

  • If everything looks ok, you can connect HDD, format it, and use as you wish.
  • OR Change UUIDs of HDD file systems: tune2fs /dev/sda1 -U random /dev/sda1 (probably the same for sdb if you have, etc). But don't do this with your SSD!

This operation is potentially dangerous. Be attentive with device names you're using!

Answered by Ihor Drachuk on November 15, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP