From 7081c8e0a06c78dbfe0b43a47ce7207e51671d95 Mon Sep 17 00:00:00 2001 From: Gabriel Altay Date: Sat, 4 Jan 2025 19:05:40 -0500 Subject: [PATCH] update ollama post --- _posts/2025-01-04-ollama-model-storage.md | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/_posts/2025-01-04-ollama-model-storage.md b/_posts/2025-01-04-ollama-model-storage.md index 74a7ddf..8db2194 100644 --- a/_posts/2025-01-04-ollama-model-storage.md +++ b/_posts/2025-01-04-ollama-model-storage.md @@ -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 @@ -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,