You are not logged in.

#1 2009-08-24 13:28:00

jozef00
Member
From: 127.0.0.1
Registered: 2008-10-12
Posts: 44

[SOLVED]Can´t mount nfs shares!

Hello,

I am trying to get up a fileserver. I installed an old PC with Arch and configerd it over SSH. I followed the wiki over NFS and NFSv4. But everytime I want to mount a share that is in the physical map /home/jozef/shares/downloads, I get the following error:

mount.nfs4: timeout set for Mon Aug 24 14:36:57 2009
mount.nfs4: text-based options: 'clientaddr=192.168.0.100,addr=192.168.0.111'
mount.nfs4: mount(2): Permission denied mount.nfs4: access denied by server while mounting 192.168.0.111:/shares/downloads

I tried to mount it with the following command:

mount -v -t nfs4 192.168.0.111:/shares/downloads /media/Downloads-Server

Lets call the fileserver fileserver and my workstation Gamepc. Here I will give you some files that I think are needed, from fileserver and Gamepc are there other files you need, I will post them.

/etc/exports on fileserver

# /etc/exports
#
# List of directories exported to NFS clients.  See exports(5).
# Use exportfs -arv to reread.
#
# Example for NFSv2 and NFSv3:
#  /srv/home       hostname1(rw,sync) hostname2(ro,sync)
#
# Example for NFSv4:
#  /srv/nfs4       hostname1(rw,sync,fsid=0)
#  /srv/nfs4/home   hostname1(rw,sync,nohide)
# Using Kerberos and integrity checking:
#  /srv/nfs4        gss/krb5i(rw,sync,fsid=0,crossmnt)
#  /srv/nfs4/home   gss/krb5i(rw,sync,nohide)
#
/shares 192.168.0.12(rw,fsid=0,no_subtree_check,async,no_root_squash)
/shares/downloads 192.168.0.12(rw,no_subtree_check,async,no_root_squash,nohide)

/etc/hosts.allow on fileserver

#
# /etc/hosts.allow
#
sshd: 192.168.0.0/255.255.255.0
#nfsd: 192.168.0.0/255.255.255.255
#portmap: 192.168.0.0/255.255.255.255
#mountd: 192.168.0.0/255.255.255.255
nfsd: ALL
portmap: ALL
mountd: ALL
# End of file

/etc/hosts.deny on fileserver

#
# /etc/hosts.deny
#

ALL: ALL: DENY

# End of file

/etc/conf.d/nfs-common on fileserver

STATD_OPTS="--no-notify"

/etc/conf.d/nfs-server on fileserver

STATD_OPTS="--no-notify"

/etc/rc.conf on fileserver

# /etc/rc.conf - Main Configuration for Arch Linux
#

# -----------------------------------------------------------------------
# LOCALIZATION
# -----------------------------------------------------------------------
#
# LOCALE: available languages can be listed with the 'locale -a' command
# HARDWARECLOCK: set to "UTC" or "localtime"
# USEDIRECTISA: use direct I/O requests instead of /dev/rtc for hwclock
# TIMEZONE: timezones are found in /usr/share/zoneinfo
# KEYMAP: keymaps are found in /usr/share/kbd/keymaps
# CONSOLEFONT: found in /usr/share/kbd/consolefonts (only needed for non-US)
# CONSOLEMAP: found in /usr/share/kbd/consoletrans
# USECOLOR: use ANSI color sequences in startup messages
#
LOCALE="en_US.utf8"
HARDWARECLOCK=""
USEDIRECTISA="no"
TIMEZONE=""
KEYMAP="us"
CONSOLEFONT=
CONSOLEMAP=
USECOLOR="yes"

# -----------------------------------------------------------------------
# HARDWARE
# -----------------------------------------------------------------------
#
# MOD_AUTOLOAD: Allow autoloading of modules at boot and when needed
# MOD_BLACKLIST: Prevent udev from loading these modules
# MODULES: Modules to load at boot-up. Prefix with a ! to blacklist.
#
# NOTE: Use of 'MOD_BLACKLIST' is deprecated. Please use ! in the MODULES array.
#
MOD_AUTOLOAD="yes"
#MOD_BLACKLIST=() #deprecated
MODULES=()

# Scan for LVM volume groups at startup, required if you use LVM
USELVM="no"

# -----------------------------------------------------------------------
# NETWORKING
# -----------------------------------------------------------------------
#
# HOSTNAME: Hostname of machine. Should also be put in /etc/hosts
#
HOSTNAME="myhost"

