[GH-ISSUE #2497] [Linux] Ran out of space while installing llama2 model, can't delete or find #27220

Closed
opened 2026-04-22 04:20:02 -05:00 by GiteaMirror · 15 comments
Owner

Originally created by @saamerm on GitHub (Feb 14, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/2497

I installed ollama on my Linux EC2 machine with 8GB of Hard disk space and 4GB of free disk space.

I ran ollama run llama2 by mistake before checking the space, but it was too quick to download before I could react and I ran out of space, with this error "no space left on device"
Now can't delete or find the model, and ollama rm llama2 is useless. Where can I find the partially downloaded model to delete?

Originally created by @saamerm on GitHub (Feb 14, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/2497 I installed ollama on my Linux EC2 machine with 8GB of Hard disk space and 4GB of free disk space. I ran `ollama run llama2` by mistake before checking the space, but it was too quick to download before I could react and I ran out of space, with this error "no space left on device" Now can't delete or find the model, and `ollama rm llama2` is useless. Where can I find the partially downloaded model to delete?
GiteaMirror added the bug label 2026-04-22 04:20:02 -05:00
Author
Owner

@saamerm commented on GitHub (Feb 14, 2024):

Any idea? @easp @wrapss @remy415 @shersoni610

<!-- gh-comment-id:1944384574 --> @saamerm commented on GitHub (Feb 14, 2024): Any idea? @easp @wrapss @remy415 @shersoni610
Author
Owner

@jeffdhooton commented on GitHub (Feb 14, 2024):

@saamerm - on my arch machine it looks like they may be in /usr/share/ollama/.ollama/models/blobs.

I see a bunch of small file partial blobs there, right along side the larger blob files. I had started the download of a smaller codellama and cancelled it to instead download the 34b model file.

Not super familiar with the repo but it tracks when I look at the server's download.go file

screenshot_2024-02-14_13-38-29

<!-- gh-comment-id:1944389334 --> @jeffdhooton commented on GitHub (Feb 14, 2024): @saamerm - on my arch machine it looks like they _may be_ in `/usr/share/ollama/.ollama/models/blobs`. I see a bunch of small file partial blobs there, right along side the larger blob files. I had started the download of a smaller codellama and cancelled it to instead download the 34b model file. Not super familiar with the repo but it tracks when I look at the [server's download.go file](https://github.com/ollama/ollama/blob/main/server/download.go) ![screenshot_2024-02-14_13-38-29](https://github.com/ollama/ollama/assets/33258847/7e8d4bdb-5a70-4f83-a115-a3eb2ccb6c77)
Author
Owner

@remy415 commented on GitHub (Feb 14, 2024):

@saamerm as mentioned by @jeffdhooton, delete the files in /usr/share/ollama/.ollama/models and check ~/.ollama/models

<!-- gh-comment-id:1944391782 --> @remy415 commented on GitHub (Feb 14, 2024): @saamerm as mentioned by @jeffdhooton, delete the files in /usr/share/ollama/.ollama/models and check ~/.ollama/models
Author
Owner

@remy415 commented on GitHub (Feb 14, 2024):

Ollama when run as a service seems to save them in /usr/share/ollama by default, and my user mode binaries when I compile on my own seem to use ~/.ollama.

<!-- gh-comment-id:1944394434 --> @remy415 commented on GitHub (Feb 14, 2024): Ollama when run as a service seems to save them in /usr/share/ollama by default, and my user mode binaries when I compile on my own seem to use ~/.ollama.
Author
Owner

@saamerm commented on GitHub (Feb 14, 2024):

This is amazing, thank you all! I just need to figure out how to get around the permission issue when I try to get to that ollama directory now
Would it make sense to add this answer to an FAQ of some kind if someone else has the issue?

<!-- gh-comment-id:1944395897 --> @saamerm commented on GitHub (Feb 14, 2024): This is amazing, thank you all! I just need to figure out how to get around the permission issue when I try to get to that ollama directory now Would it make sense to add this answer to an FAQ of some kind if someone else has the issue?
Author
Owner

@remy415 commented on GitHub (Feb 14, 2024):

This is amazing, thank you all! I just need to figure out how to get around the permission issue when I try to get to that ollama directory now Would it make sense to add this answer to an FAQ of some kind if someone else has the issue?

If you installed as a service as root, you would’ve had to have root permissions to even complete the install. Try using sudo rm -rf /usr/share/ollama/.ollama/models/*

<!-- gh-comment-id:1944398815 --> @remy415 commented on GitHub (Feb 14, 2024): > This is amazing, thank you all! I just need to figure out how to get around the permission issue when I try to get to that ollama directory now Would it make sense to add this answer to an FAQ of some kind if someone else has the issue? If you installed as a service as root, you would’ve had to have root permissions to even complete the install. Try using sudo rm -rf /usr/share/ollama/.ollama/models/*
Author
Owner

@jeffdhooton commented on GitHub (Feb 14, 2024):

This is amazing, thank you all! I just need to figure out how to get around the permission issue when I try to get to that ollama directory now Would it make sense to add this answer to an FAQ of some kind if someone else has the issue?

If you run su and authenticate as a root user you can get there.

You can then cd into the dir and run something like find . -type f -name "*-partial*" -delete to get rid of all partials. I wouldn't blindly run that last command if I were you though, would double check.

<!-- gh-comment-id:1944399213 --> @jeffdhooton commented on GitHub (Feb 14, 2024): > This is amazing, thank you all! I just need to figure out how to get around the permission issue when I try to get to that ollama directory now Would it make sense to add this answer to an FAQ of some kind if someone else has the issue? If you run `su` and authenticate as a root user you can get there. You can then cd into the dir and run something like `find . -type f -name "*-partial*" -delete` to get rid of all partials. I wouldn't blindly run that last command if I were you though, would double check.
Author
Owner

@saamerm commented on GitHub (Feb 14, 2024):

there seems to have been an error with that session, I disconnected and came back and I didnt see the permission error. @jeffdhooton that was perfect. I used ollama run dolphin-phi instead. Right at the end I got this

...
verifying sha256 digest 
writing manifest 
removing any unused layers 
success 
Error: Post "http://127.0.0.1:11434/api/chat": EOF

Any ideas ? I made sure using df -H, I do have an additional 0.5GB of free space

<!-- gh-comment-id:1944428820 --> @saamerm commented on GitHub (Feb 14, 2024): there seems to have been an error with that session, I disconnected and came back and I didnt see the permission error. @jeffdhooton that was perfect. I used `ollama run dolphin-phi` instead. Right at the end I got this ``` ... verifying sha256 digest writing manifest removing any unused layers success Error: Post "http://127.0.0.1:11434/api/chat": EOF ``` Any ideas ? I made sure using `df -H`, I do have an additional 0.5GB of free space
Author
Owner

@pdevine commented on GitHub (Feb 18, 2024):

You shouldn't need to delete any of the files manually. If you stop the ollama service and restart it it should clean up any dangling files. You can also change the location of where the files are stored with the OLLAMA_MODELS env variable for the server. More details are here in the FAQ.

The EOF error seems should be unrelated. Usually it's because you have run out of memory or something has happened to the server. You'll need to look at the server logs to figure that out.

<!-- gh-comment-id:1950984448 --> @pdevine commented on GitHub (Feb 18, 2024): You shouldn't need to delete any of the files manually. If you stop the ollama service and restart it it should clean up any dangling files. You can also change the location of where the files are stored with the `OLLAMA_MODELS` env variable for the server. More details are [here in the FAQ](https://github.com/ollama/ollama/blob/main/docs/faq.md#how-do-i-set-them-to-a-different-location). The EOF error seems should be unrelated. Usually it's because you have run out of memory or something has happened to the server. You'll need to look at the server logs to figure that out.
Author
Owner

@saamerm commented on GitHub (Feb 29, 2024):

I also noticed that restarting and starting the server doesn't delete the temporary files in linux from the tmp directory, and it just starts filling up space on the computer

<!-- gh-comment-id:1970314801 --> @saamerm commented on GitHub (Feb 29, 2024): I also noticed that restarting and starting the server doesn't delete the temporary files in linux from the `tmp` directory, and it just starts filling up space on the computer
Author
Owner

@remy415 commented on GitHub (Feb 29, 2024):

@saamerm by design, all files in /tmp can be deleted at any time (that’s the whole point of the folder). You can manually clear them if they’re an issue

<!-- gh-comment-id:1970349102 --> @remy415 commented on GitHub (Feb 29, 2024): @saamerm by design, all files in /tmp can be deleted at any time (that’s the whole point of the folder). You can manually clear them if they’re an issue
Author
Owner

@0xrsydn commented on GitHub (Apr 23, 2024):

im using wsl and there is no .ollama or models in my ollama folder. The folder looks like this:

(base) rsydn9@RASYIDAN-PC:/usr/share/ollama$ ll
total 20
drwxr-x---   2 ollama ollama 4096 Feb 26 12:13 ./
drwxr-xr-x 145 root   root   4096 Apr  7 07:51 ../
-rw-r--r--   1 ollama ollama  220 Jan  6  2022 .bash_logout
-rw-r--r--   1 ollama ollama 3771 Jan  6  2022 .bashrc
-rw-r--r--   1 ollama ollama  807 Jan  6  2022 .profile

any idea how to free up my space as i want to delete mistral model from my local pc?

<!-- gh-comment-id:2071510889 --> @0xrsydn commented on GitHub (Apr 23, 2024): im using wsl and there is no .ollama or models in my ollama folder. The folder looks like this: ``` (base) rsydn9@RASYIDAN-PC:/usr/share/ollama$ ll total 20 drwxr-x--- 2 ollama ollama 4096 Feb 26 12:13 ./ drwxr-xr-x 145 root root 4096 Apr 7 07:51 ../ -rw-r--r-- 1 ollama ollama 220 Jan 6 2022 .bash_logout -rw-r--r-- 1 ollama ollama 3771 Jan 6 2022 .bashrc -rw-r--r-- 1 ollama ollama 807 Jan 6 2022 .profile ``` any idea how to free up my space as i want to delete mistral model from my local pc?
Author
Owner

@remy415 commented on GitHub (Apr 23, 2024):

@0xrsydn check /home/ollama/.ollama and /home/rsydn9/.ollama. Worst comes to worst, give it the ‘ole `sudo find / -name ‘.ollama’ 2>/dev/null’

<!-- gh-comment-id:2072050619 --> @remy415 commented on GitHub (Apr 23, 2024): @0xrsydn check /home/ollama/.ollama and /home/rsydn9/.ollama. Worst comes to worst, give it the ‘ole `sudo find / -name ‘*.ollama*’ 2>/dev/null’
Author
Owner

@infofromca commented on GitHub (Apr 27, 2024):

C:\Users\<YourUsername>\.ollama
in windows?

<!-- gh-comment-id:2081104059 --> @infofromca commented on GitHub (Apr 27, 2024): `C:\Users\<YourUsername>\.ollama` in windows?
Author
Owner

@pdevine commented on GitHub (May 9, 2024):

Ack, forgot to close this before. Just restart the ollama server. @0xrsydn check out the FAQ to see where the models are stored.

<!-- gh-comment-id:2101724749 --> @pdevine commented on GitHub (May 9, 2024): Ack, forgot to close this before. Just restart the ollama server. @0xrsydn check out the [FAQ](https://github.com/ollama/ollama/blob/main/docs/faq.md#where-are-models-stored) to see where the models are stored.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#27220