2

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 10.10.233.238 | 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

fielname.bin

on

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 10.10.233.238

1
  • Dear Can you mention the command for multiple directories transfer at once also. Commented Jul 26, 2017 at 5:31

1 Answer 1

3

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 10.10.233.238

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

2
  • 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 Commented Jul 24, 2017 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
    Commented Jul 24, 2017 at 23:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .