Find the answer to your Linux question:
Results 1 to 5 of 5
Hi all. I am hoping you can help me recover these deleted files. I am an intermediate Linux user and was using dd to copy an .iso to a USB ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined! bonesTdog's Avatar
    Join Date
    Jan 2011
    Location
    Atlanta, GA
    Posts
    91

    Help recovering deleted files!


    Hi all. I am hoping you can help me recover these deleted files.
    I am an intermediate Linux user and was using dd to copy an .iso to a USB drive but somehow copied it to sdb instead of sdc and blew away my data storage drive - both partitions.

    The more detailed story:
    I have a HP notebook with two hard drives - one (sda) is multi-booted with a bunch of distros on it in separate partitions, and the other hard drive (sdb) has two partitions and all of my data. Now Gparted recognizes most of my sdb as unallocated space and the .iso file shows in /media/Ubuntu 13.04 amd64 which is actually on my second hard drive (sdb1) but mounted at /media. Fortunately I am anal about backing up my data and can get most of it back, but I would really prefer to recover this info rather than rebuild it from scratch.

    I wrote the following command "sudo dd if=/media/Data_Storage/Tod\ and\ Karen/Downloads/ubuntu-13.04-desktop-amd64.iso of=/dev/sdc bs=8M" but somehow it recognized sdb (with two partitions) as sdc and placed the image on my second drive and deleted the partitions and all the contents. df -h currently shows the USB drive mounted as sdc2, so maybe that is where I went wrong...

    Can anyone help point me in the right direction to recover my drive and/or let me know how I messed up the command so I don't do this again?

  2. #2
    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,574
    I suspect you have been fubar'd... Assuming the .iso was a 4GB iso image (more or less), then it blew away the first x gigabytes of your hard drive, including the boot loader and partition table. If you have a backup of your data, then you can re-install the system and restore your data (and re-install the applications). If you haven't, then your job just got a lot more "interesting" - as in the Buddhist curse "May you live in interesting times!"...
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  3. #3
    Just Joined! bonesTdog's Avatar
    Join Date
    Jan 2011
    Location
    Atlanta, GA
    Posts
    91
    Rats! I had a knew this was in interesting pickle.... Any idea where I went wrong with my command. (the only thing worse than doing this once, is to do it again!) I checked my command history and I did specify sdc correctly as listed in the original post. The USB is plugged in now and df -h shows it as sdc2. Why would it blow away sdb1 and 2? The only thing I can think of is that it didn't find sdc and so rolled down to sdb, but that doesn't make sense to me. Here is my current trashed df -h:
    /dev/sda13 9.7G 4.6G 4.6G 51% /
    udev 3.9G 12K 3.9G 1% /dev
    tmpfs 1.6G 1008K 1.6G 1% /run
    none 5.0M 0 5.0M 0% /run/lock
    none 3.9G 496K 3.9G 1% /run/shm
    /dev/sdb1 785M 785M 0 100% /media/Ubuntu 13.04 amd64 *** This is where the .iso went ***
    /dev/sda14 27G 172M 25G 1% /media/c9e91519-46dc-492b-bfbe-0d0a3aaf76cf
    /dev/sdc2 949M 949M 0 100% /media/openSUSE 12.3 KDE Live *** This is where I wanted it to go ***

  4. #4
    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,574
    This is one of those famous "Oh Sh!t" moments. You can try to use fsck to restore as much of the original file system on /dev/sdb1 as you can, but I am not too hopeful about that. There are file recovery tools that might help you. One is ext3undel which will try to recover ext2/ext3 files (probably will work on ext4 as well as it is based upon ext2). All I can say (having been there, done that...) is good luck!
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  5. #5
    Just Joined! bonesTdog's Avatar
    Join Date
    Jan 2011
    Location
    Atlanta, GA
    Posts
    91
    Thank goodness for Dropbox!

Posting Permissions

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