migrating to a smaller SSD from larger harddrive with GPT partitioning

 A friend recently purchased an SSD (Crucial CT240BX500SSD1) to replace the now-getting-slower HDD (WDC WD5000LPCX)in his laptop. The SSD is smaller so simple dd won't like like what I did previously. Thankfully the old drive was not full and we can cram the content in.

The laptop has optical drive bay which I swapped with 2.5" drive caddy so we can use both the old and new drive together.

I went with FossaPup64 as it fits the only flashdrive within my grasp (1 GB) today. The current version of cfdisk now does support EFI beautifully, we can just mimic the partition table from the old drive, given that we still have the EFI partition, a reserved partition for the recovery mode,and Windows system partition.

Disk: /dev/sda (the new SSD)
Size: 223.58 GiB, 240057409536 bytes, 468862128 sectors
Label: gpt, identifier: 4AFD6168-865F-4702-BD2F-ADF7B40C7458

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   468862094   468294799   223.3G Microsoft basic data

Disk: /dev/sdb (the old HDD)
Size: 465.78 GiB, 500107862016 bytes, 976773168 sectors
Label: gpt, identifier: 1C7B31D6-E6ED-4F17-B1A5-F3CA5D141DB0

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 974725119 974157824 464.5G Microsoft basic data
/dev/sdb4  974725120 976773119   2048000  1000M Windows recovery environment

mkfs.ntfs -f /dev/sda3
mount -t ntfs-3g /dev/sda3 /mnt/sda3
mount -t ntfs /dev/sdb3 /mnt/sdb3 (so as not to accidentally delete things)
rsync -rtvu /mnt/sdb3 /mnt/sda3

The business is then about reinitializing the loaders in the boot/system partition with bcdedit business. Then, profit!

0 rants: