Recover corrupted Ubuntu partition

ppiedmont

Honorable
Dec 29, 2013
7
0
10,510
So I have a laptop dual-booting Windows 8.1 and Ubuntu 14.04, and my Ubuntu partition ran out of space. I shrank the only partition I could to make more room for Ubuntu, but the unallocated space came before the partition and I couldn't extend into it. I tried switching the partition and unallocated space, but quickly realized that my computer no longer knew where Ubuntu was. I tried moving it back, but that didn't fix it. I did back up my filesystem beforehand, but like a noob I forgot to copy the backups somewhere else. All my important files are already backed up, but I'd prefer to be able to easily restore all my system settings when I reinstall Ubuntu. Is there a way I can recover my backup files from my Ubuntu partition?

**EDIT**
Can I recover my data by cloning the partition into the unallocated space? Since I only moved the partition, presumably nothing inside it is actually corrupted, so in theory cloning it would produce an exact copy and my computer would know where it is.
 

ppiedmont

Honorable
Dec 29, 2013
7
0
10,510


Thanks man! I took a look at my partition with TestDisk and everything seems to be there. Now if I install Ubuntu into a fresh partition, can I copy all the files out of the corrupted one and completely replace my new installation? And if so, how would I go about doing it?
 
Find large enough external hard drive / USB key, and copy over the stuff you need off that partition. If you do what you have proposed, you will end up in the same ship you were - empty empty space on the drive, wanting to move / expand partition etc.

You might have troubles installing Ubuntu "into a fresh partition" if you already have four partitions on that drive.