Sebilj, Sarajevo, Bosnia and Herzegovina

Partition resize after dd copy

When you copy a partition at the byte level (with dd or similar tools), you are copying the entire filesystem which will have the same size even in a newer, larger HDD. Therefore, it is necessery just to execute

resize2fs /dev/sdX

where /dev/sdX is the name of your partition.

resize2fs will grow the filesystem when it’s mounted. It can also shrink it but needs to be unmounted for that.
Note: resize2fs will not delete your files on the partition. Do not worry for that!