Nfs root

From Attie's Wiki
(Difference between revisions)
Jump to: navigation, search
m
m
 
(6 intermediate revisions by one user not shown)
Line 1: Line 1:
[[Nfs|Setting up an NFS server]]
+
[[Ubuntu_server_12.04/nfs|Setting up an NFS server]]
  
 
==NFS Server Configuration==
 
==NFS Server Configuration==
 
You must export the filesystem with the following parameters:
 
You must export the filesystem with the following parameters:
 
<source lang="text">
 
<source lang="text">
/my/root/fs *(rw,fsid=0,no_root_squash,no_subtree_check)
+
/nfsroot *(rw,fsid=0,no_root_squash,no_subtree_check)
 +
</source>
 +
 
 +
==U-Boot==
 +
<source lang="text">
 +
setenv ipaddr 10.99.99.2
 +
setenv serverip 10.99.99.1
 +
setenv bootfile uImage
 +
tftpboot
 
</source>
 
</source>
  
Line 12: Line 20:
 
example:
 
example:
 
<code>
 
<code>
root=/dev/nfs ip=10.99.99.2:10.99.99.1::255.255.255.252::usb0:off nfsroot=/nfsroot
+
root=/dev/nfs ip=10.99.99.2:10.99.99.1::255.255.255.0::usb0:off nfsroot=/nfsroot
 
</code>
 
</code>
  
Line 19: Line 27:
 
# NFS Server IP (<code>10.99.99.1</code>)
 
# NFS Server IP (<code>10.99.99.1</code>)
 
# Gateway IP (''none'')
 
# Gateway IP (''none'')
# Netmask (<code>255.255.255.252</code> or <code>/30</code>)
+
# Netmask (<code>255.255.255.0</code> or <code>/24</code>)
 
# Hostname (''none'')
 
# Hostname (''none'')
 
# Interface (<code>usb0</code>)
 
# Interface (<code>usb0</code>)
Line 33: Line 41:
 
[    5.701721]      host=10.150.129.116, domain=, nis-domain=(none),
 
[    5.701721]      host=10.150.129.116, domain=, nis-domain=(none),
 
[    5.708160]      bootserver=10.150.129.117, rootserver=10.150.129.117, rootpath=
 
[    5.708160]      bootserver=10.150.129.117, rootserver=10.150.129.117, rootpath=
[    5.718017] Root-NFS: nfsroot=/home/agrande/proj/dvsdk/v4_03/targetfs
+
[    5.718017] Root-NFS: nfsroot=/nfsroot
 
[    5.725036] NFS: nfs mount opts='nolock,addr=10.150.129.117'
 
[    5.725036] NFS: nfs mount opts='nolock,addr=10.150.129.117'
 
[    5.731018] NFS:  parsing nfs mount option 'nolock'
 
[    5.731018] NFS:  parsing nfs mount option 'nolock'
 
[    5.736267] NFS:  parsing nfs mount option 'addr=10.150.129.117'
 
[    5.736267] NFS:  parsing nfs mount option 'addr=10.150.129.117'
[    5.742706] NFS: MNTPATH: '/home/agrande/proj/dvsdk/v4_03/targetfs'
+
[    5.742706] NFS: MNTPATH: '/nfsroot'
[    5.749328] NFS: sending MNT request for 10.150.129.117:/home/agrande/proj/dvsdk/v4_03/targetfs
+
[    5.749328] NFS: sending MNT request for 10.150.129.117:/nfsroot
 
[    7.775848] NFS: MNT server returned result -13
 
[    7.775848] NFS: MNT server returned result -13
 
[    7.780883] NFS: unable to mount server 10.150.129.117, error -13
 
[    7.780883] NFS: unable to mount server 10.150.129.117, error -13
Line 44: Line 52:
 
[    7.794891] VFS: Cannot open root device "nfs" or unknown-block(2,0)
 
[    7.794891] VFS: Cannot open root device "nfs" or unknown-block(2,0)
 
</source>
 
</source>
 +
 +
 +
==Error -13 - tips==
 +
* Moving the NFS file system on the server
 +
* Use the <code>nolock</code> option as a kernel argument

Latest revision as of 17:22, 8 March 2013

Setting up an NFS server

Contents

[edit] NFS Server Configuration

You must export the filesystem with the following parameters:

/nfsroot *(rw,fsid=0,no_root_squash,no_subtree_check)

[edit] U-Boot

setenv ipaddr 10.99.99.2
setenv serverip 10.99.99.1
setenv bootfile uImage
tftpboot

[edit] Kernel Configuration

Below are the kernel arguments used for mounting an NFS root filesystem

example: root=/dev/nfs ip=10.99.99.2:10.99.99.1::255.255.255.0::usb0:off nfsroot=/nfsroot

The parameters for the ip argument are as follows:

  1. Host IP Address (10.99.99.2)
  2. NFS Server IP (10.99.99.1)
  3. Gateway IP (none)
  4. Netmask (255.255.255.0 or /24)
  5. Hostname (none)
  6. Interface (usb0)
  7. Auto IP configure / DHCP after boot (off)

[edit] Debugging

NFS root filesystems always seem to be fiddly to get setup. There is an option 'nfsrootdebug' that prints out debug messages, for example:

[    4.674285] net eth0: SMSC911x/921x identified at 0xc8884000, IRQ: 336
[    5.689666] IP-Config: Complete:
[    5.692871]      device=eth0, addr=10.150.129.116, mask=255.255.255.240, gw=255.255.255.255,
[    5.701721]      host=10.150.129.116, domain=, nis-domain=(none),
[    5.708160]      bootserver=10.150.129.117, rootserver=10.150.129.117, rootpath=
[    5.718017] Root-NFS: nfsroot=/nfsroot
[    5.725036] NFS: nfs mount opts='nolock,addr=10.150.129.117'
[    5.731018] NFS:   parsing nfs mount option 'nolock'
[    5.736267] NFS:   parsing nfs mount option 'addr=10.150.129.117'
[    5.742706] NFS: MNTPATH: '/nfsroot'
[    5.749328] NFS: sending MNT request for 10.150.129.117:/nfsroot
[    7.775848] NFS: MNT server returned result -13
[    7.780883] NFS: unable to mount server 10.150.129.117, error -13
[    7.787384] VFS: Unable to mount root fs via NFS, trying floppy.
[    7.794891] VFS: Cannot open root device "nfs" or unknown-block(2,0)


[edit] Error -13 - tips

  • Moving the NFS file system on the server
  • Use the nolock option as a kernel argument
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox