LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   DD command output to file (https://www.linuxquestions.org/questions/linux-newbie-8/dd-command-output-to-file-770185/)

jonny1517 11-19-2009 06:48 AM

DD command output to file
 
Hi All,

Just been looking round your site for the answer to this question.

I have win XP installed on 5 PCs on CF cards.
I am trying to clone the cards from a card reader to a file on a usb HD.

I have been able to clone the CFs to the HD as an image but not to a file.

I am runing Linux from a CD and using the following :

dd if=/dev/sda1 of=/dev/sdb1

I have tried

dd if=/dev/sda1 of=~/backup.img to send it to my users directory. But this fails, I presume as the directory is no my CD.

Any help would be great.

Thanks

Jon

catkin 11-19-2009 07:18 AM

Try of=/home/<your logon name./backup.img. The shell does not "see" the ~ in that position because it is not at the beginning of a "word". From the GNU Bash Reference: "If a word begins with an unquoted tilde character (‘~’) ...".

jonny1517 11-19-2009 08:19 AM

Hi,

Thanks for that, Still a bit lost though.

Any help on the command I need to create a image of a filesystem from device a to a file on device b.

Where device a is a cf card, device b is a usb HD and the file name is backup.img

Thanks again

jon

pixellany 11-19-2009 08:49 AM

To write to a file, you have to have the correct pathname and the device has to be mounted.

Example: to write a file named "myfile" to partition #2 of drive #1:

The device is most likely sda2. Let's mount it in /mnt (but could be anywhere you like):

Code:

mkdir /mnt/abc
mount /dev/sda2 /mnt/abc

Now you can write a file to /mnt/abc

malekmustaq 11-19-2009 08:55 AM

Quote:

Thanks for that, Still a bit lost though.
Any help on the command I need to create a image of a filesystem from device a to a file on device b.

Okay. This help might be what you need for the purpose: right click and save this pdf instructions in working with windows and linux using "dd" command to back up windows files. Also to get the soul of what and how "dd" does for your work read this.

Quote:

Where device a is a cf card, device b is a usb HD and the file name is backup.img
Thanks again
jon

Yes you can do it, so long as you have properly mounted the devices involved in the process.

Hope this helps.
Good luck.

jonny1517 11-20-2009 04:56 PM

Thanks all for your help. Ill give it a go.

I have been able to do a clone however with PING 3.0

Jon

prik420 11-21-2009 10:10 AM

it would be of great help if you specify the error message you're getting so others can give you a more clear answer/workaround


All times are GMT -5. The time now is 08:34 AM.