1

Hie

I have an SD card Module and can access connect two SD cards to my raspberry pi, however i would like to be write an image in the other card connected to the SD Card Module

2
  • 1
    Hello, what commands have you already tried and did you get any errors? Add this information to your question. Your question is a little open ended at the moment as its not clear if you are just asking how to write an image to an SD card or that you tried but are having problems. Commented Nov 18, 2019 at 13:01
  • I want to write an image to an SD Card. The image files are stored on a raspberry pi and i want to write them to the SD card connected to a raspberry Pi through an SD card module
    – Tawanda
    Commented Nov 18, 2019 at 13:13

1 Answer 1

1

You'll need to identify the device node representing the card. Understanding the difference between a block device, a device partition, and a filesystem is probably a good thing at this point. The device node is not a mount point. If there are no other storage devices attached to the Pi, it will probably be /dev/sda. Note for emphasis in case you did not read that link: not /dev/sda1.

Then if the image is raspberrypi.img:

sudo dd if=raspberrypi.img of=/dev/sda bs=4M status=progress

That will take a few minutes.

4
  • I understand the device node representing the card is a block device. Now i want to know is if it is possible to have a program like win32 disk imager runninh on the raspberry pi so i can use it to write new images to the SD card connected via an SD Card Module
    – Tawanda
    Commented Nov 18, 2019 at 13:32
  • 1
    Yes. This is the most bulletproof method; if you want a GUI instead it is only going to get more complicated, not less.
    – goldilocks
    Commented Nov 18, 2019 at 13:59
  • One user on the forums recently managed to get balenaEtcher to run on a Pi . I prefer using it than dd because Etcher verifies after flashing.
    – Botspot
    Commented Nov 18, 2019 at 14:41
  • Looks "more complicated" to me. I'd presume some frontend to gparted could do this too, although I have never tried. If you want to validate cmp raspberrypi.img /dev/sda should do it -- not sure if it will "fail" at the end of the image if reading /dev/sda does not end with EOF, but probably not and if so that is not a real problem: unix.stackexchange.com/q/29921/25985
    – goldilocks
    Commented Nov 18, 2019 at 14:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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