Error mount NFS -- nfs4_get_rootfh
Ed Greshko
Ed.Greshko at greshko.com
Sun Jan 1 04:39:00 UTC 2012
On 01/01/2012 08:16 AM, Geoffrey Leach wrote:
> Fedora 16 on both server and client.
>
> /etc/exports
>
> /nfs4exports 192.168.0.0/24
> (ro,sync,insecure,root_squash,no_subtree_check,fsid=0)
> /nfs4exports/tmp 192.168.0.0/24
> (rw,nohide,sync,insecure,root_squash,no_subtree_check)
>
> ll -d /nfs4exports /nfs4exports/*
> drwxrwxrwt 5 root root 4.0K Dec 31 15:34 /nfs4export
> ll -d /nfs4exports /nfs4exports/*
> drwxrwxrwt. 30 root root 4.0K Dec 31 16:06 /nfs4exports/tmp
>
> client --
> sysctl -w sunrpc.nfs_debug=1023
> root at pvr[60]->mount -t nfs4 mtranch:/tmp /tmpm
> mount.nfs4: access denied by server while mounting mtranch:/tmp
> root at pvr[61]->dmesg|tail
> [ 4840.385627] encode_compound: tag=
> [ 4840.386755] nfs4_get_rootfh: getroot error = 13
> [ 4840.386757] <-- nfs4_get_rootfh() = -13
> [ 4840.386759] --> nfs_free_server()
> [ 4840.387247] --> nfs_put_client({1})
> [ 4840.387249] --> nfs_free_client(4)
> [ 4840.387327] <-- nfs_free_client()
> [ 4840.387337] <-- nfs_free_server()
> [ 4840.387338] <-- nfs4_create_server() = error -13
> [ 4840.387341] <-- nfs4_mount() = -13 [error]
>
> The error is generated by /* getroot.c: get the root dentry for an NFS
> mount ...
> /* Start by getting the root filehandle from the server */
> ret = server->nfs_client->rpc_ops->getroot(server, mntfh,
> &fsinfo);
> if (ret < 0) {
> dprintk("nfs4_get_rootfh: getroot error = %d\n", -ret);
> goto out;
> }
>
> So, what the .... is the root filehandle in this context and how do I
> define it?
Hummm..... I tried to reproduce the problem you are seeing. I have 2
F16 VMs at the same update level with no testing or update repos defined.
On the server...
[root at f16-1 ~]# cat /etc/exports
/nfs4exports
192.168.0.0/24(ro,sync,insecure,root_squash,no_subtree_check,fsid=0)
/nfs4exports/f16tmp
192.168.0.0/24(rw,nohide,sync,insecure,root_squash,no_subtree_check)
[root at f16-1 ~]# ll -d /nfs4exports /nfs4exports/*
drwxrwxrwt. 3 root root 4096 Jan 1 11:01 /nfs4exports
drwxrwxrwt. 42 root root 4096 Jan 1 12:19 /nfs4exports/f16tmp
[root at f16-1 ~]# exportfs
/nfs4exports 192.168.0.0/24
/nfs4exports/f16tmp
192.168.0.0/24
[root at f16-1 etc]# cat fstab
#
# /etc/fstab
# Created by anaconda on Tue Dec 20 07:19:46 2011
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/vg_f161-lv_root / ext4
defaults 1 1
UUID=453bfedb-9c5f-4639-8283-f0cb31228fdb /boot
ext4 defaults 1 2
/dev/mapper/vg_f161-lv_swap swap swap
defaults 0 0
#NFS Exports
/tmp /nfs4exports/f16tmp none rw,bind 0 0
On the client.....
[root at f16-2 ~]# sysctl -w sunrpc.nfs_debug=1023
sunrpc.nfs_debug = 1023
[root at f16-2 ~]# mount -t nfs4 192.168.0.190:/f16tmp /f16tmp
[root at f16-2 ~]#
[root at f16-2 ~]# df
Filesystem 1K-blocks Used Available Use% Mounted on
rootfs 18093948 7181720 9993088 42% /
devtmpfs 504268 0 504268 0% /dev
tmpfs 513012 140 512872 1% /dev/shm
tmpfs 513012 42808 470204 9% /run
/dev/mapper/vg_f161-lv_root 18093948 7181720 9993088 42% /
tmpfs 513012 42808 470204 9% /run
tmpfs 513012 0 513012 0% /sys/fs/cgroup
tmpfs 513012 0 513012 0% /media
/dev/sda2 495844 60208 410036 13% /boot
192.168.0.190:/f16tmp/ 18093952 7181568 9993216 42% /f16tmp
FWIW, could you try using the IP in the mount instead of the hostname?
--
A common mistake that people make when trying to design something
completely foolproof was to underestimate the ingenuity of complete
fools. -- Douglas Adams in "Mostly Harmless
More information about the users
mailing list