Advanced File Recovery

So, a few weeks ago, someone made the mistake of upgrading a computer to Windows Vista from Windows XP. Besides the 8-hour upgrade process headache (what was it doing?), it also left the machine unusable. This person ended up reinstalling Windows XP and also installing Ubuntu. After the whole process was over, this person claimed to have lost important files. Excellent :-)

Since the partitions were completely destroyed and the OS reinstalled, file system level access software would not be helpful. So, I dug deep, and came up big. foremost. This GPL software seems to have been written by the US military, and as such, is in the Public Domain by default. It is now GPL software, and you can use it freely.

I read up on the docs, and here's how I got almost all the files back:

* Boot Ubuntu Live CD (never recover files from the HDD-installed system)

* Add extra software repositories to apt
$ sudo sed -i "s/main restricted$/main restricted universe multiverse/g" /etc/apt/sources.list

* Install the application 'foremost'
$ sudo aptitude install foremost

* Create a recovery directory (put this on USB, instead, if you have one)
$ sudo mkdir /root/recovery

* Search the drive for files!
$ sudo foremost -v -i /dev/hda -o /root/recovery

* Maybe you just want all those JPG files you lost and nothing else?
$ sudo foremost -v -i /dev/hda -o /root/recovery -t jpg

Finally, copy your files somewhere safe. If you don't have enough room in the live system, you could mount a remote partition over NFS, SSH,
etc.

Some of you may be asking yourself what to do if foremost does not support the file types you lost. Maybe you lost some precious OGG files? No worries! Why don't you give 'magicrescue' a try? magicrescue allows you to define the proper "magic bytes" that define the file type. Basically, it's what the 'file' command would check against. You can see all magic definitions in /usr/share/file/magic. You can define your own and use them as input when you run magicrescue. The possibilities are endless.

So, if you need to get your data back desperately, these are great options for you! Keep on hacking :-)

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Ogv recovery

Mel's picture

Hey,
Is there any way to recover a .ogv file?

Webcast
How to Build an Optimal Hadoop Cluster to Store and Maintain Unlimited Amounts of Data Using Microservers

Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.

Learn More

Sponsored by AMD

White Paper
Private PaaS for the Agile Enterprise

If you already use virtualized infrastructure, you are well on your way to leveraging the power of the cloud. Virtualization offers the promise of limitless resources, but how do you manage that scalability when your DevOps team doesn’t scale? In today’s hypercompetitive markets, fast results can make a difference between leading the pack vs. obsolescence. Organizations need more benefits from cloud computing than just raw resources. They need agility, flexibility, convenience, ROI, and control.

Stackato private Platform-as-a-Service technology from ActiveState extends your private cloud infrastructure by creating a private PaaS to provide on-demand availability, flexibility, control, and ultimately, faster time-to-market for your enterprise.

Learn More

Sponsored by ActiveState