Errors when setting samba and nfs share (usb stick)

Dietpi is running on a RPI-4. I connect a usb-stick to it to serve as a file dump for the whole network. It is simple and slow, i know, but i am just testing.

I go to the drive manager of dietpi, set /mnt/NAS (the usb stick) as the server address, i get the following error messages:


[FAILED] Samba mount failed with the following error output:                                               β”‚
β”‚                                                                                                            β”‚
β”‚ mount error(2): No such file or directory                                                                  β”‚
β”‚ Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)               β”‚
β”‚ mount error(2): No such file or directory                                                                  β”‚
β”‚ Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)               β”‚
β”‚ mount error(2): No such file or directory                                                                  β”‚
β”‚ Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)               β”‚
β”‚ mount error(2): No such file or directory                                                                  β”‚
β”‚ Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)               β”‚
β”‚ mount error(2): No such file or directory                                                                  β”‚
β”‚ Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)               β”‚
β”‚ mount error(95): Operation not supported                                                                   β”‚
β”‚ Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)     

Then i try to set a nfs share and it also gives me errors:

 [FAILED] NFS mount failed with the following error output:                                                 β”‚
β”‚                                                                                                            β”‚
β”‚ mount.nfs: mount(2): No such file or directory                                                             β”‚
β”‚ mount.nfs: trying 192.168.1.100 prog 100003 vers 3 prot TCP port 2049                                      β”‚
β”‚ mount.nfs: trying 192.168.1.100 prog 100005 vers 3 prot UDP port 53844                                     β”‚
β”‚ mount.nfs: mount(2): Permission denied                                                                     β”‚
β”‚ mount.nfs: access denied by server while mounting 192.168.1.100:/mnt/NAS                                   β”‚
β”‚ mount.nfs: timeout set for Sat May  4 11:52:56 2024                                                        β”‚
β”‚ mount.nfs: trying text-based options 'port=2049,vers=4.2,addr=192.168.1.100,clientaddr=192.168.1.100'      β”‚
β”‚ mount.nfs: trying text-based options 'port=2049,addr=192.168.1.100'                                        β”‚
β”‚ mount.nfs: prog 100003, trying vers=3, prot=6                                                              β”‚
β”‚ mount.nfs: prog 100005, trying vers=3, prot=17

Here’s the dmesg output:

[  851.404801] CIFS: Attempting to mount \\192.168.1.100\mnt
[  851.510982] CIFS: VFS:  BAD_NETWORK_NAME: \\192.168.1.100\mnt
[  851.528723] CIFS: VFS: cifs_mount failed w/return code = -2
[  851.550766] CIFS: Attempting to mount \\192.168.1.100\mnt
[  851.575436] CIFS: VFS:  BAD_NETWORK_NAME: \\192.168.1.100\mnt
[  851.585045] CIFS: VFS: cifs_mount failed w/return code = -2
[  851.600146] CIFS: Attempting to mount \\192.168.1.100\mnt
[  851.622278] CIFS: VFS:  BAD_NETWORK_NAME: \\192.168.1.100\mnt
[  851.630371] CIFS: VFS: cifs_mount failed w/return code = -2
[  851.644166] CIFS: Attempting to mount \\192.168.1.100\mnt
[  851.665922] CIFS: VFS:  BAD_NETWORK_NAME: \\192.168.1.100\mnt
[  851.676391] CIFS: VFS: cifs_mount failed w/return code = -2
[  851.691116] CIFS: Attempting to mount \\192.168.1.100\mnt
[  851.712194] CIFS: VFS:  BAD_NETWORK_NAME: \\192.168.1.100\mnt
[  851.725561] CIFS: VFS: cifs_mount failed w/return code = -2
[  851.743498] Use of the less secure dialect vers=1.0 is not recommended unless required for access to very old servers

[  851.743535] CIFS: VFS: Use of the less secure dialect vers=1.0 is not recommended unless required for access to very old servers
[  851.743567] CIFS: Attempting to mount \\192.168.1.100\mnt
[  851.757222] CIFS: VFS: cifs_mount failed w/return code = -95
root@DietPi:~#

Hello,
what filesystem type does the stick use?
and can you share you samba and/or NFS config please?

You probably set the wrong location name, it’s <host_address>\<share_name> and not the file path.

I guess a misunderstanding. You tried to map an external NFS & SAMBA share. Means, DietPi is acting as client. But I understood, you like to have set DietPi as a server. In this case, you need to install the server software using dietpi-software and not drive manager.

1 Like

The file system on the usb stick is exfat (i can change it to ntfs if that will make it easier). Where can i find the samba and nfs config so that i can share them with you?

Which server software exactly i shall use? I searched for server in apps and it brings a lot of results.

Go into dietpi-software and search for Samba server. This one to be installed.

Yeah it is the one i installed. I actually installed both the server and the client apps for both samba and nfs. So that is not the issue here. My issue is that i can not set a particular drive as shared.

Did you checked out online docs? There server config is explained a bit and how to set a specific folder to share.

OK you can ignore this now because i installed RPIOS on the Pi and everything works perfectly. I thought i needed dietpi for a more hassle free headless setup but it is also possible with RPIOS. Or even debian i guess. I also installed pihole. Everything works. Thanks anyway.

Everything can be done on DietPi. You just simply missed to read docs.

Simply install Samba server and change the folder to be exposed. Takes less than a minute.

I did exactly the same things on both RPIOS and Dietpi. β€œSomehow” it worked on RPIOS but not on Dietpi. I am not saying it wasn’t my fault, but yeah, it is what it is.

What do you mean with this? What exactly you did?

Because our software tool and our drive manager are not available on RPi OS. But both are needed to install Samba server and to mount the usb stick.

What i meant is that i followed some online guides as you asked me to, and i followed them precisely. I did not use the tools that dietpi offers this time. I manually set up the samba share. It worked on RPIOS. It did not work on Dietpi.

However, i gotta add, i can only β€œread” from my shared folder on RPIOS. Right now, i am trying to find a way to make it writeable.

I just want to say, when comes to setting up file sharing, i always find myself shaking my fist in the air. Since the old windows times, and now in linux, i do not understand why it has to be so damn hard to share files in between computers. There is always something missing. It is taking me literal β€œhours” to set up such a simple thing. Damn you computing.

I did not ask to read whatever guid. It was more the question if you checked our DietPi docs.

Anyway your issue might be the file system format of your usb stick. Best would be to use ext4.

And if you are willing to test DietPi again, we can bring up your samba server in a couple of minutes.

Yeah it took me a whole day’s work to get it working. I edited the fstab file to make the mounting automatic, however, just because the manual i followed did not include the line β€œnofail”, the next boot failed. Of couse not knowing that, i had to reflash the whole OS. Then i include the nofail to fstab, this time, it doesn’t work. Drive is not mounted. Found out that the drive was corrupted during the process. Then i said f. it, let’s try ext4. fstab edit did not work, no matter what i did. Then i tried to find other ways to automate the mounting and i have tried the systemd method. Not working.

I slept on it.

Today, i used β€œAI” to find a solution and microsoft copilot tells me to edit the fstab file like this:

UUID=β€œuuid of the drive” /mnt/usb0 ext4 defaults,auto,users,rw,nofail 0 0

I did that but i used the partuuid, and voila. It worked. I am transferring files over the network right now.

I don’t know why it wasn’t working yesterday but it is working today. I gave up seeking answers to such questions. It is absolutely worthless. I know that these things are β€œfree” as in free beer, so we are not really entitled to anything, but really, i’d expect a much smoother and easier experience under Linux after all those years. Still requires a lot of tinkering.

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