LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-05-2007, 12:56 AM   #1
asridhars
LQ Newbie
 
Registered: Sep 2007
Posts: 3

Rep: Reputation: 0
dd corrupted my hard disk


Dear all,
I'm not even sure if this is right forum where i should post my query. But here is my problem (hope someone can help)

I have a 160Gb Hard disk, with two partitions one had windows 2000 Pro and the other Linux Fedora Core 2. Grub was the boot loader.

I've installed cygwin under win2k. I wanted to create a Linux bootable USB Stick, and so used dd command (dd if=bootdisk.img of=/dev/sda) from the bash within cygwin. But what it actually did was to write the bootdisk.img in the sector 0 of the local hard disk. When i rebooted the system, keep getting the error "BOOT ERROR" and nothing else

When i used the GPARTD Live CD it dose not recognise any of the partitions on the Disk.

I know all the data is there in the disk and safe for the moment, is there any way i can load an external boot loader and provide instructions to load either the windows or Linux to it. If possible let me know about it.

If not Please suggest an alternative method of restoring my HD without having to reformat. If this is possible.

Thanks
Sridhar.
 
Old 09-05-2007, 01:36 AM   #2
MS3FGX
LQ Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
How long did dd go before stopping? And how large was the bootable image?

The MBR is very small (512K, if memory serves), so if you wrote a ~30MB image to the drive starting with the MBR, you would have overwritten the MBR, partition table, and a good deal of the first partition on the disk.

In other words, you totally toasted the thing. Unless you have a backup of the partition table somewhere, recovery is probably beyond being practical. Even if you have the partition table backed up, you still will have lost some data.
 
Old 09-05-2007, 01:59 AM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,124

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
That's 512 bytes (one sector).
Fixing the partition table is generally pretty easy, recovering a filesystem that has been trampled on is less so.
*Especially* if it's NTFS - I've never had any real luck. You might get away with something like photorec or foremost. Search these fora - you will need plenty of spare time.
 
Old 09-05-2007, 02:20 AM   #4
asridhars
LQ Newbie
 
Registered: Sep 2007
Posts: 3

Original Poster
Rep: Reputation: 0
The data was only 4.58MB but looks like it created a partition of 12MB. DD returned almost immediately. Even after return from dd, the windows are running for another 10mnts before i rebooted the system.

Thanks
Sridhar
 
Old 09-05-2007, 02:24 AM   #5
asridhars
LQ Newbie
 
Registered: Sep 2007
Posts: 3

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by syg00 View Post
That's 512 bytes (one sector).
Fixing the partition table is generally pretty easy, recovering a filesystem that has been trampled on is less so.
*Especially* if it's NTFS - I've never had any real luck. You might get away with something like photorec or foremost. Search these fora - you will need plenty of spare time.
I've used some of the data recovery tools to check the basic sanity of the NTFS, looks most of the data is there.
 
Old 09-05-2007, 02:40 AM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,124

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Try testdisk to recover the second partition, then define another (dummy) partition to cover the rest.
- If the NTFS partition was first on the disk, then Fedora should be o.k. From the Fedora CD you can then recover grub and/or chroot into your disk install. From there is a matter of harvesting what data you can from the NTFS partition.
- If the Fedora partition was first on the disk, then NTFS should be o.k. - use the FC CD to set the NTFS as bootable (after testdisk), then boot the Win2k CD and run fixmbr from recovery console. If you were using LVM, I have no idea how you can get your Fedora system back if it was trampled on.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
SATA Hard disk(Windows) MBR corrupted by IDE hard disk(Linux) Peter_APIIT Fedora 6 07-07-2007 12:20 AM
Can I use a virtual machine hard disk as a real hard disk, or vice versa? onlineapps Linux - Software 1 02-24-2007 08:40 PM
60GB laptop hard disk & 200GB external USB hard disk linux compatibility powah Linux - Hardware 0 03-07-2006 10:55 AM
Linux corrupted due to full hard disk ravykanth Linux - Newbie 7 10-20-2003 06:42 PM
RH7.1 Install - Server class - hard disk corrupted DoubleLetter Linux - Software 2 08-14-2001 07:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:13 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration