# How to add persistent storage for Balena OS on Raspberry PI?

**URL:** <https://forums.balena.io/t/how-to-add-persistent-storage-for-balena-os-on-raspberry-pi/15929>\
**Category:** balenaOS\
**Created:** [June 18, 2019, 2:38pm UTC](https://forums.balena.io/t/how-to-add-persistent-storage-for-balena-os-on-raspberry-pi/15929 "2019-06-18T14:38:49Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Sharvin26](https://avatars.discourse-cdn.com/v4/letter/s/57b2e6/32.png) [@Sharvin26](https://forums.balena.io/u/Sharvin26)\
**Post date:** [June 19, 2019, 5:20am UTC](https://forums.balena.io/t/how-to-add-persistent-storage-for-balena-os-on-raspberry-pi/15929/4 "2019-06-19T05:20:10Z")

</div>

I read the documentation that you shared and a discussion on the balena forum [#22](https://forums.balena.io/t/multicontainer-how-to-configure-persistent-storage/2678/22)

It cleared some concepts but I still have some doubts. Now I have a database file that I want to persists through all container update and changes.

**First Question =\>**

Where should I add the database to persist it? and How can I add it?

**Second Question** =\>  
What I understood from the above 2 links is that using `balena volume ls` I can confirm if the volume is loaded. But I am confused about How docker compose file should be constructed for that purpose?

```auto
volumes:
  Test-Database: {}
service-1:
  volumes:
    - 'Test-Database': #what should be added here?

```

**Question 3** =\>

what should I pass the database path in my application code?

---

_[View the full topic](https://forums.balena.io/t/how-to-add-persistent-storage-for-balena-os-on-raspberry-pi/15929)._