# Use 'ifconfig -a' or 'ls /sys/class/net/' to see all available interfaces.
#
# Interfaces to start at boot-up (in this order)
# Declare each interface then list in INTERFACES
#   - prefix an entry in INTERFACES with a ! to disable it
#   - no hyphens in your interface names - Bash doesn't like it
#
# DHCP:     Set your interface to "dhcp" (eth0="dhcp")
# Wireless: See network profiles below
#

#Static IP example
#eth0="dhcp"
eth0="dhcp"
INTERFACES=(eth0)

# Routes to start at boot-up (in this order)
# Declare each route then list in ROUTES
#   - prefix an entry in ROUTES with a ! to disable it
#
gateway="default gw 192.168.0.1"
ROUTES=(!gateway)

# Enable these network profiles at boot-up.  These are only useful
# if you happen to need multiple network configurations (ie, laptop users)
#   - set to 'menu' to present a menu during boot-up (dialog package required)
#   - prefix an entry with a ! to disable it
#
# Network profiles are found in /etc/network.d
#
# This now requires the netcfg package
#
#NETWORKS=(main)

# -----------------------------------------------------------------------
# DAEMONS
# -----------------------------------------------------------------------
#
# Daemons to start at boot-up (in this order)
#   - prefix a daemon with a ! to disable it
#   - prefix a daemon with a @ to start it up in the background
#
DAEMONS=(syslog-ng !network rpcbind nfs-common nfs-server netfs crond !xinetd !samba sshd transmissiond)

/etc/rc.conf on Gamepc

#
# /etc/rc.conf - Main Configuration for Arch Linux
#

# -----------------------------------------------------------------------
# LOCALIZATION
# -----------------------------------------------------------------------
#
# LOCALE: available languages can be listed with the 'locale -a' command
# HARDWARECLOCK: set to "UTC" or "localtime"
# USEDIRECTISA: use direct I/O requests instead of /dev/rtc for hwclock
# TIMEZONE: timezones are found in /usr/share/zoneinfo
# KEYMAP: keymaps are found in /usr/share/kbd/keymaps
# CONSOLEFONT: found in /usr/share/kbd/consolefonts (only needed for non-US)
# CONSOLEMAP: found in /usr/share/kbd/consoletrans
# USECOLOR: use ANSI color sequences in startup messages
#
LOCALE="en_US.utf8"
HARDWARECLOCK="localtime"
USEDIRECTISA="no"
TIMEZONE="Europe/Amsterdam"
KEYMAP="us"
CONSOLEFONT=
CONSOLEMAP=
USECOLOR="yes"

# -----------------------------------------------------------------------
# HARDWARE
# -----------------------------------------------------------------------
#
# MOD_AUTOLOAD: Allow autoloading of modules at boot and when needed
# MOD_BLACKLIST: Prevent udev from loading these modules
# MODULES: Modules to load at boot-up. Prefix with a ! to blacklist.
#
# NOTE: Use of 'MOD_BLACKLIST' is deprecated. Please use ! in the MODULES array.
#
MOD_AUTOLOAD="yes"
#MOD_BLACKLIST=() #deprecated
MODULES=()

# Scan for LVM volume groups at startup, required if you use LVM
USELVM="no"

# -----------------------------------------------------------------------
# NETWORKING
# -----------------------------------------------------------------------
#
# HOSTNAME: Hostname of machine. Should also be put in /etc/hosts
#
HOSTNAME="GAMEPC"

# Use 'ifconfig -a' or 'ls /sys/class/net/' to see all available interfaces.
#
# Interfaces to start at boot-up (in this order)
# Declare each interface then list in INTERFACES
#   - prefix an entry in INTERFACES with a ! to disable it
#   - no hyphens in your interface names - Bash doesn't like it
# 
# DHCP:     Set your interface to "dhcp" (eth0="dhcp")
# Wireless: See network profiles below
#

#Static IP example
#eth0="dhcp"
eth0="dhcp"
INTERFACES=(eth0)

# Routes to start at boot-up (in this order)
# Declare each route then list in ROUTES
#   - prefix an entry in ROUTES with a ! to disable it
#
gateway="default gw 192.168.0.1"
ROUTES=(!gateway)
 
# Enable these network profiles at boot-up.  These are only useful
# if you happen to need multiple network configurations (ie, laptop users)
#   - set to 'menu' to present a menu during boot-up (dialog package required)
#   - prefix an entry with a ! to disable it
#
# Network profiles are found in /etc/network.d
#
# This now requires the netcfg package
#
#NETWORKS=(main)

