Restoring a smaller partition image to larger partition using dd
Solution 1:
If all is well up to that point then I think you just need to resize2fs
the filesystem up to 40Gb:
resize2fs /dev/sdc1
where /dev/sdc1 is the name of your partition.
Took off the size as per womble's excellent comment below.
resize2fs
will grow the filesystem when it's mounted. It can also shrink it but needs to be unmounted for that.