Gparted and dd clone to smaller disk - Invalid argument during seek for read on /dev/sdX

One regular way to clone a set of partitions to a new smaller disk is to use Gparted to resize down the partitions so the fit in the new disk and then use dd to copy either only the beginning of the disk, or run until the new disk is filled up.

This does however not work directly with GPT, because the partition table is at the end of the disk.

Doing dd if=/dev/old-disk of =/dev/new-disk, partprobe and then Gparted pops up this error:

"Invalid argument during seek for read on /dev/sdX"

Running cfdisk /dev/sdX shows one big partition that is in the size of the old disk on the new disk.

To fix this you use gdisk to copy the backup partition table to the end of the disk.

To check if you are affected, do this:
gdisk -l /dev/sdX

You get an error, "Warning! Disk size is smaller than the main header indicates!" if so.

To fix it:

gdisk /dev/sdX

Type x to go into experts mode, then e to relocate the backup partition table to the end of the disk, then w to write changes, then confirm.

This did not disturb Windows 10.

Source: https://bbs.archlinux.org/viewtopic.php?id=154057

This is a personal note. Last updated: 2019-06-21 22:28:25.



LinkedIn
Klebe.se

Don't forget to pay my friend a visit too. Joakim