How to Move Ollama Models to Another Drive on Windows
By default, Ollama downloads all GGUF neural weights into your primary Windows system partition at C:\Users\<YourUsername>\.ollama\models. Once you download three or four modern models (such as Llama 3.1 8B, Qwen 2.5 14B, and DeepSeek R1), you can easily fill 40–80 GB of space on your main OS drive. Here is how to relocate your entire model library to a secondary SSD safely without losing your existing models or custom Modelfiles.
Method 1: The Recommended Way (Using OLLAMA_MODELS)
The cleanest and officially supported method is setting the OLLAMA_MODELS Windows environment variable. This tells the Ollama service daemon exactly where to look for manifests and tensor blobs.
Step 1: Fully Quit Ollama from System Tray
Before moving any files, ensure that Ollama is not actively locking blob files in memory. Look at your Windows taskbar system tray (bottom-right next to the clock), right-click the white llama icon, and select Quit Ollama.
You can also verify termination in PowerShell:
Stop-Process -Name ollama* -Force -ErrorAction SilentlyContinue
Step 2: Create the Destination Directory
Create a dedicated folder on your target drive (e.g. D:\OllamaModels or E:\AI\models). Run in PowerShell:
New-Item -ItemType Directory -Path "D:\OllamaModels" -Force
Step 3: Transfer Existing Models
Copy your existing manifests\ and blobs\ folders to the new location. Using PowerShell's robust Copy-Item:
Copy-Item -Path "$env:USERPROFILE\.ollama\models\*" -Destination "D:\OllamaModels" -Recurse -Force
robocopy tool in PowerShell:
robocopy "$env:USERPROFILE\.ollama\models" "D:\OllamaModels" /E /MT:16 /MOVE
The /MOVE flag moves the files and immediately frees up space on your C: drive.
Step 4: Set the Persistent Environment Variable
To ensure Ollama remembers this new path across Windows reboots, set the user-level environment variable:
[Environment]::SetEnvironmentVariable('OLLAMA_MODELS', 'D:\OllamaModels', 'User')
Step 5: Restart Ollama and Verify
Relaunch Ollama from the Windows Start Menu, open a fresh PowerShell window, and run:
ollama list
All your previously downloaded models should appear instantly with their tags and sizes intact.
Method 2: The Transparent NTFS Directory Junction
If you use containerized tooling or third-party wrappers that hardcode ~/.ollama/models, you can create a transparent NTFS directory junction (symbolic link). Windows will redirect all filesystem reads and writes to your D: drive behind the scenes.
- Quit Ollama completely.
- Move the
modelsfolder fromC:\Users\<User>\.ollama\modelstoD:\OllamaModels. - Open PowerShell or CMD as Administrator and create the junction:
cmd /c mklink /J "$env:USERPROFILE\.ollama\models" "D:\OllamaModels"
Performance Impact: NVMe vs SATA SSD vs HDD
Does storing models on a secondary drive slow down inference?
- NVMe M.2 SSD (Gen 3 / Gen 4 / Gen 5): Ideal. Model cold-load time (loading an 8B model into GPU VRAM) takes under 1.5 seconds. Token generation speed is identical to C: drive because once loaded, the model lives exclusively in GPU VRAM.
- SATA 2.5" SSD: Great. Loading an 8B model takes ~4 to 7 seconds. Zero impact on generation speed once loaded.
- Mechanical Hard Drive (HDD / External USB Drive): Not recommended. Loading a 16 GB model off a 5400 RPM mechanical disk can take 3 to 5 minutes, and if partial offload occurs, latency will be unmanageable.
Frequently Asked Questions
Can I store models on a network drive (NAS / SMB share)?
Technically yes, by pointing OLLAMA_MODELS to a mapped drive (e.g., Z:\OllamaModels) or UNC path (\\NAS\Models). However, network latency and gigabit ethernet limits (125 MB/s) will increase initial loading times significantly.
How do I revert back to the default C: drive location?
Simply delete the environment variable: [Environment]::SetEnvironmentVariable('OLLAMA_MODELS', $null, 'User') and move your models folder back to C:\Users\<YourUsername>\.ollama\models.
Will future model downloads automatically go to the new drive?
Yes. Any new model pulled via ollama pull, ollama run, or web UIs will write directly to your secondary drive.