0

There is an issue with NFSv4 when you try to mount a path containing a space and or a bracket character. NFSv3 works fine using the path that uses a symbolic link to the actual folder and NFSv4 does not. I am unable to change the Dropbox installation path without different issues so it must remain as it is. Below are the configurations and the results of what I've tried.

NFS Server:
Debian 8.4
NFS Client:
RHEL 7.2

The server has Dropbox installed which creates a symbolic link like below:

From:
/home/USER_ACCOUNT/Dropbox/
To:
/home/USER_ACCOUNT/Dropbox (corp)/

Path exported on server: (I've tried using the full path and the results are the same so I'm using the symbolic link in the example below)

/home/USER_ACCOUNT/Dropbox/HOSTXX_BACKUP/GUESTXX_BACKUP XXX.XXX.XXX.XXX(rw,sync,no_subtree_check)

Path in client's fstab:

XXX.XXX.XXX.XXX:/home/USER_ACCOUNT/Dropbox/040(corp)/HOSTXX_BACKUP/GUESTXX_BACKUP /nfs_mount nfs4     rw,bg,hard,nointr,rsize=32768,wsize=32768,tcp,actimeo=0,timeo=600 0 0

On the client mounting I was able to get past using the space by replacing it like below:

/home/USER_ACCOUNT/Dropbox (corp)/
becomes:
/home/USER_ACCOUNT/Dropbox\040(corp)/

Now the client returns the following error:

mount.nfs4: mounting XXX.XXX.XXX.XXX:/home/USER_ACCOUNT/Dropbox/040(corp)/HOSTXX_BACKUP/GUESTXX_BACKUP failed, reason given by server: No such file or directory

When I take that path and try to cd into it on the server it looks to get stuck at the bracket character and returns the following error:

-bash: syntax error near unexpected token `('

As of yet I have not been able to find a way to handle the bracket character. When I try using the standard escape sequences in /etc/fstab when it mounts, it truncates everything after the escaping slash.

I also tried "mount -d bind" without success. Both the new folder and the original paths (absolute and symbolic) then appear to be empty like the data disappeared until I reboot.

Brad
  • 250
  • 1
  • 11
  • https://superuser.com/questions/221470/export-nfs-path-containing-dash – quadruplebucky Jun 15 '17 at 17:13
  • mount -o bind did not work for me as recommended in your link. Any other ideas? – Brad Jun 15 '17 at 18:14
  • Can you find any way to mount in from the command line, i.e. eliminate all the whitespace parsing assumptions that /etc/init.f/mount* make...? I'd to play with the bind more.... – quadruplebucky Jun 15 '17 at 18:35
  • https://serverfault.com/questions/503757/nfsv4-symbolic-link-under-virtual-root?rq=1 – quadruplebucky Jun 15 '17 at 18:37
  • did you have tried to put it into quotes like **mount 'XXX.XXX.XXX.XXX:/home/USER_ACCOUNT/Dropbox/040(corp)/HOSTXX_BACKUP/GUESTXX_BACKUP' /mnt** – kofemann Jun 16 '17 at 20:37
  • Unfortunately it appears that this cannot be done yet on NFSv4, v3 works fine. I tried using quotes, bind, linking, etc. but it does not fix the problem. – Brad Jun 29 '17 at 18:28

1 Answers1

0

As stated in the question, in /etc/fstab spaces should be replaced with \040, not /040, so the fstab line should be:

XXX.XXX.XXX.XXX:/home/USER_ACCOUNT/Dropbox\040(corp)/HOSTXX_BACKUP/GUESTXX_BACKUP /nfs_mount nfs4     rw,bg,hard,nointr,rsize=32768,wsize=32768,tcp,actimeo=0,timeo=600 0 0

In shell command lines, the space should be quoted:

mount -t nfs4 'XXX.XXX.XXX.XXX:/home/USER_ACCOUNT/Dropbox (corp)/HOSTXX_BACKUP/GUESTXX_BACKUP' /nfs_mount

Or:

cd '/home/USER_ACCOUNT/Dropbox (corp)/HOSTXX_BACKUP/GUESTXX_BACKUP'