Is it Possible to install image on Pi over network with dd? [solved]

Apologies if this has been asked before.

My RPi is in an old PC midi tower case which I have to dismantle and
load the SDcard on my PC.

At the moment my image is corrupted (almost certain its the FAT /boot partition). OSMC does not run but I have ssh access to the raspberry pi
and can mount the card over my linux network.

ssh osmc@192.168.0.5 “lsblk”
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 149.1G 0 disk
├─sda1 8:1 0 20G 0 part /mnt/backup
├─sda2 8:2 0 20G 0 part /mnt/music
└─sda3 8:3 0 100G 0 part /mnt/video
mmcblk0 179:0 0 14.5G 0 disk
├─mmcblk0p1 179:1 0 243M 0 part /boot
└─mmcblk0p2 179:2 0 14.2G 0 part /

Where sda is an external connected hard drive on the Pi and mmcblk0 is the whole sd card.

I an wondering if this command could be used executed from local linux machine:

ssh osmc@192.168.0.5 “dd if = osmc_rbp2.img bs=4M of=/dev/mmcblk0”

osmc_rb2 would be the actual image name on the loacl machine, and mmcblk0 the sdcard on the remote Pi.

If not, I will just remove the sdcard and image using dd on a linux laptop.
Thanks in advance.

No. dd would be run by the OS on the card, would not find the image and anyway you are asking it to overwrite itself.

1 Like

Thanks Graham, marking as solved.