Unix & Linux
linux dd remote tftp arch-arm
Updated Fri, 02 Sep 2022 17:15:05 GMT

How to dd an image and save it to tftp without saving into local machine?


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




Solution

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.





Comments (2)