Author Topic: My experience with an accidentally reformatted hard drive  (Read 1043 times)

Offline Ambertone

  • Hero Member
  • *****
  • Posts: 619
  • Australia
My experience with an accidentally reformatted hard drive
« on: October 30, 2010, 02:09:29 AM »
Hi all, this is an example of “the end justifies the means”. I'm sure some experts may disagree with my method but the end result worked. To me that's what matters. This is my story about when I accidentally reformated my main hard drive last week, I thought I'd share................

It's amazing how easy it is to delete partitions or wipe drives by accident. I suppose the easy solution is to always back up and be ready for it but another factor to consider is the time taken to set up your machine just the way you like it.. Email accounts, data, virtual machines etc take plenty of time to set up as well as the download amount and time to bring your system back to current.

Just such a thing happened to me recently where I added a new portable drive to the system and somehow wiped the partitions from my working drive instead of the new drive.

DON'T PANIC! Rushing in without thinking while you are stressed will not help. Turn the machine off, take a deep breath, grab a coffee and when you have gotten over the initial panic work out what to do next. Document what you do so when you work out the best way to handle the problem you will have instructions to follow instead of your memory.

Some good advice I have seen in the forums is to clone the drive and then only work on the cloned drive.  I read many threads suggesting various methods to do this, I started with my trusty PCLinuxOS disk but was unable to clone the drive or run Test Disk no matter what I tried. I then thought to use Parted Magic to access the tools suggested in the forums.

To do this you method you will need a second hard drive, preferably one of a different capacity. Add your second drive and boot the PC up using “Parted Magic”. Navigate to Start> System Tool> G4L (ghost for Linux) The reason for using a different size drive if you have two 80gig drives in the machine G4L only indentifies them as SDA, SDB etc. So choosing same capacities but different brands will not help. In my case the deleted drive was a WD800 “Raptor” drive and I cloned it to a Samsung 160gig drive.

In G4L select the “RAW mode” and then “click and clone”. Then select your source drive, go back and select your destination drive. DO NOT get this wrong. (hence why we do this after a coffee etc) Then start the copy only when you are happy you have source / destination correct. This will take 30 minutes to whatever depending on your source drive.


G4L is good as it will do a RAW copy of the drive irrespective of partitions being there or not. As an example “Acronis” will not let you select a “blank” drive for cloning as it needs to see a partition table.

That's the first part of the job done. Shut down, remove you original source drive, mark it as such and put it in a safe place.

Now reboot and select Start> System Tools> Test Disk

I selected the “No Log” option but this would be personal choice methinks. Test disk now looks for physical devices. Select your disk and click “Analyze”. Now at this point “Test Disk” found every bit of rubbish that was ever on this hard drive. As I knew I only used three partitions in Linux, being 12 gig for / (root), 3gig for “swap” and 50gig for “Home” it was easy to pick the restoration. Truth be known “Test Disk” is far smarter than me and I just let it do it's thing as what's most important is I was working from a back up of my drive.

After a reboot I could only log in as “root”. At this point if this happens to you do your backing up as the system went downhill fast after this point. I did find plenty of info about the error messages in the PCLinuxOS forums and maybe could have repaired from this point, however. On a second reboot the system became even more unstable so it's at this point I decided to be more creative. (remember I am fully backed up at this point and only continuing to learn more)

I booted up the PC from my PCLinuxOS 2010.7 disk and reinstalled the operating system being careful to NOT format my “Home” partition. After a reboot the first thing I did was a full system update. I now had a fully functioning basic install. I then reinstalled the missing apps such as Showfoto and Virtual box, reinstalled my printer and was back to a fully functional system. (even my virtual machines worked)

Hope this helps someone.
« Last Edit: October 30, 2010, 02:43:07 AM by Ambertone »
The ultimate oxymoron --- "Microsoft Works"

Offline Was_Just19

  • Hero Member
  • *****
  • Posts: 6849
  • MLU
Re: My experience with an accidentally reformatted hard drive
« Reply #1 on: October 30, 2010, 03:26:44 AM »
Quote
After a reboot I could only log in as “root”.

What OS did you use to reboot?
The clone?
A liveCD?

I would advise that before using the 'restored' clone as a boot device, you should boot using a live CD and backup all data you need from that clone to another device/partition.

At that point it does not matter what happens to the clone and to use it as a boot device seems quite in order.

Personally I would have done some more work on the clone to see if I could have properly recovered it.
If yes, then I could properly recover the original, using whatever worked on the clone.

....  just some personal observations .....  congrats on getting your system back as you want it.   ;)

It is one of the great benefits of Linux that we ordinary users are provided with the tools to do such things, along with lots of information about how others used them successfully ...  and you have just added to that store of information.  :)

Nice result!  

regards.

Offline ElCuervo

  • Hero Member
  • *****
  • Posts: 4147
  • I'm walking on sunshine!
Re: My experience with an accidentally reformatted hard drive
« Reply #2 on: October 30, 2010, 08:16:34 AM »
Quote
It's amazing how easy it is to delete partitions or wipe drives by accident.
I think that's true only for adventurers, explorers, and other derring-do types. ;D

Quote
I suppose the easy solution is to always back up and be ready for it but another factor to consider is the time taken to set up your machine just the way you like it..
And what about the time it takes (not to mention the pressures and panic, momentary or otherwise) to get your system back up when things go south? Captain Hindsight has taught me that for any system that matters, running rsync on my /home regularly is always worth it, no matter how long it takes.

I like to install and reinstall, and I have ever since I found out how great a backed up /home brings back everything just the way it was. It's also good practice, and you can eventually set up your partitions just like old-polack's! :)
"If there were no change, there would be no butterflies" - Walt Disney

http://linuxcounter.net/cert/433721.png

Offline Was_Just19

  • Hero Member
  • *****
  • Posts: 6849
  • MLU
Re: My experience with an accidentally reformatted hard drive
« Reply #3 on: October 30, 2010, 08:51:41 AM »
It's also good practice, and you can eventually set up your partitions just like old-polack's! :)

OMG!!!!!!!

Why would you wish that on anybody?? ?? ??


 ;D ;D

Offline ElCuervo

  • Hero Member
  • *****
  • Posts: 4147
  • I'm walking on sunshine!
Re: My experience with an accidentally reformatted hard drive
« Reply #4 on: October 30, 2010, 09:04:37 AM »
It's also good practice, and you can eventually set up your partitions just like old-polack's! :)


OMG!!!!!!!

Why would you wish that on anybody?? ?? ??


 ;D ;D

"If there were no change, there would be no butterflies" - Walt Disney

http://linuxcounter.net/cert/433721.png

Offline Xero

  • Sr. Member
  • ****
  • Posts: 469
Re: My experience with an accidentally reformatted hard drive
« Reply #5 on: November 02, 2010, 11:58:24 PM »
 I did this once. Worse, I reformatted an ext3 into NTFS, full-format. Loaded up live cd , installed testdisk, and used it to recover the partition. Took a while, but got everything back.
There is no shame in saying "I don't know".