Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12
please don't laugh. I was trying to make a Chromium OS USB and typed sda instead of sdb into dd. I stopped it quick so mot too many files could ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2010
    Posts
    8

    [SOLVED] I dd'd My Hard Drive


    please don't laugh.

    I was trying to make a Chromium OS USB and typed sda instead of sdb into dd. I stopped it quick so mot too many files could have been damaged. I have 2 partitions (maybe three if I ever made that swap) and the most important files are in the second one. My computer won't start (surprise i know ) and I would LOVE to recover the files. I have tons of time to figure this out in the next little bit. If you could even point me in the right direction it would be apreciated.

    Thank you soo much. I've definatly learnt my lesson and will double check before executing potentially dangerous commands XP

  2. #2
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,729
    First of all, try to recover Partition Table and then try to mount partition to check if you can access data.
    Boot up from PartedMagic LiveCD or USB and run Testdisk on your Hard disk. It will detect partitions ( 99% times correctly ) and rewrite partition table.
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  3. #3
    Just Joined!
    Join Date
    Sep 2010
    Posts
    8
    First of all you're a hero.

    Secondly, it found my two partitions. Do I just hit 'write'? What exactly does this do? Shoud it restore them to how they were before?

  4. #4
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,729
    It will write partitions and most probably, you will recover your data after that.
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  5. #5
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,601
    As Homer Simpson would say - Doh! I hope you didn't lose too much data. Most Linux systems put /boot on the first partition, /swap on the second, and / on the third, so if you hit the "Oh Sh!t" key quickly enough, you might only have to reconstitute the /boot partition, and still have your programs and data intact.

    Let us know how it works out for you, and if we can provide further assistance/commiseration.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  6. #6
    Just Joined!
    Join Date
    Sep 2010
    Posts
    8
    I did the write and it seemed to work but my computer will still not boot. I'll try running a live usb tomorrow and see how if fare's. Hopefully I can just re-install over the first partition and the data will still be safe on the second. Thanks once again for the help.

  7. #7
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,729
    MBR was overwritten because of dd command and it wiped out Boot Loader too. Re-install boot loader and check if machine boot up after that.
    Which OS has been installed in sda1 and which Boot Loader were you using? It's easy to install Linux or Windows OS boot loader.

    the most important files are in the second one.
    Have you tried to mount second partition? If you did cancel dd command quickly, data in second partition is most probably intact.
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  8. #8
    Just Joined!
    Join Date
    Sep 2010
    Posts
    8

    The Solution!

    Thanks to you all I have successfully recovered everything that mattered.

    Here is what I did in hope that it can help others:
    1. Made a live PartedMagic USB and booted into the live environment.
    2. Ran TestDisk and once if found my old partitions clicked 'write'.
    3. Rebooted back into PartedMigic
    4. Ran GParted (Partition Editor) and checked and repaired my first partition. (It was partly damaged and this let me mount it).
    5. Found all my folders in the 'Lost+Found' folder in the root directory of my first partition.


    Some of my data was damaged because of dd but most of it was saved. I hope if others have the same problem they can have successful recovery's like myself and that my experiences can help them. But I would also like to remind everyone that it is a lot easier to be careful what you type especially when you have admin privileges. I know I have learned my lesson.

  9. #9
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,601
    Lesson 1: backup first
    Lesson 2: backup first
    Lesson 3: ...

    Been there, done that. Learned the hard way. Anyway, glad you are mostly sorted out now.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  10. #10
    Linux Engineer nujinini's Avatar
    Join Date
    Apr 2009
    Posts
    1,272
    Quote Originally Posted by Rubberman View Post
    Lesson 1: backup first
    Lesson 2: backup first
    Lesson 3: ...

    Been there, done that. Learned the hard way. Anyway, glad you are mostly sorted out now.
    Glad the OP was able to recover most of his data.

    This kind of cr#p happened to me a lot specially in my first 6 months. His/her step by step solutions is truly helpful indeed.

    And most of all, I have learned not to belittle or under estimate the benefits of having a backup. It could have saved me a lot of heart and head aches in the past.

    Cheers!
    nujinini
    Linux User #489667

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •