Thursday, September 24, 2009

Dara Recovery from a partition


Ever formatter a partition by mistake, and ended up losing all your essential data? Realized that it was pretty stupid not to backup your favorite pictures, data from your seniors project and about a 100 other scenarios.
I came across a similar situation a week back, what was worse that i lost all my pictures about 20 GB. I had no backup of about 10 GB of them... I had formatter a 200 GB partition while playing with the partition manager.

I tried a couple of softwares including Get Data Back, Recover My Files etc. But none of them helped much. They were unable to build the exact directory structure of my partition. What complicated the matters was the fact that the data to be recovered was very huge in size. We're talking about a partition of about 200 GB.
I came across a utility known as PhotoRec, it was easy to use and in less that 8 hours, it was able to recover most of the data. But it renamed all the files and the directory structure was lost. When you're dealing with pictures, its not much of a problem as you can use the properties of a picture to know the creation date etc. Using a script, one can regroup them and place them into the directories accordingly. But this becomes a huge problem when you're dealing with text files.... and alot of them. All the files from my ongoing seniors project were lost - most of them being C files. I was in total chaos until I found out EASEUS Data Recovery Professional, I used this software to recover all the data. What really impressed me was the fact that the directory structure was preserved with cent percent accuracy. I got all my project files back. It has a demo wizard available for free. But the professional one comes at a price. But the price is nothing when your seniors project is at stake.


THINGS TO KEEP IN MIND WHILE DOING DATA RECOVERY:

* The moment you realize that you formatted a partition by mistake, stop writing on that disk. If it is an external partition, DO NOT MOUNT that partition.
* It is always advisable to make an image of the formatted partition so that in case somethings goes wrong while the data recovery process, you can always be assured that you have a backup. Most of the data recovery programs use a read only permission on the partition, but still it is advisable to have a backup to be on the safer side.

And last, Learn from other people's mistakes... always always always backup your essential data...!

Thursday, July 30, 2009

Redirecting Output from Terminal to a file

Today, I was trying to get a scheduler simulator up and running. The source code had a Makefile which was doing quite some job. I tried to do a make only to end up with a lotta errors. The list of errors was so long that the terminal didn't show up the entire error by scrolling up. I tried to redirect it to a text file using

$ make | tee filename.txt


But, instead of getting the errors, what I got was the entire make command after getting proccessed. I was interested in the errors rather than what the make command was.
I used this useful feature called script. All you gotta do is run the script command before you start.

$ script


You'll get the prompt

$ Script started, file is typescript


This is the system's way of telling that the system is recording everything going on the terminal
Once you're done recording, just type the exit command

$ exit


And tada... its done, the terminal tells you

$ Script done, file is typescript


Everything goes into the file 'typescripit' which is created into the current directory.
For details checkout the manpages for script

$ man script

Friday, September 26, 2008

welcome to google blogger...

This is yet another proof of google taking over the world... Well, I do have a blog by some other provider, but then Why not have one on google blogger. anyways this is just a stab post to check if all things and my new theme is working or not. Sorry to disappoint you, seems you'll have to wait a few more hours to read my first post. Keep patience...!