Project

General

Profile

NFS configuration

Added by Leonid Volpert over 11 years ago

I am switching from TI Evaluation Board to MityARM-335x Development Kit. I am using Ubuntu 12.04 host machine for development and NFS with client and server having static IP addresses is our preferred configuration.
It worked well with TI evm but with MityARM I cannot suppress DHCP request even if Kernel command line is set for static IP.

Kernel command line: console=ttyO0,115200n8 root=/dev/nfs nfsroot=10.0.0.1:/home/likewise-open/SCHICK_NT/lvolpert/Dev/3D/MityARM-rootfs_kit,nolock rw ip=10.0.0.22:10.0.0.1:10.0.0.1:255.255.255.0:devubuntu01::off

Booting fragment:
[ 1.766220] omap_rtc omap_rtc: setting system clock to 2011-12-25 05:35:41 UTC (1324791341)
[ 1.777648] PHY 0:00 not found
[ 1.781085]
[ 1.781089] CPSW phy found : id is : 0x70421
[ 1.788361] mmc0: new SD card at address aaaa
[ 1.793682] mmcblk0: mmc0:aaaa SU02G 1.84 GiB
[ 1.800705] mmcblk0: p1 p2 p3
[ 3.772171] PHY: 0:01 - Link is Up - 1000/Full
[ 3.791257] Sending DHCP and RARP requests ...... timed out!
[ 84.573369] IP-Config: Retrying forever (NFS root)...
[ 84.580729] PHY 0:00 not found
[ 84.584194]
[ 84.584198] CPSW phy found : id is : 0x70421
[ 86.582164] PHY: 0:01 - Link is Up - 1000/Full
[ 86.611253] Sending DHCP and RARP requests ..

Another problem occurs if I set for DHCP. Network file system is successfully mounted but after that everything freezes.

Kernel command line: console=ttyO0,115200n8 root=/dev/nfs nfsroot=192.168.0.144:/home/likewise-open/SCHICK_NT/lvolpert/Dev/3D/MityARM-rootfs_kit,nolock nfsrootdebug rw ip=dhcp

Booting fragment:
[ 4.330179] IP-Config: Complete:
[ 4.333590] device=eth0, addr=192.168.0.193, mask=255.255.254.0, gw=192.168.0.11,
[ 4.341656] host=192.168.0.193, domain=schicknt.com, nis-domain=(none),
[ 4.349004] bootserver=0.0.0.0, rootserver=192.168.0.144, rootpath=
[ 4.356713] Root-NFS: nfsroot=/home/likewise-open/SCHICK_NT/lvolpert/Dev/3D/MityARM-rootfs_kit,nolock
[ 4.366497] NFS: nfs mount opts='vers=2,udp,rsize=4096,wsize=4096,nolock,nolock,addr=192.168.0.144'
[ 4.376060] NFS: parsing nfs mount option 'vers=2'
[ 4.381342] NFS: parsing nfs mount option 'udp'
[ 4.386295] NFS: parsing nfs mount option 'rsize=4096'
[ 4.391858] NFS: parsing nfs mount option 'wsize=4096'
[ 4.397397] NFS: parsing nfs mount option 'nolock'
[ 4.402581] NFS: parsing nfs mount option 'nolock'
[ 4.407754] NFS: parsing nfs mount option 'addr=192.168.0.144'
[ 4.414042] NFS: MNTPATH: '/home/likewise-open/SCHICK_NT/lvolpert/Dev/3D/MityARM-rootfs_kit'
[ 4.422852] NFS: sending MNT request for 192.168.0.144:/home/likewise-open/SCHICK_NT/lvolpert/Dev/3D/MityARM-rootfs_kit
[ 4.443717] NFS: MNT request succeeded
[ 4.450290] VFS: Mounted root (nfs filesystem) on device 0:14.
[ 4.456784] Freeing init memory: 236K

I can successfully boot from SD card. And in this case I can ping my Host machine without a problem.

root@mityarm-335x:/# ifconfig eth0 10.0.0.22
root@mityarm-335x:/# ping 10.0.0.1
PING 10.0.0.1 (10.0.0.1): 56 data bytes
64 bytes from 10.0.0.1: seq=0 ttl=64 time=6.138 ms
64 bytes from 10.0.0.1: seq=1 ttl=64 time=0.372 ms
64 bytes from 10.0.0.1: seq=2 ttl=64 time=0.259 ms
64 bytes from 10.0.0.1: seq=3 ttl=64 time=0.259 ms #
--- 10.0.0.1 ping statistics ---
4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max = 0.259/1.757/6.138 ms

