0

I'm migrating from Windows to Linux but I have to keep a working Windows installation for backup. The source HDD is this:

$ sudo fdisk -l /dev/sdd
Disk /dev/sdd: 465,78 GiB, 500107859968 bytes, 976773164 sectors
Disk model: SDSSDH3500G     
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: <ID>

Dispositivo Start Fine Settori Size Tipo /dev/sdd1 2048 206847 204800 100M EFI System /dev/sdd2 206848 468991 262144 128M Microsoft reserved /dev/sdd3 468992 430548991 430080000 205,1G Microsoft basic data /dev/sdd4 655828992 976771071 320942080 153G Microsoft basic data

I want to clone the first three partitions only to another HDD, preserving everything is needed to boot the O.S.

The easiest solution would be to clone the whole HDD and then remove the fourth partition, but unfortunately the destination HDD is too small.

Clonezilla doesn't allow to select which partitions to copy, unless you clone one-by-one, but for the reasons above I really don't want to create the partition structure manually.

In Cloning multiple partitions in Ubuntu and Is there a way to DD multiple partitions into one raw image file in such a way that it boots? there are answers that suggests to dd from sector 0 to the desired last one, but comments say it don't work.

Is there a reliable way to do such a "simple" job?

Lorenz Keel
  • 9,511
Mark
  • 577

1 Answers1

1

Try clone the entire disk with Clonezilla (in 'raw' mode - or whatever it is called) or dd and then delete the unnecessary partition with gparted. If your target disk is smaller then source -- don't worry, Clonezilla will just freeze in the end and the last partition on target will be broken. Just reboot and delete it anyway.

Copying partitions with gparted will not give you working bootloader.

Sergey K
  • 419