Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

this is the output of sudo fdisk -l:

ubuntu@PrecisePangolin:~$ sudo fdisk -l

Disk /dev/sda: 164.7 GB, 164696555520 bytes
255 heads, 63 sectors/track, 20023 cylinders, total 321672960 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x886f6824

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *          63   116117819    58058878+   7  HPFS/NTFS/exFAT
/dev/sda2       116119550   319580159   101730305    f  W95 Ext'd (LBA)
/dev/sda4       319580160   321671151     1045496   82  Linux swap / Solaris
/dev/sda5       116119552   237807608    60844028+   7  HPFS/NTFS/exFAT
/dev/sda6       237807616   319580159    40886272   83  Linux

Disk /dev/sdc: 2000 MB, 2000682496 bytes
255 heads, 63 sectors/track, 243 cylinders, total 3907583 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x01fd25ac

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1   *          63     3907582     1953760    c  W95 FAT32 (LBA)
ubuntu@PrecisePangolin:~$ 

I tried those two commands:

sudo ddrescue -r 3 /dev/sdc /dev/sda/ImageFileName.img /dev/sda/TextFileName.txt

sudo ddrescue -r 3 /dev/sdc /dev/sda6/ImageFileName.img /dev/sda6/TextFileName.txt

and got:

ddrescue: Can't open output file: Not a directory

and in other tryings I got:

ddrescue: Can't open input file: No such file or directory

where is my mistake? thanks!

if you need any more deatails i can give. any suggestion that my help is appreciated.

share|improve this question
    
If possible, please consider closing some of your other open questions by selecting the best answer (if they have one). Consider which answers have been useful and need an upvote. We need users to maintain their questions so that the site can be an effective tool for the next person with your problems. For more details on best practices consider reading the FAQ on asking questions. –  hexafraction Jun 12 '12 at 20:27
add comment

2 Answers

up vote 2 down vote accepted

You are attempting to write the image (and log) directly to the disk device, instead of a path on the filesystem. You should use something like this (which would put it in your home folder).

sudo ddrescue -r 3 /dev/sdc /home/yinon/ImageFileName.img /home/yinon/TextFileName.txt

If you are doing this from a Live CD, you will need to mount a hard drive prior to running ddrescue and change the output to point to the mounted filesystem. For example, if you wanted to back up the image to sda6, enter the following from a terminal:

sudo mkdir /media/backup
sudo mount /dev/sda6 /media/backup

You are creating the folder /media/backup, which is where we are mounting the drive.

You can also just click on the drive that you want to back up TO in Nautilus (the file manager) and it should automatically mount it. If you hover over it, it should show the full path to it, it should be something like /media/LABEL, where label is the label of your drive.

Your ddrescue command then would look something like this:

sudo ddrescue -r 3 /dev/sdc /media/backup/ImageFileName.img /media/backup/TextFileName.txt
share|improve this answer
    
yes, I'm running from a livdcd, but I have no enough space to backup on the linux harddrive. I need to backup into another drive that I got and have enough space in it. but while trying to backup into another harddrive-i got the error. . sorry to missunderstand but can you tell me more on how to make testdisk successed in backuping into another hard drive? should I mount it? how? thanks very much for help! –  yinon Jun 12 '12 at 20:48
2  
You will have to mount your other hard drive where you want the backed up image to reside. Details have been added to the answer. –  reverendj1 Jun 12 '12 at 21:08
    
thanks you both! now it successeded! and also i learn this very important thing about mounting. Thanks so much! –  yinon Jun 13 '12 at 4:24
    
I have one more question-Can I delete the backup folder after the process is finish (and the img and txt files are on the drive)? should I unmount it first? Thanks a lot! –  yinon Jun 13 '12 at 4:58
    
You're welcome. I'm glad to help. If you were backing up as a recovery method and have restored the image to another drive, then yes, you can delete it. If you were backing up just to have a safe copy and have copied it another drive, then yes you can delete it. It really depends on what your goal was. –  reverendj1 Jun 13 '12 at 13:57
show 2 more comments

Here's a trick to get ddrescue to save an image to and external hard drive.

If you try the above suggestion:

sudo ddrescue -r 3 /dev/sdc /home/yinon/ImageFileName.img /home/yinon/TextFileName.txt

you will get the error message:

ddrescue: Can't open output file: Not a directory

As mentioned above, "You are attempting to write the image (and log) directly to the disk device, instead of a path on the filesystem"

To trick ddrescue into writing directly to an external device do this:

  1. Create a folder on the external device (say a portable hard drive) and name it "ddrescue-image"
  2. Then create a link to this folder on the Desktop and rename it "ddrescue-image-link"
  3. Next open Terminal and enter:

    sudo ddrescue -r 3 /dev/sdb ~/Desktop/ddrescue-image-link/MyImage.img ~/Desktop/ddrescue-image-link/ddrescue-log.txt
    

Now your image will have been saved on the external device. Give it a try!

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.