[GH-ISSUE #2032] Unable to pull models on NTFS filesystem #1173

Closed
opened 2026-04-12 10:57:35 -05:00 by GiteaMirror · 10 comments
Owner

Originally created by @luannbertaud on GitHub (Jan 17, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/2032

Originally assigned to: @bmizerany on GitHub.

Hi,

Context

I am running ollama using the docker image, but I want to store the models on an external SSD to prevent the container from filling my computer storage.
The way I'm doing it, is that I mount the ~/.ollama/ directory of the container into my SSD.

Issue

Since the docker image is built with Linux as OS, I suppose that the GOOS variable is set to linux (I found this variable in code).
The problem is that my SSD is using NTFS filesystem, and the : (colon) character from the blobs file name (sha256:f7c4e...) is therefore forbidden.

Error: open /root/.ollama/models/blobs/sha256:4dc8bd...6e0dac-partial-0: invalid argument

Proposition

Make the replace condition (colon to hyphen) depends on filesystem, or replace colon by an universal character.

Disclaimer

I've never developed in GO, so I'm really not sure about the origin of the problem, maybe the issue is very different from what I think. However, downloading the blobs into the container before renaming (in manifest to) and moving them into NTFS filesystem worked.

Data

Docker Image: ollama/ollama:latest (sha256:80ed5afc9183bcf3b6c14d38f5b695472bb8af44f2d5fcfba5bbbb4a1a012e72)
Model: mistral:7b
OS: Fedora 37
Storage: External SSD - NTFS
Docker: 24.0.7

Originally created by @luannbertaud on GitHub (Jan 17, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/2032 Originally assigned to: @bmizerany on GitHub. Hi, ### Context I am running **ollama** using the docker image, but I want to store the models on an external SSD to prevent the container from filling my computer storage. The way I'm doing it, is that I mount the ` ~/.ollama/` directory of the container into my SSD. ### Issue Since the docker image is built with Linux as OS, I suppose that the `GOOS` variable is set to `linux` (I found this variable [in code](https://github.com/jmorganca/ollama/blob/d5a73533574acb02069e74f1d01f6775577391bc/server/layers.go#L51)). The problem is that my SSD is using NTFS filesystem, and the **:** (colon) character from the blobs file name (sha256:f7c4e...) is therefore forbidden. > Error: open /root/.ollama/models/blobs/sha256:4dc8bd...6e0dac-partial-0: invalid argument ### Proposition Make the replace condition (colon to hyphen) depends on filesystem, or replace colon by an universal character. ### Disclaimer I've never developed in GO, so I'm really not sure about the origin of the problem, maybe the issue is very different from what I think. However, downloading the blobs into the container before renaming (in manifest to) and moving them into NTFS filesystem worked. ### Data Docker Image: ollama/ollama:latest (sha256:80ed5afc9183bcf3b6c14d38f5b695472bb8af44f2d5fcfba5bbbb4a1a012e72) Model: mistral:7b OS: Fedora 37 Storage: External SSD - NTFS Docker: 24.0.7
GiteaMirror added the bugfeature request labels 2026-04-12 10:57:35 -05:00
Author
Owner

@pdevine commented on GitHub (Jan 27, 2024):

This one is tough because it would be pretty painful to migrate linux users over to using a different file layout scheme. I'm pretty sure this is working correctly if you run Ollama on Windows (we're getting closer to a release), but I hadn't anticipated someone using NTFS directly w/ Linux. I'm wondering if there is some kind of compatibility mode that you could use? I'm not sure how docker volumes map that in.

<!-- gh-comment-id:1912877070 --> @pdevine commented on GitHub (Jan 27, 2024): This one is tough because it would be pretty painful to migrate linux users over to using a different file layout scheme. I'm pretty sure this _is_ working correctly if you run Ollama on Windows (we're getting closer to a release), but I hadn't anticipated someone using NTFS directly w/ Linux. I'm wondering if there is some kind of compatibility mode that you could use? I'm not sure how docker volumes map that in.
Author
Owner

@luannbertaud commented on GitHub (Jan 29, 2024):

Unfortunately, I didn't find any way to solve this with docker volumes, in the end the filename is forbidden by the drive's FS.
I agree that migrating Linux users files is not a good solution, but do you think it's feasible to make the colon/hyphen replacement depends on the filesystem instead of the operating system ? This way it would be transparent for both Linux and Windows users.

<!-- gh-comment-id:1914364378 --> @luannbertaud commented on GitHub (Jan 29, 2024): Unfortunately, I didn't find any way to solve this with docker volumes, in the end the filename is forbidden by the drive's FS. I agree that migrating Linux users files is not a good solution, but do you think it's feasible to make the [colon/hyphen replacement](https://github.com/ollama/ollama/blob/d5a73533574acb02069e74f1d01f6775577391bc/server/layers.go#L51) depends on the filesystem instead of the operating system ? This way it would be transparent for both Linux and Windows users.
Author
Owner

@edisonzf2020 commented on GitHub (Feb 3, 2024):

+1

<!-- gh-comment-id:1925307762 --> @edisonzf2020 commented on GitHub (Feb 3, 2024): +1
Author
Owner

@aguang-xyz commented on GitHub (Feb 22, 2024):

I faced the same issue (running ollama via Docker on Linux with folder /root/.ollama mounted to external SSD using Exfat filesystem).

<!-- gh-comment-id:1959288650 --> @aguang-xyz commented on GitHub (Feb 22, 2024): I faced the same issue (running `ollama` via Docker on Linux with folder `/root/.ollama` mounted to external SSD using `Exfat` filesystem).
Author
Owner

@jikkuatwork commented on GitHub (Mar 11, 2024):

Wow! This is the reason why I wasn't able to store models in my external drive! The blobs file names seems to be the issue! Any chance you can change it so that it works in NTFS too?

<!-- gh-comment-id:1987704614 --> @jikkuatwork commented on GitHub (Mar 11, 2024): Wow! This is the reason why I wasn't able to store models in my external drive! The blobs file names seems to be the issue! Any chance you can change it so that it works in NTFS too?
Author
Owner

@pdevine commented on GitHub (Mar 11, 2024):

@jikkuatwork as a work around for now you can either reformat the external storage to something more friendly to Linux/MacOS (e.g. ext4 or APFS). If you're using Windows NTFS will work fine of course.

<!-- gh-comment-id:1988874374 --> @pdevine commented on GitHub (Mar 11, 2024): @jikkuatwork as a work around for now you can either reformat the external storage to something more friendly to Linux/MacOS (e.g. ext4 or APFS). If you're using Windows NTFS will work fine of course.
Author
Owner

@jikkuatwork commented on GitHub (Mar 15, 2024):

@jikkuatwork as a work around for now you can either reformat the external storage to something more friendly to Linux/MacOS (e.g. ext4 or APFS). If you're using Windows NTFS will work fine of course.

Thanks! I bought a new drive and solved the issue!

<!-- gh-comment-id:1999411834 --> @jikkuatwork commented on GitHub (Mar 15, 2024): > @jikkuatwork as a work around for now you can either reformat the external storage to something more friendly to Linux/MacOS (e.g. ext4 or APFS). If you're using Windows NTFS will work fine of course. Thanks! I bought a new drive and solved the issue!
Author
Owner

@pdevine commented on GitHub (Mar 15, 2024):

@jikkuatwork In the next version we'll switch everyone over to using NTFS compatible names. It should make it easier in the future.

<!-- gh-comment-id:2000588976 --> @pdevine commented on GitHub (Mar 15, 2024): @jikkuatwork In the next version we'll switch everyone over to using NTFS compatible names. It should make it easier in the future.
Author
Owner

@MattJE9601 commented on GitHub (Mar 17, 2024):

Temporary workaround that doesn't require reformatting your NTFS filesystem.
Use dd to create a virtual drive image on the NTFS drive, then mount it somewhere.
I primarily run linux but keep a windows partition and second large drive for gaming. I also keep that drive mounted in linux though for storing larger files. This is how I handle these issues.

dd if=/dev/zero of=virtual_drive.img bs=1M count=102400 (100GB)
mkfs.ext4 virtual_drive.img
mkdir /mnt/virtual_drive
mount -o loop virtual_drive.img /mnt/virtual_drive

<!-- gh-comment-id:2002648030 --> @MattJE9601 commented on GitHub (Mar 17, 2024): Temporary workaround that doesn't require reformatting your NTFS filesystem. Use dd to create a virtual drive image on the NTFS drive, then mount it somewhere. I primarily run linux but keep a windows partition and second large drive for gaming. I also keep that drive mounted in linux though for storing larger files. This is how I handle these issues. dd if=/dev/zero of=virtual_drive.img bs=1M count=102400 (100GB) mkfs.ext4 virtual_drive.img mkdir /mnt/virtual_drive mount -o loop virtual_drive.img /mnt/virtual_drive
Author
Owner

@bmizerany commented on GitHub (Apr 8, 2024):

A fix is included in the recent release, so I'm going to close this, but please file a new issue if you have any trouble using the newer releases.

<!-- gh-comment-id:2043230106 --> @bmizerany commented on GitHub (Apr 8, 2024): A fix is included in the recent release, so I'm going to close this, but please file a new issue if you have any trouble using the newer releases.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#1173