NFS mounts to Debian VM not active?

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
I'm a little baffled here, and the thread title probably doesn't describe my problem very well. In short, I've shared a directory (/mnt/tank/media)via NFS on my NAS (running SCALE 22.12.3.3), and mounted a subdirectory of that directory (/mnt/tank/media/youtube)on a Debian 12 VM running under Proxmox. But files in that directory on the NAS don't appear in the Debian VM, and files created in the Debian VM don't appear on the NAS.

Thinking it might have something to do with mounting a subdirectory of the NFS export, I changed things on the Debian VM to mount the export itself. And when I change to the directory where it's mounted (/mnt/media), I can see the contents of /mnt/tank/media from my NAS, as I'd expect. But when I change to the youtube subdirectory, I see a directory and a file comprising about 73 MB that I don't see on the NAS itself. And on the NAS itself, there's a file that doesn't appear via NFS on the Debian machine.

The relevant line in fstab reads: 192.168.1.10:/mnt/tank/media/ /mnt/media nfs auto,nofail,noatime,nolock,intr,tcp,actimeo=1800 0 0. When I replace those options with defaults I'm seeing the same behavior.

Edit: And yes, mount reports that the share is mounted:
Code:
root@tube:~# mount | grep media
192.168.1.10:/mnt/tank/media on /mnt/media type nfs4 (rw,relatime,vers=4.2,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=192.168.1.118,local_lock=none,addr=192.168.1.10)


I'm sure it's something I'm doing wrong, but I'm stumped. Any ideas?
 
Last edited:

Whattteva

Wizard
Joined
Mar 5, 2013
Messages
1,824
Is that sub-directory (youtube) a different NFS export/dataset? Because you will get that wonky behavior when you're doing nested filesystem mounts like that on NFS. I find that nested mounts tend to work way better with SMB shares.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Is that sub-directory (youtube) a different NFS export/dataset?
It's a separate dataset, but not a separate export--TrueNAS wouldn't let me set up a separate export for that dataset (I get an error saying "/mnt/tank/media/youtube is a subtree of /mnt/tank/media and already exports this dataset for 'everybody', i.e. '*'". But if I create a subdirectory, that works as expected.

Interestingly, I have other NFS exports for sub-datasets--e.g., both for /mnt/tank/Video and /mnt/tank/Video/Movies. So TrueNAS allowed this at one point, but not any more.
 

Whattteva

Wizard
Joined
Mar 5, 2013
Messages
1,824
Ah I see. I would bet you that if you unmount the dataset on the NAS, you would probably see those allegedly "phantom" files that you see in the Debian VM, but not on the NAS.

It's interesting that it's not letting you export them separately because they are technically different file systems. I"m guessing maybe you have "All Dirs" option checked?

WIth NFS nested exports, if you want them to work properly, you have to export them individually and disable the "All Dirs" option checked.

I actually have nested datasets like you setup that work just fine, but I do set them up separately with the "All Dirs" option unchecked.
On machines that I don't want to worry about having to make multiple mounting, I mount them through SMB and it works fine because these are read-only shares. This may not be feasible for some people though if read/write access are required which would probably complicate this mixed-protocol sharing setup.
 
Top