Skip to content

Commit

Permalink
update ollama post
Browse files Browse the repository at this point in the history
  • Loading branch information
galtay committed Jan 5, 2025
1 parent 429d0e3 commit 7081c8e
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions _posts/2025-01-04-ollama-model-storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,20 @@ I then realized that the default model storage location is `/usr/share`.
This path is mounted on my OS disk and there is not much storage there so I wanted the downloaded models to be stored elsewhere.
It turns out this is a [common request](https://github.com/ollama/ollama/issues/680){:target="_blank"}
and it can be done using an `OLLAMA_MODELS` environment variable.
There are some [docs](https://github.com/ollama/ollama/blob/main/docs/faq.md#how-do-i-configure-ollama-server){:target="_blank"} on how to do it, but it took me a few tries.
The docs cover the pieces,
* [where models are stored](https://github.com/ollama/ollama/blob/main/docs/faq.md#where-are-models-stored){:target="_blank"}
* [configuring ollama service](https://github.com/ollama/ollama/blob/main/docs/faq.md#how-do-i-configure-ollama-server){:target="_blank"}

but it took me a few tries.

I have a 2TB data disk mounted at `/mnt/sdb`. I made an `ollama` directory there, gave it 755 permissions and made `ollama` the owner.
I have a 2TB data disk mounted at `/mnt/sdb`.
I made that direcory executable by `others` and then
made an `ollama` directory and gave it
* read, write, and execute permissions for user owner
* read and execute permissions for group owner and others

with the octal value 755 (read more about linux permissions [here](https://www.redhat.com/en/blog/linux-file-permissions-explained){:target="_blank"}).
I then made `ollama` the user and group owner of that directory.

``` bash
sudo chmod o+x /mnt/sdb
Expand Down Expand Up @@ -46,7 +57,7 @@ sudo systemctl daemon-reload
sudo systemctl restart ollama
```

Now new `ollama run` or `ollama pull` commands will use the `/mnd/sdb/ollama` directory for storage.
Now new `ollama run` or `ollama pull` commands will use the `/mnt/sdb/ollama` directory for storage.

Also very helpful, you can check out the ollama service logs using,

Expand Down

0 comments on commit 7081c8e

Please sign in to comment.