You are not logged in.

#1 2024-09-08 07:15:24

Renegado++
Member
Registered: 2024-09-08
Posts: 2

[SOLVED] NTFS mount and docker problem

Hi
I had several days with this problem:
I use NTFS mount for extra space on my arch Linux system because I need to run several services with persistence, this is my fstab mount options:

/dev/sdc11 /run/media/node/store1 ntfs-3g user,uid=1000,gid=1000,dmask=022,fmask=133,nosuid,allow_other 0 0 
/dev/sdc6 /run/media/node/store3 ntfs-3g user,uid=1000,gid=1000,dmask=022,fmask=133,nosuid,allow_other 0 0
/dev/sdd5 /run/media/node/store2 ntfs-3g user,uid=1000,gid=1000,dmask=022,fmask=133,nosuid,allow_other 0 0

but I tried this options too:

/dev/sdc11 /run/media/node/store1 ntfs-3g uid=1000,gid=1000,dmask=022,fmask=133 0 0 
/dev/sdc11 /run/media/node/store1 ntfs-3g uid=1000,gid=1000 0 0 
/dev/sdc11 /run/media/node/store1 ntfs-3g defaults 0 0  
/dev/sdc11 /run/media/node/store1 ntfs-3g defaults,uid=1000,gid=1000,iocharset=utf8,uhelper=udisks2  0  0

When I run Postgres service in any of NTFS stores (store1 or store2 or store3):

services:
  postgresProd:
    image: postgres:latest
    volumes:
      - ./data:/var/lib/postgresql/data  <-- persistent data
    environment:
     ...
    restart: always
    ports:
      - 5434:5432

I get:

chmod: changing permissions of '/var/lib/postgresql/data': Operation not permitted
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale "en_US.utf8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".

Data page checksums are disabled.

initdb: error: could not change permissions of directory "/var/lib/postgresql/data": Operation not permitted
                

I don't understand what happens but when I run the same service on USB flash memory(mounted by Thunar) all is ok!!!

$  postgres pwd
/run/media/node/2F61C608147F773F/services/postgres
$  postgres docker logs -f postgres-postgresProd-1

PostgreSQL Database directory appears to contain a database; Skipping initialization

2024-09-08 07:06:38.225 UTC [1] LOG:  starting PostgreSQL 16.4 (Debian 16.4-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
2024-09-08 07:06:38.225 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2024-09-08 07:06:38.225 UTC [1] LOG:  listening on IPv6 address "::", port 5432
2024-09-08 07:06:38.235 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2024-09-08 07:06:38.257 UTC [29] LOG:  database system was shut down at 2024-09-08 03:57:58 UTC
2024-09-08 07:06:38.280 UTC [1] LOG:  database system is ready to accept connections

This is mount output:

/dev/sdd5 on /run/media/node/store2 type fuseblk (rw,nosuid,nodev,noexec,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096,user)
/dev/sdc11 on /run/media/node/store1 type fuseblk (rw,nosuid,nodev,noexec,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096,user)
/dev/sdc6 on /run/media/node/store3 type fuseblk (rw,nosuid,nodev,noexec,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096,user)
/dev/sde on /run/media/node/2F61C608147F773F type ntfs3 (rw,nosuid,nodev,relatime,uid=1000,gid=1000,iocharset=utf8,uhelper=udisks2) < this mount options works great with docker Postgres service run

ls -alh from /run/media:

total 0
drwxr-xr-x   3 root root  60 Sep  8 02:45 .
drwxr-xr-x  42 root root 980 Sep  8 02:45 ..
drwxr-x---+  3 root root  60 Sep  8 02:45 node

but I tried too:

chown node:node node  #dont work it changes to root at the next reboot
mount all on /home/node/Devices #it dont work too

Can you please help me with correct fstab options to run docker services on my NTFS disk?
Why on USB docker services run if it is NTFS too?

Last edited by Renegado++ (2024-09-08 21:34:00)

Offline

#2 2024-09-08 12:22:01

seth
Member
Registered: 2012-09-03
Posts: 57,185

Re: [SOLVED] NTFS mount and docker problem

run/media/node/2F61C608147F773F uses the paragon ntfs3 driver, the other partitions ntfs-3g, which has only "beta" support for POSIX access bits, https://wiki.archlinux.org/title/NTFS-3 … d_releases

Standard disclaimer: NTFS isn't a suitable filesystem for posix systems, don't use it unless you need to share data between a windows and linux installation.

Offline

#3 2024-09-08 15:39:23

cryptearth
Member
Registered: 2024-02-03
Posts: 772

Re: [SOLVED] NTFS mount and docker problem

seth wrote:

Standard disclaimer: NTFS isn't a suitable filesystem for posix systems, don't use it unless you need to share data between a windows and linux installation.

even for exchange between windows and linux I recommend exfat over ntfs as it's properly support on both as it was made open in 2019

Offline

#4 2024-09-08 17:36:50

Renegado++
Member
Registered: 2024-09-08
Posts: 2

Re: [SOLVED] NTFS mount and docker problem

Thanks, @seth, I don't knew paragon ntfs3 driver. this is my new fstab:

/dev/sdc11 /run/media/node/store1 ntfs3 defaults,uid=1000,gid=1000,nosuid,iocharset=utf8,uhelper=udisks2 0 0  
/dev/sdc6 /run/media/node/store3 ntfs3 defaults,uid=1000,gid=1000,nosuid,iocharset=utf8,uhelper=udisks2 0 0
/dev/sdd5 /run/media/node/store2 ntfs3 defaults,uid=1000,gid=1000,nosuid,iocharset=utf8,uhelper=udisks2 0 0

And thanks for the recommendation @cryptearth, but it's the work PC
Please mark as [SOLVED]

Last edited by Renegado++ (2024-09-08 21:33:24)

Offline

#5 2024-09-08 19:58:37

seth
Member
Registered: 2012-09-03
Posts: 57,185

Re: [SOLVED] NTFS mount and docker problem

We can't (nor shouldn't) wink
You mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.

Offline

Board footer

Powered by FluxBB