Score:0

NTFS HDD as a data storage for docker containers

it flag

I have a NTFS HDD on which I have various docker-compose setups (e.g. postgres). The NTFS HDD is mounted as NTFS from Ubuntu and when I bind a folder from the HDD into a docker container, when the container wants to do chown or chmod it gets Operation not permitted.

Many docker images (as per good practices) will use a non-root user to run so they need to have the appropriate permissions on their directories. And those directories I want bound to the host file system, and not named volumes.

Here are my constraints:

  • I want the HDD to remain NTFS.
  • I would prefer to use file system mounts so that I can store the data of the containers alongside with their configuration on this HDD.
PonJar avatar
in flag
NTFS does not support normal Linux ownership permissions. You have to specify them in the mount command or in fstab and they apply globally across all directories and files. There are plenty of Q&A’s on here about how to do it.
it flag
Yes, I tried this - the point is that even if you mount with some `umask` the permissions still can't be modified further - e.g. in my case when a container wants to `chmod` or `chown` a directory
PonJar avatar
in flag
There is no way round that except use a Linux filesystem
it flag
Not sure how much of the same situation it is, but somehow WSL2 under windows managed to tackle this problem. In fact, the very same setup works with docker for windows over WSL2 with Ubuntu
PonJar avatar
in flag
That’s probably because there would be a translation layer between WSL2 and the underlying Windows system that manages the file storage which would be provided by Windows. That would have to exist to have WSL2 in the first place
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.