Can't understand how to share folders as nfs shares

Added an external drive that I’ve managed to create directories and sonar downloads to those directories.
I have installed an nfs server because I want to shares those directories to another htpc connected to my tv. When I type exportfs I get /mnt/dietpi_userdata which is not the path to my directories, how do I edit the export file so it points to the correct directories?

Also I can’t establish a nfs connection from the client side, on my Mac it says I don’t have permission and on my htpc the ip adress does not show up ( only my nas shows up which also has nfs shares )

Simply have a look at our online docs. There is a section on how to change export directory File Servers Options - Docs

1 Like

yeah looked at those but I don’t understand how to edit, could I do it within pie, I’m not too familiar with linux

Yes you can use the tool nano to edit files directly on the OS.

1 Like

Ok, I will try to edit the file, but should’t I still get a connection to the default nfs shares: /mnt/dietpi_userdata

You do not need to keep the default share/export. That is just setup so that a commonly wanted directory is accessible by NFS clients OOTB. But best is to share only those directories you really want clients to have access to.

ok, well as I said I can’t get a nfs connection with the default shares, is there a way to check the nfs server is started?

You can check following

systemctl status nfs-kernel-server
journalctl -u nfs-kernel-server

looks like its running, why does my Mac or htpc not see the shares?

You can try on your clients showmount -e <> to see if the shares are available.

I’m just guessing, probably NFS shares are not broadcasted by default. On a Linux system showmount -e will list available shares.

I got this after typing in terminal:

Exports list on

when editing the export file In nano I get this:
mnt/dietpi_userdata *(rw,async,no_root_squash,fsid=0,crossmnt,no_subtree_check)

do I need to change anything except my download location?

I don’t have a Mac to test. Therefore, I used a Windows box, and it was working ootb without any changes needed to be done. Not sure how MacOS is doing.

Maybe following could help using a Mac

ok, well I’m just using a Mac to test, I will be connecting to the files with another htpc with kodi and the shares did not show up there

changed to path but got this error message:
exportfs: /mnt/62BE-D5DE does not support NFS export. ( 62be-d5de it my external hard drive )

what file system format the drive has?

lsblk -o name,fstype,label,size,ro,type,mountpoint,partuuid,uuid

exfat, which is a linux format right, seems like people are having problems with that, guess I will try samba, one would think a linux to linux machine would work better with nfs?

maybe there is a misconception, what do you mean with that? Did you try to mount it?

Nope, exfat is fare away from being a Linux file system format. It did not support Linux file system permission. You would need to use ext4.

To use a Samba server, ext4 would be working as well.

well since I use exfat I think we can conclude that it don’t seem to work with nfs shares on dietpi.

I have installed samba but running into other problems, but that is a new thread, :pensive:

Exfat is not a Linux file system format and will not work together with NFS on any Linux system. This is not a limitation of DietPi. Simply use ext4.

1 Like