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 ...
- 08-26-2007 #1Just 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:
(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)# dd_rescue /dev/sda /dev/hda/backup.img
when I do, I get this error:
What am I doing wrong??dd_rescue: (fatal): open "/dev/hda/backup.img" failed: Not a directory
Thanks!!
- 08-26-2007 #2Linux 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.
Maybe, that error is caused due to the same reason that, you're trying to copy the entire HD including the partition table.dd_rescue: (fatal): open "/dev/hda/backup.img" failed: Not a directory
Try this:
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.dd_rescue /dev/sda1 /dev/hda1/backup-sda1.img
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.
- 08-28-2007 #3Just 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.Do I have to make that file, or will dd_rescue create it on its own?This will copy the first partition on failing disk to an image file 'backup-sda1.img' on the working hard disk.
Okay, how do I create the required number of partitions on the new 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.
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 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' isOnce you've the image file, you'll have to mount it on a directory somewhere,
)
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?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.
- 08-29-2007 #4Linux 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:
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.sudo fdisk -l
Log in as root and create a directory, say, /bad-drive
Now, run dd_rescue:
I've assumed that, the bad drive has been given the letter hda and thus hda1 is the first partition.dd_rescue /dev/sda1 /bad-drive/partition1.img
Do the samefor other partitions if any.
For eg. for second partition:
Once all is over, create a directory say, /mnt/bad-drive1dd_rescue /dev/sda2 /bad-drive/partition2.img
Mount the first image like this:
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.mount -o loop /bad-drive/partition1.img /mnt/bad-drive1
Once you've copied all the files, unmount it like this:
Repeat the same with other partitions if any.unmount /mnt/bad-drive1
- 08-29-2007 #5Just Joined!
- Join Date
- Aug 2007
- Posts
- 6
- 08-29-2007 #6Linux 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 !
- 08-29-2007 #7Just 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 #
And I got this:fdisk -l
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.??
- 08-29-2007 #8Linux 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.
- 08-29-2007 #9Just 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


Reply With Quote
