I want dd an image and save it to remote using tftp for example I'm trying to do

"dd if=/dev/mtd2" | save it to tftp server.

the direction of the file I have used in that code is wrong I'm trying my best to learn how it can be, this is the wrong code I made my self I mean half of it :'(

"dd if=/dev/mtd2" | tftp -l -p RootFS.bin | dd of=File.bin 


also if it's possible to transfer multiple folders and save it as one file on tftp for e.g I want to copy given below

/ #

or these directories

bin dev etc lib mnt opt proc root sbin sys tmp usr var

and save it as



tftp server

My wrong code is

tftp -l /bin && /dev/ && /etc/ && /lib/ && /mnt/ && /opt/ && /proc/ && /root/ && /sbin/ && /sys/ && /tmp/ && / usr/ && /var/ -r Linux.bin -p

  • Dear Can you mention the command for multiple directories transfer at once also. – noob-scientist Jul 26 '17 at 5:31

This is a tricky one, and it also appears you're using an embedded device (by the use of /dev/mtd).

It looks like you're trying to take an image of a block device, and create a 'bin' file on another machine. You may be overthinking this - a block device is openable as a file, and can be read by normal tools.

If that is what you are trying to achieve, the command you want to run is

tftp -l /dev/mtd2 -r file.bin -p

This opens the file /dev/mtd2 (even though it's a block device) and saves it as 'file.bin' on

  • Dear check the question again and see I've change it to /dev/mtd2 as I mistakenly use the wrong name before. Plz also check this satsig.net/cgi-bin/yabb/YaBB.pl?num=1249745511 – noob-scientist Jul 24 '17 at 20:40
  • 2
    I updated it, but the concept is the same - you can tread /dev/mtd2 as a file. There is no need to dd it. – xrobau Jul 24 '17 at 23:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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