1

In /etc/exports:

/tmp/test    *(rw)

/dev/sda1 (ext4 filesystem) is mounted in /tmp/test

command to mount nfs:

mount -o vers=3 $HOST:/tmp/test $NFS_DIR

(where HOST is IP of nfs server, NFS_DIR is local mount point on client)

The first time, nfs mount success. And then I did unmount.

Then I command out the entry in /etc/exports(no nfs export), and do exportfs -r.

Then I uncomment the /tmp/test entry in /etc/exports (same as before), and do exportfs -r again

And I mount the nfs share by using the same command. But this time, the mount will hang and time out.

However, when I check the log of nfs, I got this:

/tmp and /tmp/test have same filehandle for *, using first
qword_eol: fflush failed: errno 22 (Invalid argument)
Cannot export /tmp, possibly unsupported filesystem or fsid= required" 

The error complaining about export /tmp make sense because it is tmpfs.

But why /tmp and /tmp/test has to same file handle?

I know the issue is cause by /tmp and /tmp/test having the same file handle, so nfs returns the first one which is /tmp. What I want to exported is /tmp/test (ext4 fs), not /tmp (tmpfs).

The issue get solved by restart rpc.mountd.

  1. why /tmp /tmp/test get the same file handle?
  2. why restart rpc.mountd solves the issue?
  3. how to solve this issue without restart rpc.mounts?
  • 1
    Don't mount exported filesystems under /tmp. – Michael Hampton Nov 18 '15 at 7:22
  • why? the nfs export is /tmp/test which is mounted by /dev/sda1 of ext4 filesystem. (df /tmp/test gives /dev/sda1 ext4) – Shuo Dong Nov 18 '15 at 7:26
  • 1
    Because most distributions have automated jobs that spider down /tmp cleaning things up. The OS rather assumes that things mounted under /tmp are disposable, especially if old; you can lose a lot of a filesystem that way. – MadHatter Nov 18 '15 at 7:59
  • I am working on embedded linux, just kernel + uboot + rootfs + device tree (not any distribution), I am sure that there is no job that clean up /tmp, /tmp only get clean up when reboot. And there is some reason why we mount it under /tmp, in short, we want some of these mount get cleaned when reboot. I learned what is a file handle, and /tmp and /tmp/test should never get the same file handle. – Shuo Dong Nov 18 '15 at 15:55
1

It seems that it is the bug in nfs-utils itself. And this bug get fixed in version 1.3.3. I also tried using nfs-utls 1.3.2, but the issue is still there. Using nfs-utils 1.3.3 will fix this issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.