I actually have your github PDF as part of our references in the bottom of my documentation for this project:
# References
# https://ohyaan.github.io/tips/raspberry ... emulation/
# https://github.com/thagrol/Guides/blob/ ... gadget.pdf
# https://www.kernel.org/doc/Documentatio ... torage.txt
# https://www.hydrogen18.com/blog/raspber ... evice.html
#
# https://gist.github.com/ianfinch/082883 ... e62a9f453f
Your guide specifically indicates that you cannot do read-write access from both sides, which is why we engineered the solution to be read-only from the mount/samba side. It also speaks of safety of file integrity, but the full scope of this is a bit over my head, hence asking for further advice. You write:
Lastly, I don't fully understand the order of how writes/commits happen with the .bin file; I'm reading but I don't get it yet. I've unmounted and remounted the .bin file as a read-only loop mount, and the files written while attached as a USB don't show up, but on a reboot they do. I am guessing that writes to the .bin file are somehow not committed until some sort of closure of the USB mass storage device, at which point I can remount the .bin and re-initialize the samba share. There's a lot of unclear stuff to me yet at this point, and while I am continuing to read, at this point the present solution is "when you want to pull the logs, ssh in, reboot the pi then open the share and pull the logs." This is acceptable as is, but I was hoping to better understand if there is a solution which would not require that.
# References
# https://ohyaan.github.io/tips/raspberry ... emulation/
# https://github.com/thagrol/Guides/blob/ ... gadget.pdf
# https://www.kernel.org/doc/Documentatio ... torage.txt
# https://www.hydrogen18.com/blog/raspber ... evice.html
#
# https://gist.github.com/ianfinch/082883 ... e62a9f453f
Your guide specifically indicates that you cannot do read-write access from both sides, which is why we engineered the solution to be read-only from the mount/samba side. It also speaks of safety of file integrity, but the full scope of this is a bit over my head, hence asking for further advice. You write:
When speaking of safety, can you explain further? Is this just risking file-corruption inside the .bin file we're using as the "usb storage space" or something else?Writing is safe if only the writing side has the backing store mounted. It is not safe if both sides have it mounted and are allowing writing nor is it safe if one side has it mounted read/write and the other read only.
Lastly, I don't fully understand the order of how writes/commits happen with the .bin file; I'm reading but I don't get it yet. I've unmounted and remounted the .bin file as a read-only loop mount, and the files written while attached as a USB don't show up, but on a reboot they do. I am guessing that writes to the .bin file are somehow not committed until some sort of closure of the USB mass storage device, at which point I can remount the .bin and re-initialize the samba share. There's a lot of unclear stuff to me yet at this point, and while I am continuing to read, at this point the present solution is "when you want to pull the logs, ssh in, reboot the pi then open the share and pull the logs." This is acceptable as is, but I was hoping to better understand if there is a solution which would not require that.
Statistics: Posted by surfrock66 — Thu Oct 02, 2025 10:58 pm