I cloned a 250GB SSD to a 500GB one using this command:
sudo dd if=/dev/sda of=/dev/sdb bs=64K conv=noerror,sync status=progress
The cloning process seem to have gone well looking at the progress. It did start giving error after it started cloning unexisting space from the smaller disk to the larger one (Input/Output error after trying to copy data after 239 GB or so) but I suppose that is normal.
I performed this operation connecting both SSDs externally to a computer running Ubuntu 16.04. Afterwards, I put my original SSD drive back to my laptop, booted, and tried to visualize the content of the new cloned SSD which I connected via USB:
sudo lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL
This is what I expected (roughly):
sdb 460G
├─sda4 ntfs 1000M WinRE_DRV
├─sda2 16M
├─sda5 ext4 28G /
├─sda3 ntfs 139,6G Windows
├─sda1 vfat 260M /boot/efi SYSTEM
└─sda6 ext4 69,7G /home
[sd7 with extra space?]
sda 238,5G
├─sda4 ntfs 1000M WinRE_DRV
├─sda2 16M
├─sda5 ext4 28G /
├─sda3 ntfs 139,6G Windows
├─sda1 vfat 260M /boot/efi SYSTEM
└─sda6 ext4 69,7G /home
...But this is what I get:
sdb 1023,8M
sda 238,5G
├─sda4 ntfs 1000M WinRE_DRV
├─sda2 16M
├─sda5 ext4 28G /
├─sda3 ntfs 139,6G Windows
├─sda1 vfat 260M /boot/efi SYSTEM
└─sda6 ext4 69,7G /home
Above, sda is my main 250GB drive, and sdb is the new one. Before the cloning, sdb was associated to about 460G of space, and no partition.
Why is sdb displayed without any partition? And why is it associated to 1023,8M instead of ~500G?
Edit: after restarting, leaving the second SSD connected via USB, I get:
NAME FSTYPE SIZE MOUNTPOINT LABEL
sdb 465,8G
├─sdb4 1000M
├─sdb2 16M
├─sdb5 28G
├─sdb3 139,6G
├─sdb1 vfat 260M SYSTEM
└─sdb6 69,7G
sda 238,5G
├─sda4 ntfs 1000M WinRE_DRV
├─sda2 16M
├─sda5 ext4 28G /
├─sda3 ntfs 139,6G Windows
├─sda1 vfat 260M /boot/efi SYSTEM
└─sda6 ext4 69,7G /home
Which is way better, but still not exactly what I'd have liked to see. Why are the ntfs and ext4 file system types not visible? And why is the remaining ~220G not shown anywhere?
Edit #2: This is the output of sudo fdisk -l:
Disk /dev/sda: 238,5 GiB, 256060514304 bytes, 500118192 sectors
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: 214236EA-A3F6-48D6-876E-E94A1F829226
Device Start End Sectors Size Type
/dev/sda1 2048 534527 532480 260M EFI System
/dev/sda2 534528 567295 32768 16M Microsoft reserved
/dev/sda3 567296 293269503 292702208 139,6G Microsoft basic data
/dev/sda4 498069504 500117503 2048000 1000M Windows recovery environment
/dev/sda5 293269504 351862783 58593280 28G Linux filesystem
/dev/sda6 351862784 498069503 146206720 69,7G Linux filesystem
Partition table entries are not in disk order.
GPT PMBR size mismatch (500118191 != 976773166) will be corrected by w(rite).
Disk /dev/sdb: 465,8 GiB, 500107861504 bytes, 976773167 sectors
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: 214236EA-A3F6-48D6-876E-E94A1F829226
Device Start End Sectors Size Type
/dev/sdb1 2048 534527 532480 260M EFI System
/dev/sdb2 534528 567295 32768 16M Microsoft reserved
/dev/sdb3 567296 293269503 292702208 139,6G Microsoft basic data
/dev/sdb4 498069504 500117503 2048000 1000M Windows recovery environment
/dev/sdb5 293269504 351862783 58593280 28G Linux filesystem
/dev/sdb6 351862784 498069503 146206720 69,7G Linux filesystem
I notice two things that don't look right. First, the display of this warning/error in red: GPT PMBR size mismatch (500118191 != 976773166) will be corrected by w(rite).. Second, the two SSDs have the same Disk identifier number.