Accessing paid persistent disk in spaces

Hello Everyone,
I have a space with persistent disk running Python. I need to save some data to this disk, but I can’t seem to locate the standard /data directory. Do I need to use a specific API to interact with the /data directory on the Space?

hi @mukhtar , just to confirm are you trying to access /data at Docker runtime or buildtime? /data is only available after your Space is launched, i.e. at runtime.

hello @radames , Thank you for your response. To clarify, I am trying to access the /data directory at runtime. I have a Streamlit app that collects data from the user (in JSON format) and I want to permanently save this data. I attempted to directly write to /data , but the data is lost when the Space is restarted. Additionally, when I printed the available paths from the home directory, there was no /data directory listed.

Could you please try detaching and reattaching the storage device, followed by a factory reset?