AIO data directory on NAS

Greetings All:

I’m struggling with an issue hosting the AIO data directory on a NAS. It appears the main issue relates to NAS directory ownership/permissions.

I have created an Ubuntu VM on Proxmox. In the VM I have created a mount to the ourfullhouse share:

root@cloud:/# df -h
Filesystem Size Used Avail Use% Mounted on
tmpfs 6.3G 2.1M 6.3G 1% /run
/dev/mapper/ubuntu–vg-ubuntu–lv 15G 12G 2.0G 86% /
tmpfs 32G 0 32G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
/dev/sda2 2.0G 95M 1.7G 6% /boot
192.168.2.5:/volume1/pve-39/nfs/ourfullhouse 28T 1.9T 26T 7% /mnt/data

On the NAS I have created the NFS share and you can see the UID/GID of 1000:10 respectively (aredman is user who owns share):

aredman@ADRNAS:/volume1/pve-39/nfs/ourfullhouse$ cat /etc/passwd | grep aredman

aredman:x:1000:10:UGREEN USER:/home/aredman:/bin/bash

On the Ubuntu VM in Proxmox I have the www-data user UID/GID changed to match the ā€˜aredman’ owner UID/GID:

root@cloud:/# cat /etc/passwd | grep www-data
www-data:x:1000:10 :www-data:/var/www:/usr/sbin/nologin

I can see a file that I have uploaded to Nextcloud via the cli in the Ubuntu VM (Bryan_resume_03JAN2025.pdf):

root@cloud:/volume1/pve-39/nfs/ourfullhouse/admin/files# ls -la
total 17544
drwxr-xr-x 6 33 33 4096 Jan 17 20:48 .
drwxr-xr-x 5 33 33 4096 Jan 14 20:52 …
-rw-r–r-- 1 33 33 72055 Jan 3 15:27 Bryan_resume_03JAN2025.pdf
drwxr-xr-x 2 33 33 4096 Jan 14 20:52 Documents
-rw-r–r-- 1 33 33 3963036 Jan 14 20:39 ā€˜Nextcloud intro.mp4’
-rw-r–r-- 1 33 33 12860647 Jan 14 20:39 ā€˜Nextcloud Manual.pdf’
-rw-r–r-- 1 33 33 50598 Jan 14 20:39 Nextcloud.png
drwxr-xr-x 2 33 33 4096 Jan 14 20:39 Photos
-rw-r–r-- 1 33 33 206 Jan 14 20:39 Readme.md
-rw-r–r-- 1 33 33 976625 Jan 14 20:39 ā€˜Reasons to use Nextcloud.pdf’
drwxr-xr-x 2 33 33 4096 Jan 14 20:49 Talk
drwxr-xr-x 2 33 33 4096 Jan 14 20:39 Templates
-rw-r–r-- 1 33 33 2403 Jan 14 20:39 ā€˜Templates credits.md’
root@cloud:/volume1/pve-39/nfs/ourfullhouse/admin/files#

However, I can’t see the files represented in the NAS with the directory owner of ā€˜aredman’, even though the UID/GID matches:

The NAS cli does not show me the files either when logged in as ā€˜aredman’:

nas-cli

So, even though I know the files are on the NAS as the /data directory is hosted on the NAS, I can’t see the files there.

On Ubuntu VM:
fstab: (permanent mount)
192.168.2.5:/volume1/pve-39/nfs/ourfullhouse /mnt/data nfs defaults 0 0

Docker Command to build the AIO:

For Linux:

sudo docker run
–init
–sig-proxy=false
–name nextcloud-aio-mastercontainer
–restart always
–publish 8080:8080
–env APACHE_PORT=11000
–env APACHE_IP_BINDING=192.168.2.9
*–env NEXTCLOUD_MOUNT=ā€œ/mnt/dataā€ *
*–env NEXTCLOUD_DATADIR=ā€œ/volume1/pve-39/nfs/ourfullhouseā€ *
–env SKIP_DOMAIN_VALIDATION=true
–volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config
–volume /var/run/docker.sock:/var/run/docker.sock:ro
nextcloud/all-in-one:latest

Your wisdom is appreciated.

I’ll add that I was not able to create the user ā€˜www-data’ on the NAS, as the NAS is already using that username for it’s own purposes, hence the username of ā€˜aredman’, but modifying the UID/GID to match on both sides.

OK, so bit of an update here. Knowing ā€˜now’ that the username doesn’t matter, but it’s the UID/GID of a user that is what matters, I can successfully change the UID/GID of the www-data user on the AIO VM to match the UID/GID of the NAS user that owns the specific directory/folder.

