cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
tscott.phoenix
Observer
Observer
716 Views
Registered: ‎06-03-2011

PetaLinux ZCU104 fails to mount NFS as a rootfs w/Ubuntu 18.04

I just spent a couple of hours trying to figure out an issue with getting the ZCU104 to mount a rootfs over NFS and after figuring out the solution, thought I'd post about it in the event it saves others time.  I have the ZCU104 eval board and have been working through the UG1144 to become familiar with using PetaLinux to define and deploy the system.  My dev machine is running Ubuntu 18.04. 

After getting the NFS server setup on the dev machine, I was able to deploy a new kernel across my network.  Things were working as expected.  I then tried to get the ZCU104 to boot with a rootfs via NFS.  No go!  It would hang for about 100 seconds and produce a kernel panic.  Here's a kernel trace at the point of the error:

 

[  109.592772] VFS: Unable to mount root fs via NFS, trying floppy.
[  109.598975] VFS: Cannot open root device "nfs" or unknown-block(2,0): error -6
[  109.606227] Please append a correct "root=" boot option; here are the available partitions:
[  109.614572] 0100           65536 ram0 
[  109.614574]  (driver?)
[  109.620664] 0101           65536 ram1 
[  109.620665]  (driver?)
[  109.626753] 0102           65536 ram2 
[  109.626754]  (driver?)
[  109.632833] 0103           65536 ram3 
[  109.632834]  (driver?)
[  109.638922] 0104           65536 ram4 
[  109.638923]  (driver?)
[  109.645002] 0105           65536 ram5 
[  109.645004]  (driver?)
[  109.651091] 0106           65536 ram6 
[  109.651093]  (driver?)
[  109.657172] 0107           65536 ram7 
[  109.657173]  (driver?)
[  109.663260] 0108           65536 ram8 
[  109.663262]  (driver?)
[  109.669341] 0109           65536 ram9 
[  109.669342]  (driver?)
[  109.675440] 010a           65536 ram10 
[  109.675442]  (driver?)
[  109.681614] 010b           65536 ram11 
[  109.681616]  (driver?)
[  109.687804] 010c           65536 ram12 
[  109.687805]  (driver?)
[  109.693988] 010d           65536 ram13 
[  109.693990]  (driver?)
[  109.700164] 010e           65536 ram14 
[  109.700165]  (driver?)
[  109.706349] 010f           65536 ram15 
[  109.706350]  (driver?)
[  109.712528] 1f00            1024 mtdblock0 
[  109.712530]  (driver?)
[  109.719056] 1f01             256 mtdblock1 
[  109.719058]  (driver?)
[  109.725579] 1f02           22528 mtdblock2 
[  109.725580]  (driver?)
[  109.732106] b300        15558144 mmcblk0 
[  109.732108]  driver: mmcblk
[  109.738899]   b301        15554048 mmcblk0p1 00000000-01
[  109.738900] 
[  109.745686] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)
[  109.753937] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.19.0-xilinx-v2019.2 #1
[  109.761146] Hardware name: ZynqMP ZCU104 RevC (DT)
[  109.765921] Call trace:
[  109.768359]  dump_backtrace+0x0/0x148
[  109.772008]  show_stack+0x14/0x20
[  109.775308]  dump_stack+0x90/0xb4
[  109.778613]  panic+0x120/0x268
[  109.781651]  mount_block_root+0x1b0/0x260
[  109.785643]  mount_root+0x11c/0x148
[  109.789115]  prepare_namespace+0x158/0x1a0
[  109.793195]  kernel_init_freeable+0x1b8/0x1d4
[  109.797535]  kernel_init+0x10/0xfc
[  109.800920]  ret_from_fork+0x10/0x18
[  109.804480] SMP: stopping secondary CPUs
[  109.808394] Kernel Offset: disabled
[  109.811865] CPU features: 0x0,20802004
[  109.815596] Memory Limit: none
[  109.818638] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0) ]---

 

I deployed the same rootfs system to an older dev machine running as an NFS server with an old version of Linux Mint, updated bootargs and launched -- that worked!  Bwah?  Turns out that "rpcinfo | grep nfs" on the old machine shows that it is running version 2/3/4 of the NFS protocol.  The newer Ubuntu 18.04 dev machine only runs version 3/4.

SOLUTION: add "nfsvers=3" to your bootargs.  Example:

ZynqMP> setenv bootargs earlycon console=ttyPS0,115200 clk_ignore_unused root=/dev/nfs nfsroot=${serverip}:/srv/nfs/zcu104fs,tcp,nfsvers=3 ip=dhcp rw

Reference: https://www.denx.de/wiki/view/DULG/LinuxRootFilesystemUsingNFSVersion3

Cheers,

--tim

0 Kudos
1 Reply
watari
Teacher
Teacher
682 Views
Registered: ‎06-16-2013

Hi @tscott.phoenix 

 

As you know, there are different specification (concept) between v3 protocol and v4 protocol.

V4 protocol is a little difficult.

So, as you mentioned before, the best way to resolve like this issue is to use v3 protocol.

 

Best regards,

0 Kudos