I recently did a fresh install of ubuntu on a system with an old ubuntu install. I have a separate hard-drive which used to have a single ext4 partition, but during the install I accidentally selected "use this partition as ext3", but did not check "format".

When I mounted the drive, I only saw the lost+found directory (which was empty). I tried using testdisk to recover, but it only shows the lost+found, since it is a perfectly valid partition.

I ran strings on the block device, and see tons of file names, which is why I believe the journal data is still there somewhere.

I saw this question, which seems like exactly my situation, but didn't have enough information to help me: File recovery after reformattig ext3/4 partition -- extract old journal/superblock?

My current situation is that the drive still has a single ext3 partition, and I haven't written anything to it. I've been reading about ext4magic, but I'm in a bit over my head. It seems like it expects the drive to already be formatted to ext4, so should I "upgrade" it to ext4? I'm nervous about writing anything to it without fully understanding what I'm doing.

The drive contains a lot of media I'd really like to save, but nothing I can't live without. I'm really only interested in recovery if I get file names as well, it's not worth listening to thousands of songs to try to identify and name them, and everything on the drive was well organized. I also don't have enough empty space to image the entire drive (it was 2TB, probably ~0.75TB full), but if that is required, I could talk myself into buying another drive for the purpose.

Thanks in advance for reading, and even if you can point me towards some documentation I can read, that would be really helpful! I don't mind sinking a few (more) hours into trying to fix this if I learn something along the way!

~# fdisk -l /dev/sda

Disk /dev/sda: 2000.4 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders, total 3907029168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0007c87c

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1              63  3907024064  1953512001   83  Linux
  • If you didn't format it, did you try mounting it as ext4? sudo mount -t ext4 ...?
    – muru
    Nov 3 '14 at 6:18
  • Good thought, but it looks exactly the same. Just see lost+found, but mount shows it as ext4. Looks like something may have written over the journal and I may be SOL
    – stokastic
    Nov 4 '14 at 4:26

You can use the photorec program that comes in testdisk package for recovering the files. The filenames would be lost. Still the data can be recovered. If you have another big enough hard disk, create an image of this partition using dd and run photorec on the image. This would be safer. As you have created a new file system, I seriously doubt that the old journals would be still available. The backup entries might have got overwritten as well with the new journal entries. There are other data recovery tools available as well. But photorec is really easy to use and effective.

  • Thanks for the suggestion, but I don't currently have enough free hard-drive space to store an image of the drive, nor the spare time to sort through thousands of unnamed files. I may buy (or borrow) a new harddrive and use this technique as a last resort though.
    – stokastic
    Nov 4 '14 at 5:11
  • Data recovery from Ext3/4 is such a pain. Non free tools like Raise Data recovery (runs in windows I guess) might also be helpful. You don't have to create an image. That is just to avoid any possible corruption
    – subin
    Nov 5 '14 at 6:06

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.