Find the answer to your Linux question:
Results 1 to 9 of 9
Not sure where to ask this, but I need help using dd_rescue for the first time.Trying to use it to copy data from a failing hard drive to a working ...
  1. #1
    Just Joined!
    Join Date
    Aug 2007
    Posts
    6

    dd_rescue help

    Not sure where to ask this, but I need help using dd_rescue for the first time.Trying to use it to copy data from a failing hard drive to a working hard drive.

    I'm running Xandros version 3.

    Here's where I'm at so far.

    Installed dd_rescue, don't know much about the commands yet, but read on another site to put this in to copy from one drive to another:

    # dd_rescue /dev/sda /dev/hda/backup.img
    (I put the names of the respective drives, "sda" being the drive on usb that I want to copy from, "hda" being the drive running in the computer that I want to copy on to)

    when I do, I get this error:

    dd_rescue: (fatal): open "/dev/hda/backup.img" failed: Not a directory
    What am I doing wrong??

    Thanks!!

  2. #2
    Linux Newbie
    Join Date
    Dec 2005
    Location
    Toronto
    Posts
    127
    Are you really trying to replicate the contents of the entire hard drive to another drive including the partition layout ? You might wanna go partition by partition as it easy to mount and recover from images partition by partition. Just a thought. It is not possible to mount an image of the entire disk including the partition table.

    dd_rescue: (fatal): open "/dev/hda/backup.img" failed: Not a directory
    Maybe, that error is caused due to the same reason that, you're trying to copy the entire HD including the partition table.

    Try this:
    dd_rescue /dev/sda1 /dev/hda1/backup-sda1.img
    This will copy the first partition on failing disk to an image file 'backup-sda1.img' on the working hard disk. Have you noticed that, I changed sda to sda1 and hda to hda1. It means you'll have to create the required number of partitions on the new disk and copy the images of all the partitions on the failing disk to one of partitions on the new disk. It means, you will need to have enought space on the new disk to hold the image files and be able to extract their contents.

    In case you don't understand the above, an image file as in the above, is actually a replica of an entire partition including your data and the system data. Once you've the image file, you'll have to mount it on a directory somewhere, and then go about extracting files from it just as you would open a .zip file and extract the contents. To do this you'll need a linux environment, may be you can use linux installation CD and enter into rescue mode. From there, you can not only run dd_rescue, you can also mount images and extract their contents too.

  3. #3
    Just Joined!
    Join Date
    Aug 2007
    Posts
    6
    Thank you for the response. I don't know if I'm trying to copy the whole drive.. I don't entirely enderstand how the whole partion thing works...

    I have a hard drive that was working fine, but will not boot anymore, and when I hook up via usb to a working system, it shows up as a removeable drive, but is not automatically mounted and it just says "please insert disc into removeable drive" so I can't access the data that way. (I can access files on other drives hooked up the same way just fine)

    Like I said, I don't understand how the partitions work, mainly what I'd like to get off the drive is some picture files. so I will try just copying partition by partition if I can figure out how.
    This will copy the first partition on failing disk to an image file 'backup-sda1.img' on the working hard disk.
    Do I have to make that file, or will dd_rescue create it on its own?
    Have you noticed that, I changed sda to sda1 and hda to hda1. It means you'll have to create the required number of partitions on the new disk and copy the images of all the partitions on the failing disk to one of partitions on the new disk. It means, you will need to have enought space on the new disk to hold the image files and be able to extract their contents.
    Okay, how do I create the required number of partitions on the new disk?

    And the disk I'm hoping to copy the data to is I think a total 5.679MB with 4,287MB of free space. (It just has a basic install of Xandros OS on it.) The bad disk is a total size of 4327MB, however I don't think all of it was being used, probably only 2-3GB out of the approx 4. (so I would have enough room to try, it sounds like, right?)

    This thing with the image files is new to me also..
    Once you've the image file, you'll have to mount it on a directory somewhere,
    Once I have it, will "mounting it on a directory somewhere" be self explanatory? (I wouldn't know what directory to mount it on, not sure if I even know what a 'directory' is )

    To do this you'll need a linux environment, may be you can use linux installation CD and enter into rescue mode. From there, you can not only run dd_rescue, you can also mount images and extract their contents too.
    Now I'm not sure what you mean a linux enviroment, I have xandros (same os as the bad drive) on the new drive mentioned above that I want to copy the data to, will this work?

  4. #4
    Linux Newbie
    Join Date
    Dec 2005
    Location
    Toronto
    Posts
    127
    Here's a link that has a short guide on dd_rescue:
    Recover Data From a dead hard drive using ddrescue -- Debian Admin

    If getting the failing disk to work in a USB enclosure is not possible, then you might have to try and use it as an internal IDE drive and see if that works. If it seems impossible to get your disk detected, you might have to resort to approaching data recovery experts !

    Boot into Xandros and once you have the bad drive detected, find out what drive letter it uses and run the following command:

    sudo fdisk -l
    This will list the partitions on the bad drive. Depending upon how you'd formatted the drive, you might have just one partition or more. Next, follow the link above to the guide.

    Log in as root and create a directory, say, /bad-drive

    Now, run dd_rescue:
    dd_rescue /dev/sda1 /bad-drive/partition1.img
    I've assumed that, the bad drive has been given the letter hda and thus hda1 is the first partition.

    Do the samefor other partitions if any.

    For eg. for second partition:

    dd_rescue /dev/sda2 /bad-drive/partition2.img
    Once all is over, create a directory say, /mnt/bad-drive1

    Mount the first image like this:

    mount -o loop /bad-drive/partition1.img /mnt/bad-drive1
    If there're no problems, the contents of your first partition of the bad disk become available under /mnt/bad-drive1 directory. Now you can copy whatever files needed.

    Once you've copied all the files, unmount it like this:

    unmount /mnt/bad-drive1
    Repeat the same with other partitions if any.

  5. #5
    Just Joined!
    Join Date
    Aug 2007
    Posts
    6
    Quote Originally Posted by kevkim55 View Post

    Boot into Xandros and once you have the bad drive detected, find out what drive letter it uses and run the following command:

    sudo fdisk -l


    Where in that command do I put the name of the bad drive? and are you sure I put "sudo" there? I ask because I usually see it said to put "sudo" in commands if using ubuntu, which I'm not, I'm using xandros, if that makes any difference.

  6. #6
    Linux Newbie
    Join Date
    Dec 2005
    Location
    Toronto
    Posts
    127
    Look for a guide on sudo and you'll get an idea. It's not something specific to ubuntu.

    Just login as root and run 'fdisk -l'. You don't need to specify any drive letter !

  7. #7
    Just Joined!
    Join Date
    Aug 2007
    Posts
    6
    I see, I guess sudo is like typing su in console when not in administrator mode and putting in the password)


    Okay, I ran #
    fdisk -l
    And I got this:

    Disk /dev/hda: 6495 MB, 6495068160 bytes
    255 heads, 63 sectors/track, 789 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes

    Device Boot Start End Blocks Id System
    /dev/hda1 1 65 522081 82 Linux swap
    /dev/hda2 * 66 789 5815530 83 Linux


    Looks like it's talking about the main drive in the laptop that's running and not the bad drive that's on the USB.??

  8. #8
    Linux Newbie
    Join Date
    Dec 2005
    Location
    Toronto
    Posts
    127
    Unplug the USB drive. Open a konsole and type this:

    udevinfo

    Now, leave the konsole open and plug in your drive. Wait for a few seconds and post the output of udevinfo.

    Also, post the output of /var/log/messages.

  9. #9
    Just Joined!
    Join Date
    Aug 2007
    Posts
    6
    What do you mean "post the output of udevinfo" after plugging the usb drive in? (Sorry, I am a newbie to this!)

    This is what it says when I put udevinfo into console: (with usb unplugged)
    Usage: udevinfo [-anpqrVh]
    -q TYPE query database for the specified value:
    'name' name of device node
    'symlink' pointing to node
    'path' sysfs device path
    'all' all values

    -p PATH sysfs device path used for query or chain
    -n NAME node/symlink name used for query

    -r print udev root
    -a print all SYSFS_attributes along the device chain
    -d print the relationship of devpath and the node name for all
    devices available in the database
    -V print udev version
    -h print this help text

    This is what's in the /var/log/messages:
    Jun 17 14:53:41 build-v3-master syslogd 1.4.1#16: restart.
    Jun 17 14:53:43 build-v3-master kernel: klogd 1.4.1#16, log source = /proc/kmsg started.
    Jun 17 14:53:44 build-v3-master kernel: Cannot find map file.
    Jun 17 14:53:44 build-v3-master kernel: No module symbols loaded - kernel modules not enabled.
    Jun 17 14:54:05 build-v3-master exiting on signal 15

Posting Permissions

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