# umount.nfs4: You are not permitted to unmount

## musv

Hi there, 

I guess since the last big system update, I'm not able to unmount a NFSv4 share anymore as user. Mounting as user and unmounting as root works quite well. I'm not the only one with that problem:

google search

bugzilla.redhat.com - instead to fix that bug, they set it to "won't fix". Maybe in a later version   :Shocked: 

Debian Bugs - the had a new version, where it worked magically.

It seems, other distros are already fighting a long time against that nfs-monster. I noticed it today for the first time. 

The details:

Installed NFSv4. Error occurs with the services started via OpenRC but also with Systemd.

mounting as user works. For umount you need to have root permissions. 

In the debian-bugs, they write something of compiling nfs-comming with libmount. Such a USE-Flag doesn't exist at least for nfs-utils

Also the mention, that the mount data should be available in /run/mount/utab. That file exists on my computer but is empty. 

The configs:

- Client -

```
miniding:/home_myuser  /home/myuser/miniding   nfs4    noauto,users,rw,intr,noatime,nodiratime,hard,rsize=32768,wsize=32768    0 0
```

- Server -

```

/export             192.168.109.0/24(rw,fsid=0,insecure,no_subtree_check,async)

/export/home_myuser     192.168.109.0/24(rw,nohide,insecure,no_subtree_check,async,all_squash,anonuid=1000,anongid=100)
```

The error:

```
mount miniding            <--- works fine

umount miniding                <--- as user

umount.nfs4: You are not permitted to unmount /home/myuser/miniding 

su

umount miniding/               <--- as root: works fine
```

```
miniding:/home_myuser /home/myuser/miniding nfs4 rw,noatime,nodiratime,vers=4.0,rsize=32768,wsize=32768,namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=192.168.109.20,local_lock=none,addr=192.168.109.21 0 0
```

The solution

Just found out, why it isn't working. On the machines, where it isn't working:

```
lrwxrwxrwx 1 root root      17  6. Mai 18:46 mtab -> /proc/self/mounts
```

On the on computer, where it's still working:

```
-rw-r--r-- 1 root root    1582 19. Mai 21:51 mtab
```

I linked /etc/mtab to /proc/self/mounts in order to switch over to systemd.

Just found out more:

```
-r--r--r-- 1 root root 0 19. Mai 22:00 /proc/self/mounts
```

So I guess, because the file is written by the kernel, it isn't writeable. And the umount.nfs4 maybe wants to write to mtab? Could that be?

Any idea what's to do here? Just replace the link with the old file?

----------

