
Software used
-GetDataBack NTFS (available on Hiren's Boot CD)
-partition magic 8 (for windows, probably not available)
-fsync (command line for synchronising 2 folders)
This process took about 4 hrs 30min
1) pre-scan: 1hr 30min
2) backup data: 2hr 30 min
3) restore data: 30 min
The drive was originally 80GB, and was formatted with NTFS on a Windows XP Korean OS. It was a portable USB drive. What happened; I was copying some files on to his disk for him and it had a virus, which infected my computer, so we couldn't use safely eject because the virus was writing to the disk, so I pulled it out as it was running, then re-inserted it and the disk was corrupted!
The disk was formatted NTFS, which means you really shouldn't pull out the disk unless you use safely eject. If you keep powering it off, and pulling it out, when the drive hasn't finished flushing its read/write cache, eventually you will run into data loss.
In this case, I had to pull it out, while it was running, since it had a few autorun.inf viruses. (These viruses are common, and spread by the autorun.inf file, at the root of the drive, so when you plug in a USB, it automatically runs the viruses, which are defined in autorun.inf)
I pulled it out, since the virus was read/writing to the disk continuously. (I got infected!) We then reinserted it and got an error saying the drive was invalid. If you see the picture above, it shows what happened when queried by system drive properties. 0KB of DATA!
My friend was sad, since all his good photos and memories were on the drive, but fortunately for him, I happened to have run into the same situation before. The data wasn't really lost, as you know, probably the filesystem was corrupted, so it wasn't showing the files. I assured him that I could get the files back.
The first thing I tried to do was a checkdisk, by right clicking on the drive in my computer and running it, however it disappeared instantly and didn't even bother to scan the drive, so I tried the command line chkdsk f: /f however this was as useless as before.
I determined that an easy fix wouldn't be possible and we would need to use some recovery software. I had a copy of Hiren's boot CD , and ran get-data-back-NTFS from it.
(A note about Hiren's boot CD . This CD can nearly do anything, if you need to recover data, or setup a fresh PC and arrange partitions, and so on..)

Opening up Partition Magic 8 in windows, showed that the drive was still there and showing as NTFS, however running the partition magic check for errors, errored out on us ironically.

Running GetDataBack NTFS was the only alternative I could think of.
GetDataBack NTFS is a software that scans a selected disk that was previously NTFS, and trys to read the information and displays it for your recovery. If you decide to use GetDataBack NTFS method, there are a few steps to follow and be aware of.
1) Time to pre-scan drive with GetDataBack NTFS.
(about 2 minutes per GB*)
2) Available drive space to recover to. You need another drive, to recover the data to. You should not recover the data to the same drive. It means you need equivalent of free space on a separate disk to backup.
3) Time to recover with GetDataBack NTFS to your backup drive
(about 5 min per GB*)
4) Time to put the shift the data back to the original drive.
(about 1 minute per GB*)
*depending on your disk speed, and other factors, CPU, RAM etc



When you use GetDataBack NTFS, you need to select the drive that you want to scan, and then start scanning it. It takes a long time. I recommend after the scan that you save your project file, so rescanning is not necessary if you need to re start the process

Note if you chose a red icon choice when recovering Unicode partition data, it will recover the files, however they will recover corrupted!

This is step 5: recovery tree
As you can see on the left, there are ?? characters. This is because GetDataBack NTFS or my OS, doesn't display Unicode characters. You can see a folder list of deleted folders and we will recover the relevant ones



This is a screenshot of the recovering desktop. Note that the Unicode characters appear as ??? question marks, but in the explorer they are in Korean characters.

I am testing that the data is actually recovered, as you can see, there are photos appearing in thumbnails view, which means the data been recovered is not corrupted.

OK, now the data is safely backed up to my local hard drive, we now need to format the corrupted drive to FAT32, and then shift the data back onto the drive. Since it is 30.3GB it will take about 40mins-1 hour roughly. I will also setup a fsync script, which will synchronise the backup folder to the new folder, so if it gets interrupted we can start it again, without re-transferring already copied files, and having to click yes to the constant, Are you sure you want to copy this already copied file prompts.
Note you can use the windows disk management to format drives, or you can even use the format utility by right clicking on a drive. I prefer the partition magic way, so it follows







Now I will setup an fsync script, which will copy the backed up files to the 'new' disk. An fsync script is very useful, since it can be stopped at anytime and then resumed. If you have a large amount of data being transferred, you don't want to have to restart the process if you interupt it, since you will be prompted by a lot of windows boxes and the data transfer will need to start all over again.

@echo off
set _srce=d:\danni
set _dest=f:\danni
md %_dest%
fsync %_srce% %_dest% /f
pause
This is quite a simple script. Just open up notepad and paste in the above code, and then modify it so your Source folder follows the set _srce= and your destination folder follows the set _dest=
Be careful that you dont get the 2 the wrong way around, else you will overwrite your source files with your destination files (overwriting the source!)
Run the script, and ensure that fsync is sitting in the same folder as the script!


Thats it, I hope you can find this guide useful, and next time you lose data, try out this method!
No comments:
Post a Comment