On 4/21/26 15:04, Mark Webb-Johnson wrote:
I recall when I tried it I found the unmount function wasn’t atomic, so not trivial to do.
I guess we could issue the shell command (which is atomic), but perhaps that would cause problems (with recursion into the shell)?
I think what is needed is a way to poll sdcard::m_unmounting or even a new sdcard entry point that starts the unmount and waits for it to complete (or fail).
A problem I see is that if there are files open on the sdcard (e.g. a log file or can log), the unmount attempt will fail. So you probably want equivalent to "log close" before trying to unmount the sd.
Craig
OVMS# sd unmount Error: SD unmount failed: ESP_FAIL OVMS# log status Log listeners : 3 File logging status: inactive Log file path : /sd/logs/ovms-dev.log Current size : 550.5 kB Cycle size : 1024 kB Cycle count : 0 Dropped messages : 0 Messages logged : 3227 Total fsync time : 6.0 s