Move your models off C: — Ollama and LM Studio on Windows
My C: drive is full of models
错误信息
Error: write /Users/you/.ollama/models/blobs/sha256-...: There is not enough space on the disk.
| 如果你看到 | 原因是 | 前往 |
|---|---|---|
C: is nearly full and .ollama\models is tens of gigabytes | The default store lives in your user profile on the system drive | Fix 2: move the store and set OLLAMA_MODELS |
| You set OLLAMA_MODELS and nothing changed | Ollama was not fully restarted, so it still holds the old value | Fix 3: quit from the system tray, not the window |
| You uninstalled Ollama and got no space back | The uninstaller does not delete a custom model directory | Fix 5: delete the store yourself |
| The same model appears to be on disk twice | Ollama and LM Studio keep separate stores and do not share | Fix 4: pick one store, or accept the duplication knowingly |
| Ollama itself, not the models, is several gigabytes on C: | The application installs into your profile by default | Fix 6: reinstall with OllamaSetup.exe /DIR |
何时出现
Model files are the largest thing most people ever download deliberately. A single 70B at Q4 is around 40 GB; four or five mid-sized models will clear 100 GB without feeling like much. On a laptop with a 256 or 512 GB system drive that is the whole free-space budget, and Windows starts complaining about C: long before you connect it to the models you pulled last month.
- Windows is warning that C: is low on space and you have a second drive sitting nearly empty.
- A pull fails partway through with a disk-space error even though the machine has plenty of storage overall.
- You want models on a fast external NVMe rather than the system drive.
- You run both Ollama and LM Studio and suspect you are holding two copies of the same weights.
- You uninstalled Ollama to reclaim space and the drive is still full.
实际原因
Ollama on Windows stores models under C:\Users\%username%\.ollama\models — the docs also write this as %HOMEPATH%\.ollama. That is a per-user location on the system drive, chosen because it needs no Administrator rights, and it is not something the installer offers to change. The store is content-addressed: blobs sit in models\blobs named by digest, with small manifest files pointing at them, which is why the directory is opaque and why you must move it whole rather than picking files out of it. The application itself is separate again, roughly 4 GB in %LOCALAPPDATA%\Programs\Ollama. LM Studio keeps its own directory with its own copies and knows nothing about Ollama's, so running both means paying for the same weights twice.
如何修复
- 1
Find out what is actually using the space first
Before moving anything, check the size of the store and what is in it.
ollama listshows every model you have pulled with its size — most people find two or three they downloaded once and forgot. Removing those is faster than moving 200 GB to another drive, and it is free.# PowerShell — how big is the store, and what is in it? "{0:N1} GB" -f ((Get-ChildItem "$env:USERPROFILE\.ollama\models" -Recurse -File | Measure-Object Length -Sum).Sum / 1GB) ollama list # Remove one you no longer use ollama rm llama3.1:70b生效了吗?Re-run the size command. It should drop by roughly the sizeollama listreported for the model you removed.ollama list - 2
Move the existing store to another drive
Move the directory first, then point Ollama at it — doing it the other way round leaves Ollama looking at an empty folder and re-downloading everything. Quit Ollama completely from the system tray before you start; a running process holds file handles inside the store and the move will fail or, worse, half-succeed.
注意:Use Move-Item, not a copy-then-delete you finish by hand. If the move is interrupted, verify the destination has everything before deleting anything from the source — a half-moved content-addressed store looks fine and fails on the models whose blobs did not make it.# PowerShell — quit Ollama from the system tray FIRST Move-Item "$env:USERPROFILE\.ollama\models" "D:\ollama-models" # Point Ollama at the new location (persists for your account) [Environment]::SetEnvironmentVariable("OLLAMA_MODELS", "D:\ollama-models", "User")生效了吗?Start Ollama from the Start menu and list your models. Every model you had should still be registered — if the list is empty, Ollama is not reading the variable yet.ollama list - 3
Restart Ollama properly — quitting the window is not quitting
This is where most attempts fail. Ollama reads
OLLAMA_MODELSwhen the application starts, and closing its window leaves the tray process running with the old value. Right-click the tray icon and choose Quit, then start it again from the Start menu. Setting the variable through Settings → Edit environment variables for your account has the same requirement: existing processes never see it.# PowerShell — confirm the value that will actually be read [Environment]::GetEnvironmentVariable("OLLAMA_MODELS", "User") # Confirm nothing is still running before you relaunch Get-Process ollama*, "ollama app" -ErrorAction SilentlyContinue生效了吗?ollama listshows your models and a freshollama pullwrites into the new drive rather than C:.ollama pull gemma3:1b Get-ChildItem "D:\ollama-models\blobs" | Select-Object -Last 3 - 4
Decide what to do about LM Studio's separate copy
LM Studio has its own models directory, configurable in the app under My Models, and the two applications do not share a store. If you have pulled
llama3.1:8bin Ollama and downloaded the same weights in LM Studio, you are holding both. There is no supported way to point one at the other's store — the layouts are different, Ollama's being content-addressed by digest and LM Studio's a normal folder tree of.gguffiles. The realistic options are to pick one tool for a given model, or to keep both knowingly.# PowerShell — what each store costs you "{0:N1} GB Ollama" -f ((Get-ChildItem "$env:USERPROFILE\.ollama\models" -Recurse -File -ErrorAction SilentlyContinue | Measure-Object Length -Sum).Sum/1GB) "{0:N1} GB LM Studio" -f ((Get-ChildItem "$env:USERPROFILE\.lmstudio\models" -Recurse -File -ErrorAction SilentlyContinue | Measure-Object Length -Sum).Sum/1GB) - 5
Know that uninstalling does not reclaim a custom store
Ollama's own documentation is explicit: if you have changed
OLLAMA_MODELS, the installer will not remove your downloaded models when you uninstall through Add or remove programs. People uninstall expecting 200 GB back, get a few, and conclude the numbers were wrong. If you are removing Ollama for good, delete the model directory yourself afterwards.注意:This permanently deletes every model you have pulled, and they are multi-gigabyte re-downloads. Runollama listand note anything you want back before you do it.# PowerShell — after uninstalling, and only if you want the models gone Remove-Item "D:\ollama-models" -Recurse -Force - 6
Or stop needing the space — a smaller model is usually the real answer最常见的修复方法
Moving 200 GB to another drive is worth doing once. Downloading 200 GB you cannot run is worth stopping. Most of the space on a full drive is models too large for the machine's VRAM, kept in the hope they will be usable. Check what your card can actually run before the next pull, and the disk problem stops recurring. If it is the application rather than the models eating C:,
OllamaSetup.exe /DIR="d:\some\location"installs it elsewhere at install time.# PowerShell — install the app itself on another drive .\OllamaSetup.exe /DIR="d:\Ollama"检查哪些模型适配你的硬件see which model sizes are worth the disk space on your machine打开显存检查器 →
如果以上都没用
If the store is on a roomy drive and pulls still fail, the failure is in the download rather than the destination. If Ollama cannot find its models after the move, the environment variable is the thing to check — the same reading applies to every other Ollama setting on Windows.
- Out of disk space / failed GGUF download
- "ollama is not recognized" — PATH on Windows
- Ollama vs LM Studio vs Jan
- The value of
[Environment]::GetEnvironmentVariable("OLLAMA_MODELS", "User") - Output of
ollama listbefore and after the move - Free space on both drives (
Get-PSDrive C, D) - Whether you quit Ollama from the tray or only closed its window
相关内容
常见问题
Where does Ollama store models on Windows?
C:\Users\%username%\.ollama\models by default, which the documentation also writes as %HOMEPATH%\.ollama. The store is content-addressed, so blobs are named by digest rather than by model, and it must be moved as a whole directory.
Why did setting OLLAMA_MODELS not work?
Almost always because Ollama was not fully restarted. It reads the variable at application start, and closing the window leaves the tray process running with the old value. Quit from the system tray, then relaunch from the Start menu.
Can I use a symlink or directory junction instead?
It generally works, but OLLAMA_MODELS is the supported mechanism and should be your first choice. A junction adds a layer that survives no upgrade guarantees and confuses backup tools. Keep it as a fallback for cases where you cannot set the variable at all.
Do Ollama and LM Studio share downloaded models?
No. Each keeps its own directory in its own layout, so the same model downloaded in both costs disk space twice. There is no supported way to point one at the other. Pick one tool per model, or budget for the duplication deliberately.
I uninstalled Ollama and my disk is still full. Why?
Because the uninstaller does not remove a custom model directory — Ollama documents this explicitly. Delete the directory yourself after uninstalling. Note that this is permanent and every model is a multi-gigabyte re-download.