What is the correct user in AIO that owns the /data directory? You can see the www-data UID/GID as 1000:10, which matches the NAS folder owner. When I upload a file to NC via drag-n-drop into the desired folder, I still can’t see the files as I should be able to. So … what user from the output below UID/GID should match the NAS folder ownership?

root@cloud:/mnt/data# more /etc/passwd
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
bin:x:2:2:bin:/bin:/usr/sbin/nologin
sys:x:3:3:sys:/dev:/usr/sbin/nologin
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/usr/sbin/nologin
man:x:6:12:man:/var/cache/man:/usr/sbin/nologin
lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin
mail:x:8:8:mail:/var/mail:/usr/sbin/nologin
news:x:9:9:news:/var/spool/news:/usr/sbin/nologin
uucp:x:11:11:uucp:/var/spool/uucp:/usr/sbin/nologin
proxy:x:13:13:proxy:/bin:/usr/sbin/nologin
www-data:x:1000:10:www-data:/var/www:/usr/sbin/nologin
backup:x:34:34:backup:/var/backups:/usr/sbin/nologin
list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin
irc:x:39:39:ircd:/run/ircd:/usr/sbin/nologin
_apt:x:42:65534::/nonexistent:/usr/sbin/nologin
nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin
systemd-network:x:998:998:systemd Network Management:/:/usr/sbin/nologin
systemd-timesync:x:997:997:systemd Time Synchronization:/:/usr/sbin/nologin
dhcpcd:x:100:65534:DHCP Client Daemon,:/usr/lib/dhcpcd:/bin/false
messagebus:x:101:102::/nonexistent:/usr/sbin/nologin
systemd-resolve:x:992:992:systemd Resolver:/:/usr/sbin/nologin
pollinate:x:102:1::/var/cache/pollinate:/bin/false
polkitd:x:991:991:User for polkitd:/:/usr/sbin/nologin
syslog:x:103:104::/nonexistent:/usr/sbin/nologin
uuidd:x:104:105::/run/uuidd:/usr/sbin/nologin
tcpdump:x:105:107::/nonexistent:/usr/sbin/nologin
tss:x:106:108:TPM software stack,:/var/lib/tpm:/bin/false
landscape:x:107:109::/var/lib/landscape:/usr/sbin/nologin
fwupd-refresh:x:989:989:Firmware update daemon:/var/lib/fwupd:/usr/sbin/nologin
usbmux:x:108:46:usbmux daemon,:/var/lib/usbmux:/usr/sbin/nologin
sshd:x:109:65534::/run/sshd:/usr/sbin/nologin
aredman:x:1001:1001:adr:/home/aredman:/bin/bash
_rpc:x:110:65534::/run/rpcbind:/usr/sbin/nologin
statd:x:111:65534::/var/lib/nfs:/usr/sbin/nologin

Thoughts?

Andy

Recommended is 33:0 and 750. This is mentioned here for example: GitHub - nextcloud/all-in-one: šŸ“¦ The official Nextcloud installation method. Provides easy deployment and maintenance with most features included in this one Nextcloud instance.

Much appreciated. I solved the issue this way:

sudo docker run
–init
–sig-proxy=false
–name nextcloud-aio-mastercontainer
–restart always
–publish 8080:8080
–env APACHE_PORT=11000
–env APACHE_IP_BINDING=192.168.2.9
**–env NEXTCLOUD_DATADIR=ā€œ/mnt/dataā€ **
–env SKIP_DOMAIN_VALIDATION=true
–volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config
–volume /var/run/docker.sock:/var/run/docker.sock:ro
nextcloud/all-in-one:latest

Solution:
I removed the **–env NEXTCLOUD_MOUNT=ā€œ/mnt/dataā€ ** statement and configured the data directory as:

**–env NEXTCLOUD_DATADIR=ā€œ/mnt/dataā€ **

There was the underlying host mount via NFS to the NAS. I did have to match the UID/GID for the NAS directory to be the same for the www-data and the permission set at 750. I can now see files uploaded and populated into the NAS as desired.

The one caveat I’ll mention that I’m slightly confused on is that if I am logged in to the VM hosting Nextcloud via SSH and navigate to /mnt/data and manually put a file there (such as ā€˜touch test.txt’), that file can be seen in the NAS and the VM, but in Nextcloud Files, that file can’t been seen. Do you know why that may be?

Yes. You are missing Files Scan:
https://docs.nextcloud.com/server/stable/admin_manual/configuration_server/occ_command.html#scan

1 Like

Fab. Thanks much. Makes sense. Really appreciate all the help!

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.