It was just before christmas that I was confronted with a Western Digital harddrive being used on a Mac with OS version less than 10.4.x. The owner of the harddrive was not aware that the iMac actually would reset the FAT partition upon connection. But that sure did happend, and all 450GB which was used to store mainly photos got erased in seconds. Then what?
First of all, the partition did no longer show up in Windows. Nothing. The Windows disk management software could not help either. And that’s pretty frustrating. But I was pretty confident that the files were there, because you cannot delete supposingly 20GB of photos in just a few sconds! That makes no sense. So this had to do with the file tables being erased or something. The fix was a follows:
- I started off with GParted live cd. This enables you to run ( -> boot) a Linux [Operative System] directly from the CD, and also launch a powerful utility software called GParted (Gnome Partition Editor).
- GParted displayed all partitions perfectly, and it was also obvious that the main partition was damaged – coloured in black.Because I knew the original format was FAT32, I chose to reformat the partition to this type. This didn’t help much though.
- I tried a lot of the different methods mentioned in help.ubuntu.com/community/DataRecovery. I might have had better luck with this if I hadn’t «reformatted» the partition to FAT32 (though I really didn’t, it was only a quick format).
- I ended up using the software called foremost, and recovered files to my newly acquired 500GB internal SATA laptop harddrive. (It is worth mentioning that I also used gparted for duplicating my old hdd partitions to the new 500GB harddrive). Gparted recovered the files successfully, but the files are put into folders according to their extension, and filenames and dates are not preserved, just given an arbitrary number as filename and todays date as modified date. Considering the about 60000 photos recovered, I really wanted to do better…
- The solution was the software called rotren, which I installed easily – as with any other ubuntu software – with this command:
sudo apt-get install rotren
The name rotren comes from «rotate and rename», and it uses EXIF data from the photos to create new filenames. I also chose to put the photos into folders according to their date taken.
- I could not rename all 60000 photos in one batch, and found out that ~8000 files can be processed in one batch. I did this by using this code:
sudo renrot --no-rotate --aggr-mode template -a %Y-%m-%d -n '%Y-%m-%d %H:%M:%S' *
I added «–no-rotate» because this makes the process take way much longer time.
To me it was a real eye opener that Windows really couldn’t help me in any way recovering the files. I have now installed Ubuntu on a second partition on my laptop, running on dual boot so that I may opt Windows or Ubuntu on start up. Sweet 😀