That would be nice, I hope it.
For testing purposes, can you try the following mount in /etc/exports -
/tmp/foo instead of /mnt/foo
When I run exportfs -ra (as the Wiki instruction mentions), I received an error that the folder "does not support NFS export".
@lleachii,
I created /tmp/sata, then I changed my exports file to that and ran exportsfs -ra.
I got no error.
From my PC I tried to mount to /tmp/sata on my OpenWrt and I got the same error: mount(2); no such file or directory.
I didn't mention before, but on my OpenWrt /etc/fstab has no content; is that normal?
The content in /etc/config/fstab looks correct.
Yes, it is normal, /etc/config/fstab generates mount command that leaves impression in /proc/mounts.
I suppose a developer himself can provide more clarity on my NFS problem (?).
You also changed the mount point to /tmp/sata here and rebooted, correct?
Wonderful! ![]()
(BTW, it's created automatically.)
No I did not, you didn't tell me to do so. I also didn't know you have to reboot after such a change.
Not in my case. I first tried without the creation but then I got 'directory does not exist'.
I changed the mountpoint in /etc/config/fstab to /tmp/sata and rebooted; the content looks now:
config 'mount'
option device '/dev/sda1'
option fstype 'ext4'
option target '/tmp/sata'
option uuid 'xxxx'
option enabled '1'
I ran exportfs -ra again with no error.
I tried to mount xxx -vvv from my PC to the directory /mnt/NFS there.
Then I got: mount.nfs stale file handle for (null) on /mnt/NFS.
I don't know exactly what that means.
I just tried the mount from my PC again, this time to my local directory /mnt/NFS/Kimax (which I already had) and this time I get the same error as before:
mount(2); no such file or directory.
I just discover another remarkable thing.
In OpenWrt, mount shows: /dev/sad1 on /tmp/sata type ext4 (rw,relatime), but block detect only shows:
config 'mount'
option target '/tmp/sata'
option uuid 'xxxx'
option enabled '0'
The UUID is the same, but two opposite settings (?).
So is /tmp/sata then mounted yes or no?
In LuCi it won't mount dev/sda1 to mountpoint /tmp/sata.
Excellent.
Oh my. Let me verify that you've done all that's needed. In addition to the fstab above, /etc/exports should read:
# /mnt *(ro,all_squash,insecure,sync)
/tmp/sata 192.168.178.0/24(rw,no_root_squash,insecure,no_subtree_check,sync)
fsid=2shouldn't need to be specified- Not sure why you're using
no_root_squash- I assume you plan to write files as root, but I left it there
I wanted to ensure a fresh start.
To be clear, this post was quite confusing and is contrary to the other posts. The option enabled '1' config is the stanza that successfully mounted sda1. It's not clear what output you're referring to, why you only showed the inactive/disabled configuration, nor why you said LuCi wouldn't mount sda1.
I wanted to make 2 separate posts as not to add to the confusion
@lleachii,
thank you for your reply.
Yes, /etc/exports contains:
# /mnt *(ro,all_squash,insecure,sync)
/tmp/sata 192.168.178.0/24(rw,no_root_squash,insecure,no_subtree_check,sync, fsid=0)
Well the doc on https://openwrt.org/docs/guide-user/services/nas/nfs.server says: "on OpenWrt 21.02+ it's required to explicity specify a unique fsid ...".
I read that as from 21.02 and higher, so I used fsid.
No, I didn't understand the command so well; I thought it would be better to use that.
I thought that the command block detect under config 'mount' should also show option enabled '1', but apparently that is not the case.
Sorry for the confusion.
Previous when the mount was /mnt/sata, in LuCi under 'Mount points' where it lists the mount point of my HDD, at the end of that line was a 'button'-like [Unmount].
Now with the mount on /tmp/sata that 'button' is not showing, hence I mentioned it.
On my PC i just did showmount -a 192.168.178.17 and it returns:
All mount points on 192.168.178.17: 192.168.178.53:/tmp/sata
while with the previous mount /mnt/sata it showed only:
All mount points on 192.168.178.17:
But mounting from my PC - with parameter 'vvv' - at 1st try shows: mount(2); no such file or directory and at 4th try: mount.nfs: trying 192.168.178.17 prog 100005 vers 3 prot UDP port 3270 shows mount(2): Device or resource busy.
What does that actually telling?
TBH, I've tested this config with a Linux and Windows (Pro) machine as a NFS client. I haven't experienced an issue. I've simply typed the following, for example, on Linux into a file manager:
nfs://<IP_of_Server>/tmp/sata
It then opens successfully. I was actually going to ask if you were successful.
I've never had to use that command, but it appears you mounted the folder.
Just FYI, I tested and saw the same behavior. The command is used to generate a config based in detected devices. But it's not clear why you ran the command.
When I typed that in file manager Thunar I get:
Error, could not open 'sata'.
Access denied; maybe this host is not allowed or is a privileged port required.
Then I used Krusader (file manager) for the NFS connection; after I enter my user name and password, I land in tmp. I click on tmp and I see sata; when I click on sata I get: error: could not mount the filesystem.
I will try the same with the mount on /mnt/sata.
Sorry, my bad; lack of understanding.
- What partition table (MBR or GPT) and filesystem (-FAT, ext-, NTFS, etc.) did you configure on the SATA drive?
- Is that filesystem's Kernel module (
kmod-fs-ext4) installed on the OpenWrt?
To recap:
Your /etc/config/fstab mount section reads:
config 'mount'
option target '/tmp/sata'
option uuid 'xxxx' #<- to be clear, add the correct UUID
option enabled '1'
Your /etc/exports file reads (I'll provide you the exact options on my working test):
# /mnt *(ro,all_squash,insecure,sync)
/tmp/sata 192.168.178.0/24(rw,insecure,all_squash,anonuid=1000,anongid=1000)
The no_subtree_check and sync options should be OK, but I just omitted them since you're experiencing an issue. Some Linux distros generally make the first (non-root) user's ID 1000, change according.
Combined with the all squash, only that user (1000) is writing to the share (again, change according to your need) .
I will try the same with the mount on
/mnt/sata.
Are you saying that you're editing both files just to test another path?
(This is why I suggested a reboot to be sure.)
@lleachii,
Thank you for your detailed response.
What partition table (MBR or GPT) and filesystem (-FAT, ext-, NTFS, etc.) did you configure on the SATA drive?
I partitioned the drive with GPT and EXT4.
Is that filesystem's Kernel module (
kmod-fs-ext4) installed on the OpenWrt?
Yes.
add the correct UUID
I am pretty sure the UUID is correct.
Are you saying that you're editing both files just to test another path?
In OpenWrt I just have changed the mounting from /tmp/sata to /mnt/sata and -of course- I also changed the /etc/exports file accordingly.
Then I ran exportfs -ra, which gave me no error.
Then -on my PC- I did a sudo mount -t nfs 192.168.178.17/mnt/sata /mnt/NFS/Kimax and wow, the magic happened, suddenly it worked.
(My device was turned off last night.)
I edited the fstab file on my PC with this mount - I had to leave out vers=4 -, I rebooted my PC and the mount is still working.
I am happy now it works, and hopefully it continues to work.
As far as I can say, my problem is solved. I have no idea what was the cause, and what the solution is; so I don't know to point a post as the solution.
Thank you very much guys for the helpful support.
(My device was turned off last night.)
That'll cause an issue every time! ![]()
I have no idea what was the cause, and what the solution is
My thought is the stale (and bad) mounts you attempted. Hence I suggested reboots.
Glad you got it working!
This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.