LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Cannot mount NFS share (Fstab special character at the end of the mount) (https://www.linuxquestions.org/questions/linux-newbie-8/cannot-mount-nfs-share-fstab-special-character-at-the-end-of-the-mount-4175562822/)

meki 12-31-2015 12:27 PM

Cannot mount NFS share (Fstab special character at the end of the mount)
 
Hi,

Hopefully this is the right place to ask this.
I have read and read everywhere about this issue and cannot figure it out.

I am trying to mount an exported mount

Code:

sudo showmount -e 192.168.1.173
Export list for 192.168.1.173:
/mnt/user/Documentaries (TV)    192.168.1.38
/mnt/user/Documentaries (Movie) 192.168.1.38

In my fstab I put
Code:

192.168.1.173:/mnt/user/Documentaries\040\050TV\051 /mnt/Documentaries_TV      nfs    noatime,vers=3,auto,rw,dev,exec,suid,rsize=32768,wsize=32768 0 0
But it wont mount
when I do
Code:

mount -a
I get this
Code:

sudo mount -a
mount.nfs: access denied by server while mounting 192.168.1.173:/mnt/user/Documentaries (TV\051

If I put another character after \051 then the next character is detected
Code:

sudo mount -a
mount.nfs: access denied by server while mounting 192.168.1.173:/mnt/user/Documentaries (TV)test

It seems that the last character is not parsed.

I am really lost here I am hoping someone can help

pan64 01-06-2016 11:38 AM

I would definitely try to use another name, without ( and ).
I cannot see if you have space or tab after \051, I would also try to add more tabs/spaces, probably that will work too.
finally I would try to use ( and ) directly, only space will remain as \040

meki 01-06-2016 11:41 AM

I tried both spaces and tabs.

In the end I changed the names of mounts.

I went as far as adding a "/" at the end of mount name then I was able to mount it using "mount -a" but it would still not mount at boot.

pan64 01-06-2016 01:22 PM

I checked and it looks like it is connected to the c function getmntent but still could not find how it handles those special characters.
Code:

#include <stdio.h>
#include <mntent.h>

void main() {
  FILE *f;
  char *name = "/etc/fstab";

  f = fopen(name, "r");
  if ( f == NULL ) {
      perror("cannot open file");
  }

  struct mntent *m = getmntent(f);

  printf("fsname=%s, dir=%s\n", m->mnt_fsname, m->mnt_dir);
  m = getmntent(f);
  printf("fsname=%s, dir=%s\n", m->mnt_fsname, m->mnt_dir);
  endmntent(f);
// repeat as long as you want
}

and I have no idea how it works on your system.


All times are GMT -5. The time now is 10:15 AM.