# -----------------------------------------------------------------------
# DAEMONS
# -----------------------------------------------------------------------
#
# Daemons to start at boot-up (in this order)
#   - prefix a daemon with a ! to disable it
#   - prefix a daemon with a @ to start it up in the background
#
DAEMONS=(syslog-ng !network rpcbind nfs-common @netfs crond @hal @fam @samba @alsa @cups)

/etc/hosts.allow on Gamepc

#
# /etc/hosts.allow
#
sshd:ALL
# End of file

/etc/hosts.deny on Gamepc

#
# /etc/hosts.deny
#

ALL: ALL: DENY

# End of file

If someone could help me, I would be pleased.

With kind regards,

Jozef00

Last edited by jozef00 (2009-09-01 15:28:07)

Offline

#2 2009-08-24 15:34:10

kowalski
Member
Registered: 2009-05-07
Posts: 82

Re: [SOLVED]Can´t mount nfs shares!

Hey,

have you set your client's ip to 192.168.0.12?

mount.nfs4: timeout set for Mon Aug 24 14:36:57 2009
mount.nfs4: text-based options: 'clientaddr=192.168.0.100,addr=192.168.0.111'
mount.nfs4: mount(2): Permission denied mount.nfs4: access denied by server while mounting 192.168.0.111:/shares/downloads

If I read this correctly it is set to 192.168.0.100 and you only allow 192.168.0.12 to access the share.

[edit]
You do not have a directory

/shares/downloads

do you?
That's likely

/home/$USER/shares/downloads

isn't it?
[/edit]

Just a guess, though.

Last edited by kowalski (2009-08-24 17:04:23)


He who says A doesn't have to say B. He can also recognize that A was false.

Offline

#3 2009-08-24 17:28:04

jozef00
Member
From: 127.0.0.1
Registered: 2008-10-12
Posts: 44

Re: [SOLVED]Can´t mount nfs shares!

Hey,

Thanks for your reply kowalski!
The acces denied problem is solved. But now I got the following error with

mount -v -t nfs4 192.168.0.111:/shares/downloads /media/Downloads-Server

The error is:

mount.nfs4: timeout set for Mon Aug 24 19:15:26 2009
mount.nfs4: text-based options: 'clientaddr=192.168.0.100,addr=192.168.0.111'
mount.nfs4: mount(2): No such device
mount.nfs4: No such device

Here is my /etc/fstab:

#
# /etc/fstab: static file system information
#
# <file system>        <dir>         <type>    <options>          <dump> <pass>
none                   /dev/pts      devpts    defaults            0      0
none                   /dev/shm      tmpfs     defaults            0      0

/home/jozef/shares /shares none    bind  0 0
#/dev/cdrom             /media/cd   auto    ro,user,noauto,unhide   0      0
#/dev/dvd               /media/dvd  auto    ro,user,noauto,unhide   0      0
#/dev/fd0               /media/fl   auto    user,noauto             0      0

/dev/sda1 /home ext4 defaults 0 1
/dev/sdb1 swap swap defaults 0 0
/dev/sdb2 /boot ext2 defaults 0 1
/dev/sdb3 / ext4 defaults 0 1

There is a physical directory shares in the /, but I got also in my home directory the following maps:
/shares/downloads/
                          /Bittorrent
                          /Usenet

As addicted in the wiki I added the line to mount the /shares in my home-directory under /shares in the /.
When you need more information, I will post them.

Could you help me out?

With kind regards,

Jozef00

Offline

#4 2009-08-24 21:18:27

kowalski
Member
Registered: 2009-05-07
Posts: 82

Re: [SOLVED]Can´t mount nfs shares!

Unfortunately I have no idea about nfsv4, I just use ordinary nfs. Does this help you?
http://bbs.archlinux.org/viewtopic.php?id=74639
Does /media/Downloads-Server exist?
Other than this I'm pretty uninspired...


He who says A doesn't have to say B. He can also recognize that A was false.

Offline

#5 2009-08-25 12:00:38

jozef00
Member
From: 127.0.0.1
Registered: 2008-10-12
Posts: 44

Re: [SOLVED]Can´t mount nfs shares!

Hey,

Thanks for your reply kowalski!
I already read that post and now I did it again, but it doesn't solve my problem! The dir Downloads-Sever exists! I at first created him.

ls /media/
DATA  Downloads-Server    RECOVERY  cd  dvd  fl  stick  win

I hope you will get some other ideas kowalski! Our otherwise I hope that anotherone will get some ideas.

With kind regards,

Jozef00

Offline

#6 2009-08-25 12:29:05

Profjim
Member
From: NYC
Registered: 2008-03-24
Posts: 658

