0

I'm new to ubuntu but it didn't took me long to realize that it's way better than privative options. I've got it installed on a desktop PC and I also wanted to install it in a laptop which is not mine and the owner desired to keep pre-installed win 8 along with ubuntu. Keeping that in mind I tried to create a recovery image of windows into an USB drive but, don't ask me why, it wasn't possible even though it had enough free space.

Then I made a serious mistake. I took my internal HDD which contained a lot of important data and tried to create the image there using a usb-sata interface. It was partitioned like this: 800 gb ext4 with data, then 200 gb NTFS containing nothing. I wrongly assumed that windows would use the NTFS partition and leave the ext4 alone but it didn't, it formatted 32gb into FAT32 for the damned recovery image leaving the rest of the disk space unassigned.

I've made a real mess, guess I got used to all the warnings that linux gives us before taking bad decisions and crappy windows took me by surprise.

I've analysed the HDD using Testdisk. The first attempt led me nowhere since it couldn't find the ext4 partition (even through deep search). Then I took another shot this time selecting "unpartitioned media" instead of "Intel" as partition table type. Here are the results:

Disk /dev/sdb - 1000 GB / 931 GiB - CHS 121601 255 63

Partition ---------------- Start ---------------- End ------------------- Size in sectors

P ext4 ------------------- 0 32 31 -------- 95493 4 61 -------- 1534093312 [Ext4]

P FAT32 ---------------- 0 32 33 ------- 4177 117 36 ------- 67108864 [NO NAME]

P NTFS --------------- 5453 43 31 ---- 5453 141 30 --------------- 6174 [Boot]

P FAT12 ------------ 5453 143 19 --- 5454 217 30 --------------- 20739 [NO NAME]

P NTFS ---------------- 95493 5 1 ---- 121601 57 56 ------- 419428352 [Ntfs]

Structure: Ok.

Keys T: change type, P: list files, Enter: to continue EXT4 Large file Sparse superblock Backup superblock, 785 GB / 731 GiB

The good: the partition was found, and it is correctly labeled. The bad: when I access and try to list the files it says "Can't open filesystem. Filesystem seems damaged". I'm stucked at this point.

Thanks in advance!

  • Did you do a "quick" format or a "full" format? If "quick" you have a chance on recovery, if full, you're probably out of luck. – ubfan1 Feb 27 '14 at 0:03
  • That's a good question. Windows recovery tool formatted the HDD, It didn't took long so I guess it was a quick format but I can't tell certainly – dTandil Feb 27 '14 at 0:08
  • Do you make backups regularly? Do you periodically restore your backups to make sure they're good? Did you back up before you started? – jia103 Feb 27 '14 at 0:16
  • Part of the data is also stored someplace else but still I would really like to recover the contents of the HDD. I've corrected the question, not all the HDD is now FAT32. Only 32 gb. – dTandil Feb 27 '14 at 0:53
0

Your ext4 filesystem lost its first 32G with the FAT32partition at the beginning of the disk. You could try to reset the partition table to what it was originally, and see if any disk recovery tools can find anything (might work if they can find a duplicate superblock). If that doesn't work, you can try to make the partition table have a 32G, the rest of the ext4, and the ntfses and see what the recovery tools pick out of the chopped off ext4. Worst case, you've lost the filesystem, and just have the data, which if it's text, in theory you could use dd to copy the raw data into files, split them up into editable pieces, use the strings program to find interesting pieces, and use an editor to pull out the files you recognize. Not a pretty scenario, but if you REALLY need something, it's possible.


Certainly use the same program you originally used to set up the ext4 partition. So your default starts will be the same and when you give it a size of 800G, the G is interpreted the same way so the size will be the same. Now try the recovery tool on that partition. It may well be very confused with 32G of FAT32 filesystem sitting at the begining of the ext4 filesystem, but see what it finds -- The hope is the FAT32 format was "quick" and you may even recovery some files which were in the first 32G. If not much of interest is found (like just the Microsoft recovery files), try to help out the recovery tools by eliminating that FAT32 filesystem. Do that by putting it into its own, new partition. Now the second partition starts when the FAT32 ends, but the filesystem on it has had its beginning chopped off, losing those files, but the rest of the files should be OK, just hard to access, since the filesystem is broken. Try the recovery tool again, and hopefuylly it will find the remaining files in that broken filesystem. Good Luck. Backups are such a nuisance, until you have to go through the effort of recovery without them, then they don't seem so bad after all.

  • unfortunately the ext4 partition was located at the beginning of the HDD and the NTFS was at the end. This means that i've lost 30 gb of data and I can save what's left? Your method is still applicable? – dTandil Feb 27 '14 at 8:56
  • The disk was originally partitioned with gparted. You're saying that I should create new partitions using the same program and both partitions must be identical in size and location in the disk? – dTandil Mar 1 '14 at 23:19
  • So when Testdisk couldn't open the filesystem of the ext4 partition recovering it became an impossible thing to do and reformatting as you answered is the only chance? by recovery tool what do you mean? thanks again for your help – dTandil Mar 2 '14 at 6:40
  • Nowhere did I suggest reformatting is a solution to anything -- just resetting the partition table. This might help the "recovery tool" "find" the remaining files on the disk. The "recovery tool" I mentioned was whatever you are using, Testdisk or some other tool to help recover files in a damaged filesystem. – ubfan1 Mar 2 '14 at 17:56
  • Allright, as you might see I don't have any experience in recovering data so I have to ask all the time. Next step would be to write the partition table with Testdisk even though the filsystem is broken then try to recover the data using, for instance, photorec. Am I right? – dTandil Mar 3 '14 at 19:42

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.