May be I am dealing with wrong kernel and/or file system. But file system is taken from Virtual Box provided by CriticalLink: MityARM-335X_dev.tgz and kernel from boot/ directory of this file system: uImage-3.1.0-00046-g5a51b9c

Thanks,
Leonid


Replies (19)

RE: NFS configuration - Added by Leonid Volpert over 11 years ago

This is the full list of my u-boot environment variables:

U-Boot# print_autoload=no
baudrate=115200
bootargs=root=/dev/nfs nfsroot=10.0.0.1:/home/likewise-open/SCHICK_NT/lvolpert/Dev/3D/MityARM-rootfs_kit,nolock rw ip=10.0.0.22:10
.0.0.1:10.0.0.1:255.255.255.0:devubuntu01::off
bootargs_defaults=setenv bootargs console=${console} ${optargs}
bootcmd=if mmc rescan; then echo SD/MMC found on device ${mmc_dev};if run loadbootenv; then echo Loaded environment from ${bootenv
};run importbootenv;fi;if test -n $uenvcmd; then echo Running uenvcmd ...;run uenvcmd;fi;if run mmc_load_uimage; then run mmc_args
;bootm ${kloadaddr};fi;fi;run nand_boot;
bootdelay=3
bootenv=uenv.txt
bootfile=uImage-3.1.0-00046-g5a51b9c-CL
console=ttyO0,115200n8
ethact=cpsw
ethaddr=bc:6a:29:87:7e:0c
importbootenv=echo Importing environment from mmc ...; env import -t $loadaddr $filesize
ip_method=none
ipaddr=10.0.0.22
kloadaddr=0x80007fc0
loadaddr=0x82000000
loadbootenv=fatload mmc ${mmc_dev} ${loadaddr} ${bootenv}
mmc_args=run bootargs_defaults;setenv bootargs ${bootargs} root=${mmc_root} rootfstype=${mmc_root_fs_type} ip=${ip_method}
mmc_boot=run mmc_args; run mmc_load_uimage; bootm ${kloadaddr}
mmc_dev=0
mmc_load_uimage=fatload mmc ${mmc_dev} ${kloadaddr} ${bootfile}
mmc_root=/dev/mmcblk0p2 rw
mmc_root_fs_type=ext3 rootwait
nand_args=run bootargs_defaults;setenv bootargs ${bootargs} root=${nand_root} noinitrd rootfstype=${nand_root_fs_type} ip=${ip_met
hod}
nand_boot=echo Booting from nand ...; run nand_args; nandecc hw 2; nand read.i ${kloadaddr} ${nand_src_addr} ${nand_img_siz}; boot
m ${kloadaddr}
nand_img_siz=0x500000
nand_root=ubi0:rootfs rw ubi.mtd=7,2048
nand_root_fs_type=ubifs rootwait=1
nand_src_addr=0x20000
net_args=run bootargs_defaults; set bootargs ${bootargs} root=/dev/nfs nfsroot=${serverip}:${rootpath},${nfsopts} rw ip=10.0.0.22:
10.0.0.1:10.0.0.1:255.255.255.0:devubuntu01::off
net_boot=set autoload no; tftp ${kloadaddr} ${bootfile}; run net_args; bootm ${kloadaddr}
nfsopts=nolock
rootpath=/home/likewise-open/SCHICK_NT/lvolpert/Dev/3D/MityARM-rootfs_dev
script_addr=0x81900000
serverip=10.0.0.1
static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off
stderr=serial
stdin=serial
stdout=serial_

net_boot is used to boot in nfs mode with static ip

Thank you
Leonid

RE: NFS configuration - Added by Michael Williamson over 11 years ago

When the unit boots, it prints out the command line it thinks it receives early in the boot sequence. Can you verify that that command line matches what you expect?

Can you capture the boot log and post it here?

-Mike

RE: NFS configuration - Added by Leonid Volpert over 11 years ago

My first post contains command line and fragment of boot sequence. It does match what I expected.

The full boot sequence for the NFS case and static IP is attached as a file:

Thanks
Leonid

RE: NFS configuration - Added by Michael Williamson over 11 years ago

Hmmm....

Can you try specifying "eth0"? It looks like you have a USB network gadget compiled in (or our default kernel does), from https://www.kernel.org/doc/Documentation/filesystems/nfs/nfsroot.txt,

 <device>    Name of network device to use.

        Default: If the host only has one device, it is used.
             Otherwise the device is determined using
             autoconfiguration. This is done by sending
             autoconfiguration requests out of all devices,
             and using the device that received the first reply.

Perhaps it is getting confused with multiple devices.

Can you please try:

ip=10.0.0.22:10.0.0.1:10.0.0.1:255.255.255.0:devubuntu01:eth0:off

-Mike

RE: NFS configuration - Added by Leonid Volpert over 11 years ago

Mike,

Adding 'eth0' as a device in ip=... does stop system from searching for DHCP.
But instead it gives a Kernel Panic with a following information:

[ 1.828257] CPSW phy found : id is : 0x70421
[ 1.837751] mmcblk0: p1 p2 p3
[ 3.822200] PHY: 0:01 - Link is Up - 1000/Full
[ 3.851785] IP-Config: Complete:
[ 3.855153] device=eth0, addr=10.0.0.22, mask=255.255.255.0, gw=10.0.0.1,
[ 3.862466] host=devubuntu01, domain=, nis-domain=(none),
[ 3.868548] bootserver=10.0.0.1, rootserver=10.0.0.1, rootpath=
[ 3.883028] VFS: Unable to mount root fs via NFS, trying floppy.
[ 3.889773] VFS: Cannot open root device "nfs" or unknown-block(2,0)
[ 3.896443] Please append a correct "root=" boot option; here are the available partitions:
[ 3.905203] 1f00 8192 mtdblock0 (driver?)
[ 3.910474] 1f01 128 mtdblock1 (driver?)
[ 3.915756] 1f02 128 mtdblock2 (driver?)
[ 3.921028] 1f03 128 mtdblock3 (driver?)
[ 3.926308] 1f04 128 mtdblock4 (driver?)
[ 3.931586] 1f05 1920 mtdblock5 (driver?)
[ 3.936858] 1f06 128 mtdblock6 (driver?)
[ 3.942136] 1f07 5120 mtdblock7 (driver?)
[ 3.947405] 1f08 254464 mtdblock8 (driver?)
[ 3.952684] b300 1931264 mmcblk0 driver: mmcblk
[ 3.958235] b301 72261 mmcblk0p1 00000000-0000-0000-0000-000000000mmcblk0p1
[ 3.966595] b302 923737 mmcblk0p2 00000000-0000-0000-0000-000000000mmcblk0p2
[ 3.974955] b303 915705 mmcblk0p3 00000000-0000-0000-0000-000000000mmcblk0p3
[ 3.983312] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)
[ 3.991932] Backtrace:
[ 3.994509] [<c0017990>] (dump_backtrace+0x0/0x110) from [<c0412618>] (dump_stack+0x18/0x1c)
[ 4.003315] r6:cf9a3000 r5:c063b84c r4:c06be120 r3:c066aad0
[ 4.009237] [<c0412600>] (dump_stack+0x0/0x1c) from [<c0412688>] (panic+0x6c/0x1a0)
[ 4.017243] [<c041261c>] (panic+0x0/0x1a0) from [<c060fcb4>] (mount_block_root+0x184/0x228)
[ 4.025956] r3:c066aad0 r2:00000000 r1:cf81bf58 r0:c0579da0
[ 4.031875] r7:00008000
[ 4.034523] [<c060fb30>] (mount_block_root+0x0/0x228) from [<c060ff1c>] (mount_root+0xd8/0xe0)
[ 4.043523] [<c060fe44>] (mount_root+0x0/0xe0) from [<c06100c4>] (prepare_namespace+0x1a0/0x1dc)
[ 4.052695] r4:c06bd0e0
[ 4.055343] [<c060ff24>] (prepare_namespace+0x0/0x1dc) from [<c060f90c>] (kernel_init+0x124/0x130)
[ 4.064692] r5:c0649bbc r4:c0649bbc
[ 4.068445] [<c060f7e8>] (kernel_init+0x0/0x130) from [<c0040904>] (do_exit+0x0/0x6a0)
[ 4.076705] r5:c060f7e8 r4:00000000

This is a Kernel command I am using:

[ 0.000000] Kernel command line: console=ttyO0,115200n8 root=/dev/nfs nfsroot=10.0.0.1:/home/likewise-open/SCHICK_NT/lvolpert/D
ev/3D/MityARM-rootfs_dev,nolock rw ip=10.0.0.22:10.0.0.1:10.0.0.1:255.255.255.0:devubuntu01:eth0:off

Thanks
Leonid

RE: NFS configuration - Added by Michael Williamson over 11 years ago

Hello,

I am a little confused. In your posts, you show initial success using 192.168.0.144 as your server. But the failures are using 10.0.0.1 as your server. Is your server really 10.0.0.1? Many times that address is reserved for a router, or are you using a point to point network (or is your server the router?)? Did your network configuration change between the experiments?

Can you please add nfsrootdebug to the bootarguments?

Can you also check your host log files and see if the NFS mount is being attempted? Should be in /var/log/messages somewhere.

If you boot via SD card, can you mount the targeted NFS drive using the command line? Can you share the command line that successfully mounts the drive?

-Mike

RE: NFS configuration - Added by Leonid Volpert over 11 years ago

Hello, Mike

Our basic configuration is an isolated network with 5-6 devices connected via Gigabit Network Switch (DEll PowerConnect 2708), all with static ip addresses. One of these devices is my Ubuntu PC (server 10.0.0.1), another MityARM board (10.0.0.22).
For the sake of experiment I did try to connect MityARM board to 192... network to check if it can boot if ip would be assigned by DHCP. My Ubuntu PC has second network card and always connected to 192... network. But this was just a special experiment, in all other cases 10... network is used.

Attached is a booting sequence file when nfsrootdebug was used.

No, I cannot mount targeted NFS even when boot via SD card, though I can ping my 10.0.0.1 server.
The following is an error message I am getting:

root@mityarm-335x:/# mount -o nolock 10.0.0.1:/home//likewise-open/lvolpert/Dev/3D/MityARM-rootfs_dev /mnt/test/
mount: wrong fs type, bad option, bad superblock on 10.0.0.1:/home//likewise-open/lvolpert/Dev/3D/MityARM-rootfs_dev,
missing codepage or helper program, or other error
(for several filesystems (e.g. nfs, cifs) you might
need a /sbin/mount.<type> helper program)
In some cases useful info is found in syslog - try
dmesg | tail or so

And this what dmesg says in this case:

root@mityarm-335x:/# dmesg | tail
[ 8.649279] EXT3-fs (mmcblk0p3): warning: maximal mount count reached, running e2fsck is recommended
[ 8.731219] EXT3-fs (mmcblk0p3): using internal journal
[ 8.736713] EXT3-fs (mmcblk0p3): recovery complete
[ 8.741713] EXT3-fs (mmcblk0p3): mounted filesystem with ordered data mode
[ 8.827648] alignment: ignoring faults is unsafe on this CPU. Defaulting to fixup mode.
[ 10.957294] PHY 0:00 not found
[ 10.960534] am335x_vsc8601_phy_fixup 70421 here addr = 1
[ 10.966872]
[ 10.966876] CPSW phy found : id is : 0x70421
[ 12.964268] PHY: 0:01 - Link is Up - 1000/Full

It looks like I can successfully mount NFS only if DHCP is used, see my first post. But anyway system freezes after that.

Thanks
Leonid

RE: NFS configuration - Added by Michael Williamson over 11 years ago

I can't open your word file. (Word says it is corrupt). Can you upload just a plain text file?

I think you need to type:

mount -t nfs -o nolock 10.0.0.1:/home//likewise-open/lvolpert/Dev/3D/MityARM-rootfs_dev /mnt/test/

We need to be able to show that we can mount the drive from the card prior to trying to use it as a root filesystem. It will make life much easier. You are not re-inventing the wheel here, we've done this a lot of times....

-Mike

RE: NFS configuration - Added by Leonid Volpert over 11 years ago

Mounting with -t nfs option produces the same error message.

Re-saved file in txt format

Leonid.

RE: NFS configuration - Added by Leonid Volpert over 11 years ago

Hi Mike,

I was able to mount NFS from the card after installing nfs-utils-client using opkg
Not sure what the next step can be.

Leonid

RE: NFS configuration - Added by Bob Duke over 11 years ago

Hello Leonid,

In a previous post you had an error running this command:

mount  -o nolock 10.0.0.1:/home//likewise-open/lvolpert/Dev/3D/MityARM-rootfs_dev  /mnt/test

Then later you said you added a "-t nfs" and it worked (after you installed nfs-utils-client). The filepath in this command is different from the one you're setting in U-boot.

If this isn't a typo, please change your U-boot rootpath from:

rootpath=/home/likewise-open/SCHICK_NT/lvolpert/Dev/3D/MityARM-rootfs_dev

to
rootpath=/home/likewise-open/lvolpert/Dev/3D/MityARM-rootfs_dev

and try again.

Thanks,

-Bob

RE: NFS configuration - Added by Leonid Volpert over 11 years ago

Hi Bob,

The current status is
1. After installing nfs-utils-client I can mount NFS directory when I boot from SD card
2. NFS boot is hanging after the following message:

Freeing init memory: 236K

You are right originally there was a mismatch between directory in u-boot rootpath variable and the one in /etc/exports.

