You are not logged in.

#1 2012-07-14 21:14:44

cap11235
Member
Registered: 2012-07-14
Posts: 4

[SOLVED] NFS pretends to work

I'm setting up a router/NAS for myself, and ran into issues with the latter part. The former was done using iptables, and works fine. I am attempting to use NFS for the latter. I can mount the drive and explore through the folders, but if I actually try to open a file, I get that the network connection is refused. For the exact error, see "Mounting" below. eth1 is an ethernet port to my Windows 7 box, eth1 connects to the internet. nmap also behaves somewhat strangely. I included as much information as I could thank of. All information from the linux box was done through SSH from my Windows computer. Thanks for your help.

/etc/rc.conf

# LOCALIZATION
# ------------
HARDWARECLOCK="UTC"
TIMEZONE="America/Los_Angeles"
KEYMAP="us"
CONSOLEFONT=
CONSOLEMAP=
LOCALE=
DAEMON_LOCALE="yes"
USECOLOR="yes"

# HARDWARE
# --------
MODULES=()
USEDMRAID="no"
USEBTRFS="no"
USELVM="no"

# DAEMONS
# -------
#
DAEMONS=(syslog-ng net-profiles dnsmasq iptables sshd rpcbind nfs-common nfs-server crond beep)

/etc/exports (exportfs -arv was run after editing)

/mnt/        *(rw,sync,nohide,no_subtree_check)
/mnt/data    *(rw,sync,nohide,no_subtree_check)

/etc/fstab (/dev/sda3 is the partition I wish to access)

tmpfs           /tmp    tmpfs   nodev,nosuid    0       0
LABEL=root / ext4 defaults 0 1
/dev/sda3 /mnt/data ntfs-3g defaults,umask=00 0 2

/etc/mtab

rootfs / rootfs rw 0 0
proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0
sys /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0
dev /dev devtmpfs rw,nosuid,relatime,size=1545832k,nr_inodes=216878,mode=755 0 0
run /run tmpfs rw,nosuid,nodev,relatime,mode=755 0 0
/dev/sda2 / ext4 rw,relatime,data=ordered 0 0
devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0
shm /dev/shm tmpfs rw,nosuid,nodev,relatime 0 0
tmpfs /tmp tmpfs rw,nosuid,nodev,relatime 0 0
/dev/sda3 /mnt/data fuseblk rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096 0 0
binfmt /proc/sys/fs/binfmt_misc binfmt_misc rw,relatime 0 0
rpc_pipefs /var/lib/nfs/rpc_pipefs rpc_pipefs rw,relatime 0 0
nfsd /proc/fs/nfsd nfsd rw,nosuid,nodev,noexec,relatime 0 0

`mount` output on Linux box

[root@(none) ~]# mount
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
sys on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
dev on /dev type devtmpfs (rw,nosuid,relatime,size=1545832k,nr_inodes=216878,mode=755)
run on /run type tmpfs (rw,nosuid,nodev,relatime,mode=755)
/dev/sda2 on / type ext4 (rw,relatime,data=ordered)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
shm on /dev/shm type tmpfs (rw,nosuid,nodev,relatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,relatime)
/dev/sda3 on /mnt/data type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096)
binfmt on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,relatime)
rpc_pipefs on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw,relatime)
nfsd on /proc/fs/nfsd type nfsd (rw,nosuid,nodev,noexec,relatime)

Windows: ipconfig

Wireless LAN adapter Wireless Network Connection:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Ethernet adapter Local Area Connection:

   Connection-specific DNS Suffix  . : cpaul
   Link-local IPv6 Address . . . . . : fe80::35fd:409:ce27:86f2%11
   IPv4 Address. . . . . . . . . . . : 192.168.0.87
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 192.168.0.1

Linux: ifconfig

[root@(none) ~]# ls -l /mnt/data/t
total 0
-rwxrwxrwx 1 root root 0 Jul 14 12:52 test

Windows: nmap of 192.168.0.1 (the router/NAS)

C:\Program Files (x86)\Nmap>nmap.exe 192.168.0.1

