How to recover resize2fs failure

Solution 1:

First, resize2fs may take several hours or even more than a day to run, depending on the size of your partition.

If you interrupted it while it was running, that's a very good recipe for losing all your data. All of the filesystem data structures are probably in an inconsistent state.

Now, your drive has errors at the very beginning of the disk, where the partition table is stored.


At this point, what you should do is replace the disk and restore your backups. Since you don't have backups, you should update your CV. If this server was very important, the company might go out of business.

To avoid situations like this in future, always ensure that you have backups and that your backups are fully functional, that you can successfully restore with them.


So, aside from updating your CV and making backups, this is what you need to do today:

  1. You can attempt to use dd_rescue to copy the disk, skipping any errors, to another disk, and then work on rescuing data from the copy.

    Don't expect to get too much out of this, though.

  2. If you can't rescue anything from the disk, send it to a professional data recovery company.

Solution 2:

I know this is years later and not likely helpful to the OP, but I wanted to add another perspective on this for others coming across this post.

I've had resize2fs interrupted more than once (i.e. power failures), and after a quick fsck have not had any issues or data loss. It certainly sounds plausible to lose large amounts of data this way or even corrupt the entire partition since this is affecting the filesystem itself, I've just never personally witnessed it before.

However, the errors the OP posted combined with failed attempts to run dd_rescue (which doesn't care about corruption at the filesystem level) points to a hardware failure, (or in the case of a VM, a problem with the container file or perhaps the underlying hardware). While coincidental, this sounds independent of the failed resize2fs attempt.

I would first make sure the underlying hardware is good. If all checks out there, make a copy of the VM image, then rebuild the copy (the specific method for that will depend on the image format). Finally, boot the copy, running fsck as well, and see if that resolves the issue.