Use dd to backup device over the network

2

I have a Raspberry Pi connected to the network along with a USB stick. Is it possible to use the dd command on my Raspberry Pi and automatically upload the iso to my Mac?

What I mean is on my pi could I do something like this: sudo dd if=/dev/mmcblk0 of=192.168.1.248/path/to/iso (ip address is my Mac)? If this is possible how would I do this?

I will be happy to make a server on my Mac if I need to.

iProgram

Posted 2015-05-21T15:35:01.853

Reputation: 505

1I don't have time to do a proper answer, but basically what you need is NFS. Mount some shared directory, and dd to it. – Jarmund – 2015-05-21T15:39:31.897

Answers

2

Mount to a remote directory on the Mac, using whatever interface you prefer (samba, nfs, etc). Then just dd to a file on the mount point.

Shorts

Posted 2015-05-21T15:35:01.853

Reputation: 31

1

No, dd will not work like that, but you can use ssh and redirection to do what you're looking for:

ssh user@pi "dd if=/dev/mmcblk0" > pi.iso

Andy Gajetzki

Posted 2015-05-21T15:35:01.853

Reputation: 11

0

The canonical answer from unix.se is to pipe through ssh.

$ dd if=/dev/sda | gzip -1 - | ssh user@remote dd of=image.gz

RedGrittyBrick

Posted 2015-05-21T15:35:01.853

Reputation: 70 632

So user@remote would be my Mac? – iProgram – 2015-05-21T16:02:10.033

@iProgram: Yes. – RedGrittyBrick – 2015-05-21T16:10:07.313