Starting Nmap 6.01 ( http://nmap.org ) at 2012-07-14 14:11 Pacific Daylight Time

Note: Host seems down. If it is really up, but blocking our ping probes, try -Pn

Nmap done: 1 IP address (0 hosts up) scanned in 0.82 seconds

Strangely, ping itself does not have problems:

C:\Program Files (x86)\Nmap>ping 192.168.0.1

Pinging 192.168.0.1 with 32 bytes of data:
Reply from 192.168.0.1: bytes=32 time<1ms TTL=64
Reply from 192.168.0.1: bytes=32 time<1ms TTL=64
Reply from 192.168.0.1: bytes=32 time<1ms TTL=64
Reply from 192.168.0.1: bytes=32 time<1ms TTL=64

Ping statistics for 192.168.0.1:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

/etc/iptables/iptables.rules

# Generated by iptables-save v1.4.14 on Sat Jul 14 10:14:27 2012
*raw
:PREROUTING ACCEPT [1700100:1087866819]
:OUTPUT ACCEPT [696479:41565107]
COMMIT
# Completed on Sat Jul 14 10:14:27 2012
# Generated by iptables-save v1.4.14 on Sat Jul 14 10:14:27 2012
*nat
:PREROUTING ACCEPT [0:0]
:INPUT ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
-A POSTROUTING -o eth0 -j MASQUERADE
COMMIT
# Completed on Sat Jul 14 10:14:27 2012
# Generated by iptables-save v1.4.14 on Sat Jul 14 10:14:27 2012
*mangle
:PREROUTING ACCEPT [1700100:1087866819]
:INPUT ACCEPT [590082:40563543]
:FORWARD ACCEPT [1110018:1047303276]
:OUTPUT ACCEPT [696479:41565107]
:POSTROUTING ACCEPT [1806765:1088932033]
COMMIT
# Completed on Sat Jul 14 10:14:27 2012
# Generated by iptables-save v1.4.14 on Sat Jul 14 10:14:27 2012
*filter
:INPUT ACCEPT [0:0]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -i lo -j ACCEPT
-A INPUT -i eth1 -j ACCEPT
-A INPUT ! -i eth1 -p udp -m udp --dport 67 -j REJECT --reject-with icmp-port-unreachable
-A INPUT ! -i eth1 -p udp -m udp --dport 53 -j REJECT --reject-with icmp-port-unreachable
-A INPUT -i eth0 -p tcp -m tcp --dport 22 -j ACCEPT
-A FORWARD -d 192.168.0.0/16 -i eth1 -j DROP
-A FORWARD -s 192.168.0.0/16 -i eth1 -j ACCEPT
-A FORWARD -d 192.168.0.0/16 -i eth0 -j ACCEPT
COMMIT
# Completed on Sat Jul 14 10:14:27 2012

/etc/dnsmasq.conf (I doubt this has anything to do with anything, but for completion's sake...)

interface=eth1
expand-hosts
domain=cpaul
dhcp-range=192.168.0.50,192.168.0.150,12h

`ls -l /mnt/data/t`

[root@(none) ~]# ls -l /mnt/data/t
total 0
-rwxrwxrwx 1 root root 0 Jul 14 12:52 test

Mounting

C:\>mount 192.168.0.1:/mnt/data z:
z: is now successfully connected to 192.168.0.1:/mnt/data

The command completed successfully.

C:\>dir z:\t
 Volume in drive Z has no label.
 Volume Serial Number is 3548-9242

 Directory of z:\t

07/14/2012  12:52 PM    <DIR>          .
07/14/2012  12:52 PM    <DIR>          ..
07/14/2012  12:52 PM                 0 test
               1 File(s)        102,400 bytes
               2 Dir(s)  422,561,579,008 bytes free

C:\>type z:\t\test
The remote computer refused the network connection.

Last edited by cap11235 (2012-07-16 16:09:06)

Offline

#2 2012-07-14 23:09:36

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,542

Re: [SOLVED] NFS pretends to work

You are using NFS to connect windows 7 machine?  Samba might be a better choice.
The zero-length file may be your problem. 
Are you using initscripts or systemd?

Last edited by nomorewindows (2012-07-14 23:10:12)


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

#3 2012-07-14 23:38:01

cap11235
Member
Registered: 2012-07-14
Posts: 4

Re: [SOLVED] NFS pretends to work

I also attempted to set up Samba, but had less success than NFS (I get Error 53 upon attempting to mount in windows, though using smbclient in an Ubuntu live-CD works fine), and from what I can tell, NFS appears to have faster transfer rates.

With a file with something in it, the same issue:

Z:\t>dir
 Volume in drive Z has no label.
 Volume Serial Number is 3548-9242

 Directory of Z:\t

07/14/2012  04:36 PM    <DIR>          .
07/14/2012  04:36 PM    <DIR>          ..
07/14/2012  04:36 PM                13 test
               1 File(s)        102,557 bytes
               2 Dir(s)  422,561,579,008 bytes free

Z:\t>type test
The remote computer refused the network connection.

I use the normal initscripts.

Offline

#4 2012-07-15 00:32:04

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,542

Re: [SOLVED] NFS pretends to work

I don't remember what error 53 is.  When using samba, I just use \\ip address\share, the \\hostname\share rarely ever finds the computer unless it's from windows.  Actually with smbclient it's //server/share.  NFS has less overhead than samba.  Windows Lanman wants to size up the machine that is using it's shares.  Error 53 might be the one that requires user authentication.  Net use x: \\host\share /user:user /password:password.  Of course, you need to have smbpasswd set up so that there are some users.  Samba's default share is //host/homes, for the user credentials given.

Last edited by nomorewindows (2012-07-15 00:34:21)


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

#5 2012-07-15 00:47:32

cap11235
Member
Registered: 2012-07-14
Posts: 4

Re: [SOLVED] NFS pretends to work

Ok, I found the issue with Samba, a typo in smb.conf for the path of the share. I'd still prefer for NFS to work, but this is preferable to nothing. Thanks.

Offline

#6 2012-07-15 00:51:23

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,542

Re: [SOLVED] NFS pretends to work

In a normal case, you probably don't need /mnt and /mnt/data unless they are in fact two separate entities (/etc/exports).


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

#7 2012-07-16 07:13:26

zenlord
Member
From: Belgium
Registered: 2006-05-24
Posts: 1,229
Website

Re: [SOLVED] NFS pretends to work

nomorewindows wrote:

In a normal case, you probably don't need /mnt and /mnt/data unless they are in fact two separate entities (/etc/exports).

For NFS *v4* it is necessary, but then the root-folder should be marked 'fsid=0' in /etc/exports. I don't see you specifying you're using v3, and iirc v4 is the default choice.

Offline

#8 2012-07-16 16:08:52

cap11235
Member
Registered: 2012-07-14
Posts: 4

Re: [SOLVED] NFS pretends to work

I added fsid=0 to the root folder, and everything now works properly. Thanks!

Offline

Board footer

Powered by FluxBB