[GH-ISSUE #1311] ollama causes "no space left on device" on common ubuntu installation. #62715

Closed
opened 2026-05-03 10:04:03 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @Dougie777 on GitHub (Nov 29, 2023).
Original GitHub issue: https://github.com/ollama/ollama/issues/1311

Many ubuntu installations expect data to be added to the /home folder which I think is very common on many linux distros. However ollama writes the massive model files to /usr/share/ollama. This is fine for the bin files etc. But the data should not go here.

Is there a way to specify the installation folder or data folder to avert this problem?

Here is the problem in detail:

$ ollama run neural-chat
pulling manifest
pulling b8dab3241977... 69% ▕████████████████████ ▏(2.9 GB/4.1 GB, 5.9 MB/s) [5m49s:3m23s]
Error: write /usr/share/ollama/.ollama/models/blobs/sha256:b8dab32419772a5edabf4d72fc41d7c815a54524ae8d17644cadaf532422a40f-partial: no space left on device

I uninstalled ollama but here is my file system structure. This is the default ubuntu file system structure.

Filesystem Size Used Avail Use% Mounted on
tmpfs 1.5G 2.4M 1.5G 1% /run
/dev/nvme0n1p1 28G 24G 2.8G 90% /
tmpfs 7.5G 62M 7.5G 1% /dev/shm
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 7.5G 0 7.5G 0% /run/qemu
/dev/nvme1n1p1 196M 97M 100M 50% /boot/efi
/dev/nvme0n1p3 411G 41G 350G 11% /home
tmpfs 1.5G 148K 1.5G 1% /run/user/1000

ollama is writing to my / (root) folder instead of /home where most the disk space is allocated.

Originally created by @Dougie777 on GitHub (Nov 29, 2023). Original GitHub issue: https://github.com/ollama/ollama/issues/1311 Many ubuntu installations expect data to be added to the /home folder which I think is very common on many linux distros. However ollama writes the massive model files to /usr/share/ollama. This is fine for the bin files etc. But the data should not go here. Is there a way to specify the installation folder or data folder to avert this problem? Here is the problem in detail: $ ollama run neural-chat pulling manifest pulling b8dab3241977... 69% ▕████████████████████ ▏(2.9 GB/4.1 GB, 5.9 MB/s) [5m49s:3m23s] Error: write /usr/share/ollama/.ollama/models/blobs/sha256:b8dab32419772a5edabf4d72fc41d7c815a54524ae8d17644cadaf532422a40f-partial: no space left on device I uninstalled ollama but here is my file system structure. This is the default ubuntu file system structure. Filesystem Size Used Avail Use% Mounted on tmpfs 1.5G 2.4M 1.5G 1% /run /dev/nvme0n1p1 28G 24G 2.8G 90% / tmpfs 7.5G 62M 7.5G 1% /dev/shm tmpfs 5.0M 4.0K 5.0M 1% /run/lock tmpfs 7.5G 0 7.5G 0% /run/qemu /dev/nvme1n1p1 196M 97M 100M 50% /boot/efi /dev/nvme0n1p3 411G 41G 350G 11% /home tmpfs 1.5G 148K 1.5G 1% /run/user/1000 ollama is writing to my / (root) folder instead of /home where most the disk space is allocated.
Author
Owner

@mxyng commented on GitHub (Jan 20, 2024):

Is there a way to specify the installation folder or data folder to avert this problem?

Yes you can set OLLAMA_MODELS to the location you want to store the models. The FAQ has more details.

A note however. The service runs with user/group ollama. If you change the models directory to some other location, the owner should still be ollama otherwise there will be permission problems.

<!-- gh-comment-id:1901362188 --> @mxyng commented on GitHub (Jan 20, 2024): > Is there a way to specify the installation folder or data folder to avert this problem? Yes you can set `OLLAMA_MODELS` to the location you want to store the models. The [FAQ](https://github.com/jmorganca/ollama/blob/main/docs/faq.md#how-do-i-set-them-to-a-different-location) has more details. A note however. The service runs with user/group ollama. If you change the models directory to some other location, the owner should still be ollama otherwise there will be permission problems.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#62715