Attached is the latest booting sequence text file

Thanks,

Leonid

RE: NFS configuration - Added by Jonathan Cormier over 11 years ago

Leonid,

It looks like nfs may be mounting. I'd expect an error similar to below if it didn't. Is the filesystem on the nfs server the same as the one on the sd card? How was it created?

[ 11.033447] VFS: Unable to mount root fs via NFS, trying floppy.
[ 11.041870] VFS: Cannot open root device "nfs" or unknown-block(2,0)
[ 11.048614] Please append a correct "root=" boot option; here are the available partitions:
[ 11.057586] 1f00 512 mtdblock0 (driver?)
[ 11.062988] 1f01 1792 mtdblock1 (driver?)
[ 11.068298] 1f02 256 mtdblock2 (driver?)
[ 11.073699] 1f03 5120 mtdblock3 (driver?)
[ 11.079071] 1f04 516608 mtdblock4 (driver?)
[ 11.084472] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)
[ 11.093231] [<c0044690>] (unwind_backtrace+0x0/0xe0) from [<c0348950>] (panic+0x50/0x178)
[ 11.101898] [<c0348950>] (panic+0x50/0x178) from [<c0009048>] (mount_block_root+0x1bc/0x1fc)
[ 11.110809] [<c0009048>] (mount_block_root+0x1bc/0x1fc) from [<c0009210>] (mount_root+0xa0/0xbc)
[ 11.120117] [<c0009210>] (mount_root+0xa0/0xbc) from [<c000938c>] (prepare_namespace+0x160/0x1b4)
[ 11.129486] [<c000938c>] (prepare_namespace+0x160/0x1b4) from [<c0008ca0>] (kernel_init+0x10c/0x14c)
[ 11.139160] [<c0008ca0>] (kernel_init+0x10c/0x14c) from [<c003fad4>] (kernel_thread_exit+0x0/0x8)

RE: NFS configuration - Added by Michael Williamson over 11 years ago

On your host, can you type "sudo exportfs" and list the results?

-Mike

RE: NFS configuration - Added by Leonid Volpert over 11 years ago

Hi All,

I agree, it looks like the original issue is fixed and now problem is happenning after mounting nfs. Probably, when init is running. I tried to play with init= commands in u-boot, but it didn't help.

The file system on the server is, as I stated in my very first post, taken from Virtual Box provided by CriticalLink: MityARM-335X_dev.tgz and kernel from boot/ directory of this file system: uImage-3.1.0-00046-g5a51b9c

The following is the result of exportfs command:

/home/likewise-open/SCHICK_NT/lvolpert/Dev/Marconi/PAT/uclinux/romfs
<world>
/home/likewise-open/SCHICK_NT/jgoyette/dev/3D/ti-sdk-am335x-evm-05.04.01.00/targetNFS_installed
<world>
/home/likewise-open/SCHICK_NT/lvolpert/Dev/3D/ti-sdk-am335x-evm-05.04.01.00/targetNFS
<world>
/home/likewise-open/SCHICK_NT/lvolpert/Dev/3D/MityARM-335X_dev
<world>
/home/likewise-open/SCHICK_NT/lvolpert/Dev/3D/MityARM-335X_kit
<world>
/home/likewise-open/SCHICK_NT/lvolpert/Dev/3D/MityARM-rootfs_kit
<world>

Thanks,
Leonid

RE: NFS configuration - Added by Jonathan Cormier over 11 years ago

Lenoid,

It might be helpful to put the filesystem on an SD card and make sure it boots from there.

-Jonathan

RE: NFS configuration - Added by Bob Duke over 11 years ago

Leonid,

One more suggestion: did you untar the sample filesystem as root? Or did you untar it as a normal user?

For example (you'll need to adjust the filesystem.tgz location and name):

$ mkdir /home/likewise-open/SCHICK_NT/lvolpert/Dev/3D/MityARM-335X_new
$ cd /home/likewise-open/SCHICK_NT/lvolpert/Dev/3D/MityARM-335X_new
$ mv filesystem.tgz /home/likewise-open/SCHICK_NT/lvolpert/Dev/3D/MityARM-335X_new
$ sudo tar zxvf filesystem.tgz 

Thanks,

-Bob

RE: NFS configuration - Added by Leonid Volpert over 11 years ago

Bob,

That was the problem. It's booting now.

Thanks everybody,

Leonid

RE: NFS configuration - Added by Bob Duke over 11 years ago

Great news Leonid! Thanks for the detailed error messages.

-Bob

    (1-19/19)
    Go to top
    Add picture from clipboard (Maximum size: 1 GB)