Re: [SOLVED]Can´t mount nfs shares!

Are you sure that the nfs module is loaded? Do

lsmod | grep nfs

to check. If "nfs" doesn't appear then that's your problem. Do:

sudo modprobe nfs

and continue.

EDIT: Also, I'll assume both your server and your client machine are connected to the network. You have the network DAEMON "!"-disabled in each machine's /etc/rc.conf. So I'm assuming you're connecting them to the network in some other way, and have verified that you can, for example, ssh from one machine to the other.

Third, you're sure that /share exists on your server machine, that a (presumably empty) directory /share/downloads exists inside it, that another folder is mounted on top of that empty directory? When you type "mount" on the server machine there should be a line containing "on /share/downloads".

Fourth, if your client's ip address is 192.168.0.100 (this will be displayed when you do "ifconfig") then the /etc/exports on your server has been changed to read:

/shares 192.168.0.100(rw,fsid=0,no_subtree_check,async,no_root_squash)
/shares/downloads 192.168.0.100(rw,no_subtree_check,async,no_root_squash,nohide)

Then you either typed "exportfs -rf" on the server, or stopped and restarted nfs-server. (I'd stop nfs-server, nfs-common, and rpcbind, then start them up again in reverse order, to be sure.)

STATD_OPTS has no effect in /etc/conf.d/nfs-server. Also, you don't need to use statd if you're using nfs4. So you could change /etc/conf.d/nfs-common to read:

NEED_STATD=no 
NEED_IDMAPD=yes

and /etc/conf.d/server and can be blank.

(Then restart everything, as described above.)

If you're using the latest arch packages then portmap has been replaced by rpcbind (which you do have in your DAEMONS line on the server). So you need to change the "portmap:" line in your server's /etc/hosts.allow to "rpcbind:". I also have a "lockd:" line in my /etc/hosts.allow, in addition to what you have. It's probably not the source of your present troubles, and I'm not sure it's necessary. But you could try adding it.

Finally, did you add/change a "Domain = ..." line in the /etc/idmapd.conf on your server, and a corrsponding line in the /etc/idmapd.conf on your client?

Last edited by Profjim (2009-08-25 12:51:48)

Offline

#7 2009-08-28 09:54:37

jozef00
Member
From: 127.0.0.1
Registered: 2008-10-12
Posts: 44

Re: [SOLVED]Can´t mount nfs shares!

Hello,

Thanks for your reply Profjim!
The problem is nearly solved. The NFS module was not loaded on GamePC. The question is now how could I load the nfs module on startup on GamePC? Here is the DAEMONS line on GamePC:

DAEMONS=(syslog-ng !network rpcbind nfs-common @netfs crond @hal @fam @samba @alsa @cups)

My network is connected by dhclient.

Thank you all in advance for your help.

With kind regards,

Jozef00

Last edited by jozef00 (2009-08-28 09:58:08)

Offline

#8 2009-08-28 13:38:48

Profjim
Member
From: NYC
Registered: 2008-03-24
Posts: 658

Re: [SOLVED]Can´t mount nfs shares!

Do you have this in your /etc/rc.conf:

MOD_AUTOLOAD="yes"

If so, then the nfs module _should_ get autoloaded; at least, it does for me. (I think the nfs-common DAEMON triggers this, but I'm just guessing.)

In any event, if you're finding that the module isn't getting autoloaded, then just add "nfs" to your MODULES array in /etc/rc.conf. It should then load on boot.

Offline

#9 2009-09-01 14:13:57

jozef00
Member
From: 127.0.0.1
Registered: 2008-10-12
Posts: 44

Re: [SOLVED]Can´t mount nfs shares!

Hey,

Due the offline of the forums I coulnd't reply. The problem is at the moment not solved.
I added "nfs" /etc/modprobe.d/modprobe.conf and in my module line in /etc/rc.conf. But by starting Arch I got the following error:

WARNING: /etc/modprobe.d/modprobe.conf line 4: ignoring bad line starting with 'nfs'

A similar error I got for by the loading of MODULES during the boot of Arch. How could I solve this?

Thanks you all for the replies.

With kind regards,

Jozef00

Offline

#10 2009-09-01 15:27:28

jozef00
Member
From: 127.0.0.1
Registered: 2008-10-12
Posts: 44

Re: [SOLVED]Can´t mount nfs shares!

Hey,

The problem is solved. I only had to add it to the modules line in rc.conf. After disabling "nfs" in modprobe.conf, all works!
Thanks to all for the help.

With kind regards,

Jozef00

Offline

Board footer

Powered by FluxBB