Restoring a smaller partition image to larger partition using dd

ddext4partition

I recently backed up an 11GB ext4 partition to a file using dd, repartitioned, and restored the file to a 40GB partition. parted now shows the partition as 40GB, Nautilus reads it as 11GB, and both list the drive as only having 2GB free.

Is this a filesystem issue or partition issue and how can I fix it without repartitioning to 11GB, dd'ing the file, and growing the partition?

Best Answer

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.

Related Topic