0

I had a ext4 partition that I tried to shrink. Made it 30GB shorter. But it went wrong because after that it reported me that I couldn't mount it anymore.

Checking the partition with fsck i got this

The filesystem size (according to the superblock) is 216352000 blocks
The physical size of the device is 206049536 blocks
Either the superblock or the partition table is likely to be corrupt!

Seems like it only shrank the physical device and not the file system. I used dd to image the partition and use truncate to make the image larger and was able to mount the image without a complaint but it appears that I lost 20gb of data.

Does anyone know if I can resize only the partition table without touching the file system? I tried with resize2fs but it fails.

If is not possible to restore my info, Is there a way to see what information I lost?

New contributor
Akabane is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
  • 1
    Sure, you can always do that with fdisk / gdisk by deleting and recreating the partition with different size (just make sure you say no when recent fdisk ask you whether you want to wipe the filesystem signature). Also make sure the starting sector remains the same. – Tom Yan Dec 1 at 17:10

Your Answer

Akabane is a new contributor. Be nice, and check out our Code of Conduct.

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.