Write to SD card on RPI

Hey, I was trying to understand if it’s possible for a Nerves application to access the contents of the SD card of a Raspberry Pi in read-write mode at all.

What I’d like to do is run the nerves system and have it dump its readings on the SD card in a way that I can read from any SD card reader, and routinely collect the readings this way.

This is allow for collection even if I don’t have access to any connectivity for the Pi.

Thanks in advance!

The /data (alias to /root) is writable. All the other partitions are read only though.

Thanks for your reply! I’ve tried writing to /data, but when I retrieve the SD Card I can’t see any files created

This is the file structure on the SD Card

Ah, I didn’t get that nuance. I‘m not sure that‘s possible. Even though I‘m not that deep on the details the filesystems are afaik virtual. Not sure how exactly the writable partition works given it still needs to write its contents somewhere

Check the 3rd partition on your sd-card. Nerves creates 3 partitions, 2 for the firmware and 1 for data.

That was very dumb of me! I didn’t realise the /data partition simply wasn’t mounted! Thanks for pointing me in the right direction :smiley:

1 Like