Sunday, 1 March 2015

How to get your lost data back ?

                             Welcome to my blog

Three days back i was running into a terrible problem. I ask you have you ever suffered through, that you accidentally formatted your hard disk and then you realize "o gosh!, what i have done this data was so important to me." and started abusing and get frustrated about your act.? Well if you do then continue reading.I'll like to go in detail for your understanding that what operating system has been doing with your. If you are not interested in getting the explanation that how it works you can skip to the section for quick methods. As kinda same thing happened to me i accidentally formatted my whole data of 500 Gigabytes and installed ubuntu 14.0.2 replacing Windows 8.1. 
So the First thing first, if it ever happened to you follow these rules: 
1. Don't get panicked (you can get your all data back but with some presence of mind if you panicked things can go more wrong)
2. Find out your category of problem on this blog(i'll explain later each possibility i have faced).
Okay when you have done these two things you are ready to proceed further we gonna take this sunken ship out of the sea. Here i just wanted to share this " Do you know the empty/formatted drive is just an eye wash to you ?" yes the data is never deleted from your hard disk until you override that data with something else. Was it little bit of motivating toward your task ? i think it was now you can surely hope how to get our data back. I have came across two Operating systems:
 1. Ubuntu 
 2. Windows
Honestly saying i was under opinion that  i should switch totally to Linux from windows but it was not worth migrating totally because in my opinion you can get plenty of software which you can have on windows for free but you don't have another way on Linux  so as being a student i made a choice to keep both of them. If you are Linux user and your data is lost on Linux os as well then you got a great chance to recover that data through 'testdisk'. Before jumping on to it i would like to tell you the pretty background of Linux file system. 
1. Ext2
It uses It is known as 'second extended file system' used for flash drives, usb drives, ext2 is recommended and it has maximum individual file size can be from 16 GB to 2 TB 
2. Ext3 It stands for 'third extended file system' the basic benefit of this system is that it keeps track of the changes that will be made on drive and place them on right place, and its size can go from 2 TB to 32 TB.
3. Ext4 It is known as 'fourth extended file system' it sizes even bigger than ext3 upt to 1 Exabyte which is actually 1024 petabyte of data. Now your drives are on ext3/ext4 system which is pretty different from windows file based system (NTFS, FAT),
Windows cant read those files listed above but some how Linux can read them and can show their existence while they are not operate able on Linux. That's how much the pretty basics of it lets get back to our original topic.                                                               
                                                                     1. Ubuntu

Linux users should follow these steps:

  1. Open up the terminal if you are using the GUI on Linux just press "Ctrl+Alt+T".
  2. You need to install 'testdisk' on your PC as its not official software you won't find it on store probably write "sudo get-apt testdisk". it will eventually install this software.
  3. Now you need to run it just type in the terminal "testdisk".
  4. A main screen of testdisk will appear with multiple options to select choose the first one "Analyze".
  5. After selecting it the screen will let you choose the hardware system you are using "intel" is the mostly used hardware, but this software will actually let you to the option it detects automatically just choose it.
  6. Then you need to select the hard disk or current partition you are shown select one you want to recover. You will have option of "Quick Search" on the left bottom of the terminal select it to search in the hard disk it will take some time in searching depending on the size of the disk.
  7. Almost half of the part is done, now you will see multiple folders due to search on the hard you will see multiple  
  8. You can look into those folders by just pressing "P'" on them and check whether you want it back or not.
  9. If you have decided to take it back method is so simple just press "C" on that particular folder and provide it destination where you want to place it. 
So that was it pretty sweet you can recover you data from Linux on Linux.

                                                                         2. Windows
Windows users have GUI so dont have any problem in dealing with softwares i guess, any how just follow these steps:

  1. Download "R Studio" first.
  2. It will show you the drives which are active on the left side. Select one which you want to diagnose.
  3. Run "Scan" on it, just right click on the drive and choose scan by selecting the option further on it "without showing the progress fastest way" . It will not show you the scan progress but it will work fastest.
  4. Wait for the scan to complete and list of your data will be shown there will be four colors of them "Red, Green, orange and Black". The Green,orange and black folders will recover with no problem but red will recover with loss of some data.
  5. After choosing your folders provide them your destination to copy the data by selecting "Recover Marked" option on the bar of the window.
that's it you have restored the files which you have formatted or deleted permanently .

 What if you have over ridden a Partition type and want previous version of HardDisk ?

Those were the simple ways explained above but what will you do if you have formatted a hard drive in switching between Linux to Windows or Windows to Linux ? Well now you gotta take it seriously because it become harder and harder to get your data back if you paste another layer on your data the deeper it goes harder it is to take it back.

You can see files of windows from Linux but you cant see files of Linux through windows.
Well in that case you need an external Hard disk to solve this matter, Microsoft have introduced a new featured "Microsoft Go" it gets install on any USB or External Hard Drive with recommended 3.0 port of usb if not its still okay to go with 2.0 port.
Some people encounter installing "Microsoft Go" like that you can not install this on MBR type discs and you can install it on GPT type, and another error like that. I can quickly guide you through this as well when you encounter these error just close the dialog box of selecting external drive and you will came back on the starting dialogue with "Install Windows". Just there you need to follow these steps:

  1. press "Shift+f10", another dialogue box will appear,.
  2. Type command "diskpart".
  3. Then "list disks". it will show the discs connected to your system. (if you have external hard/usb same of your hard inside your system you can unplug the external one and type again "list disks" you will get to know which one id your internal hard and external hard)
  4. Now you know your external hard after seeing the list type command "select disk 0" (you can put your disk number i just typed '0' for now)
  5.  Now type "clean" and it will erase the auto set type of disks and fix the error. Select the drive now install the windows.
Point is you can install that Microsoft GO on your external hard drive and use it as a portable windows just plug the usb/external hard and work on your windows so by doing this you can install "R Studio" on it and scan the linux hard drive on it. There you will be able to see that hard only in this software. Repeat the process as explained above for windows and recover your data. Thats how it worked for me if you got any problem in doing this please comment and let me know , Thanks for reading this post :3