dd command to Windows

Soldato
Joined
28 Feb 2006
Posts
6,044
Location
Beds
Is there any way to output dd to Windows? I want to image a Linux device remotely over the lan and output it to a Windows pc.

I have managed to image Linux to Linux but i can get it to work with Windows. I am using SSH to connect to the device.

This is what i have tried. Ive only been testing it will small files to start with.

dd if=/home/beerbaron/Desktop/test.txt | ssh [email protected] dd of=c:\test\test.txt


I get the error message:

Unable to execute command or shell on remote system: Failed to Execute or process.


Thanks.
 
Last edited:
Is there any way to output dd to Windows? I want to image a Linux device remotely over the lan and output it to a Windows pc.

I have managed to image Linux to Linux but i can get it to work with Windows. I am using SSH to connect to the device.

This is what i have tried. Ive only been testing it will small files to start with.

dd if=/home/beerbaron/Desktop/test.txt | ssh [email protected] dd of=c:\test\test.txt


I get the error message:

Unable to execute command or shell on remote system: Failed to Execute or process.


Thanks.

Can you not go onto the linux machine and take an image, then just scp the image to the windows machine?
 
At present im using an Ubuntu laptop for testing but the device i need to image is an Amazon Kindle. I have managed to image 2 file systems on the Kindle already from said laptop. This was the Linux - Linux. I now need to image the Kindle from a Windows PC. I have Telnet, VNC, SSH and WinSCP access to it.

I need a way to connect, image the device and transfer the image to the local pc.
 
i'm new at this whole linux lark so I don't know much about it. but, if dd works linux to linux, could you not boot the pc off a live usb and do it that way?
 
You're getting the error because Windows doesn't have a dd command and you are trying to get it to run one in the second portion of your command.

Have you tried installing a Windows version of dd (Google shows many links on a search for "dd for windows")? If you do so you may need to update your command to give the full path to the dd on the Windows box.
 
You're getting the error because Windows doesn't have a dd command and you are trying to get it to run one in the second portion of your command.

Have you tried installing a Windows version of dd (Google shows many links on a search for "dd for windows")? If you do so you may need to update your command to give the full path to the dd on the Windows box.

I have seen the dd.exe and such like that you can download but im not sure how i would get them to work with SSH. Normally they are command line with is run from the location of the file in the cmd prompt.

Any ideas?


Thanks
 
The op's problem made me curious. So I attempted to explore a solution.

I also thought that a Windows dd may be required.

However, from Ubuntu LiveCD ( VirtualBox VM, Host-Only Networking ), I ran :

dd if=/home/beerbaron/Desktop/test.txt | ssh [email protected] dd of=test.txt

and the file appeared at the root of my Windows User's directory. I do not have dd for windows installed at this time.

I used a Windows ssh server named MobaSSH.

I'm going to install PuTTY, ssh into VM Ubuntu and run the above command.

EDIT : The command also worked when using PuTTY to ssh into VM Ubuntu.

It doesn't appear to need dd for Windows at all. Unless I'm missing something?

Which SSH server are you running on your Windows box?
 
Last edited:
Unless I'm missing something?

I was. :o

I kept in mind that I had MinGW installed, as I conducted this experiment. I did not see dd.exe when I looked in the MinGW bin and sbin directories. I tried running dd from the MinGW shell and failed. So, I concluded that dd did not exist anywhere on the Windows box.

While observing the MobaSSH process with Process Explorer, I noticed it launching bash.exe. So, I relaunched the MinGW shell and ran :

Code:
bash.exe dd

and there it was.

I wonder why MobaSSH dumps me into the MinGW shell when I connect to the Windows box. Why not the cmd.exe shell? Does the bash shell take priority when MinGW is installed? :confused:

I am able to run native Windows commands by prefixing cmd /c
e.g.
Code:
cmd /c dir/a

Beerbaron, what you are trying to do is possible. Consider installing MinGW on your Windows box.
 
I could use VM and Linux but i was looking for a solution for Windows.

I used FreeSSHd for the server and PuTTY

I thought i better mention i had connection problems due the public/private keys as well
 
Last edited:
I could use VM and Linux but i was looking for a solution for Windows.

I used FreeSSHd for the server and PuTTY

You don't need a VM and Linux. I only used that to simulate the Amazon Kindle. ( Only have one laptop here ; No second machine with Linux on it )

If you install MinGW, all you then have to do is :

1. ssh into the Kindle, using PuTTY.
2. Run your command.
 
Last edited:
Install cygwin on the windows machine including the openssh-server package and the core tools.

Code:
dd if=/the/source/file bs=1M | gzip | ssh user@windowsmachine gunzip | dd of=/the/target/file

Bash and the core GNU tools ported to Windows is very useful.

PS:
the bs=1M option will speed up the process immensely.
the gzip and gunzip just compresses the file in the transfer.
 
Back
Top Bottom