Can't boot from nfs/tftp

I got stuck to boot from dhcp, nfs/tftp servers:
Here are the configs for the servers:
/etc/exports

/etc/exports: the access control list for filesystems which may be exported

to NFS clients. See exports(5).

Example for NFSv2 and NFSv3:

/srv/homes hostname1(rw,sync,no_subtree_check) hostname2(ro,sync,no_subtree_check)

Example for NFSv4:

/srv/nfs4 gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check)

/srv/nfs4/homes gss/krb5i(rw,sync,no_subtree_check)

/srv/nfs/rootfs 192.168.10.0/24(no_root_squash,no_subtree_check,rw)

/etc/dhcp/dhcpd.conf

dhcpd.conf

option definitions common to all served networks…

option domain-name “colibri.net”;
option domain-name-servers 127.0.0.53;

default-lease-time 600;
max-lease-time 7200;

Use this to enable / disable dynamic dns updates globally.

ddns-update-style none;

Use this to send dhcp log messages to a different log file (you also

have to hack syslog.conf to complete the redirection).

log-facility local7;

subnet 192.168.10.0 netmask 255.255.255.0 {
default-lease-time 86400;
max-lease-time 86400;
option broadcast-address 192.168.10.255;
option domain-name “colibri.net”;
option domain-name-servers 127.0.0.53;
option ip-forwarding off;
option routers 192.168.10.1;
option subnet-mask 255.255.255.0;
interface enp0s25;
range 192.168.10.32 192.168.10.254;
}
mac address dependent IP assignment, used for the toradex target device
host eval {
filename “Image.gz”;
fixed-address 192.168.10.2;
hardware ethernet 00:14:2d:6f:db:28;
next-server 192.168.10.1;
option host-name “Colibri iMX8X”;
option root-path “rootfs,v4,tcp,clientaddr=0.0.0.0”;
}

dhcpd.conf

Sample configuration file for ISC dhcpd

Attention: If /etc/ltsp/dhcpd.conf exists, that will be used as

configuration file instead of this file.

option definitions common to all supported networks…

#option domain-name “example.org”;
#option domain-name-servers ns1.example.org, ns2.example.org;

#default-lease-time 600;
#max-lease-time 7200;

The ddns-updates-style parameter controls whether or not the server will

attempt to do a DNS update when a lease is confirmed. We default to the

behavior of the version 2 packages (‘none’, since DHCP v2 didn’t

have support for DDNS.)

#ddns-update-style none;

If this DHCP server is the official DHCP server for the local

network, the authoritative directive should be uncommented.

#authoritative;

Use this to send dhcp log messages to a different log file (you also

have to hack syslog.conf to complete the redirection).

#log-facility local7;

No service will be given on this subnet, but declaring it helps the

DHCP server to understand the network topology.

#subnet 10.152.187.0 netmask 255.255.255.0 {
#}

This is a very basic subnet declaration.

#subnet 10.254.239.0 netmask 255.255.255.224 {

range 10.254.239.10 10.254.239.20;

option routers rtr-239-0-1.example.org, rtr-239-0-2.example.org;

#}

This declaration allows BOOTP clients to get dynamic addresses,

which we don’t really recommend.

#subnet 10.254.239.32 netmask 255.255.255.224 {

range dynamic-bootp 10.254.239.40 10.254.239.60;

option broadcast-address 10.254.239.31;

option routers rtr-239-32-1.example.org;

#}

A slightly different configuration for an internal subnet.

#subnet 10.5.5.0 netmask 255.255.255.224 {

range 10.5.5.26 10.5.5.30;

option domain-name-servers ns1.internal.example.org;

option domain-name “internal.example.org”;

option subnet-mask 255.255.255.224;

option routers 10.5.5.1;

option broadcast-address 10.5.5.31;

default-lease-time 600;

max-lease-time 7200;

#}

Hosts which require special configuration options can be listed in

host statements. If no address is specified, the address will be

allocated dynamically (if possible), but the host-specific information

will still come from the host declaration.

#host passacaglia {

hardware ethernet 0:0:c0:5d:bd:95;

filename “vmunix.passacaglia”;

server-name “toccata.example.com”;

#}

Fixed IP addresses can also be specified for hosts. These addresses

should not also be listed as being available for dynamic assignment.

Hosts for which fixed IP addresses have been specified can boot using

BOOTP or DHCP. Hosts for which no fixed address is specified can only

be booted with DHCP, unless there is an address range on the subnet

to which a BOOTP client is connected which has the dynamic-bootp flag

set.

#host fantasia {

hardware ethernet 08:00:07:26:c0:a5;

fixed-address fantasia.example.com;

#}

You can declare a class of clients and then do address allocation

based on that. The example below shows a case where all clients

in a certain class get addresses on the 10.17.224/24 subnet, and all

other clients get addresses on the 10.0.29/24 subnet.

#class “foo” {

match if substring (option vendor-class-identifier, 0, 4) = “SUNW”;

#}

#shared-network 224-29 {

subnet 10.17.224.0 netmask 255.255.255.0 {

option routers rtr-224.example.org;

}

subnet 10.0.29.0 netmask 255.255.255.0 {

option routers rtr-29.example.org;

}

pool {

allow members of “foo”;

range 10.17.224.10 10.17.224.250;

}

pool {

deny members of “foo”;

range 10.0.29.10 10.0.29.230;

}

#}

/etc/default/tftpd-hpa

/etc/default/tftpd-hpa

TFTP_USERNAME=“tftp”
TFTP_DIRECTORY=“/srv/tftp”
TFTP_ADDRESS=“0.0.0.0:69”
TFTP_OPTIONS=“–secure”

u-boot env:
setenv ipaddr 192.168.10.2 # IP address of your Colibri module
setenv serverip 192.168.10.1 # IP address of your NFS server
setenv netmask 255.255.255.0 # Network mask
setenv nfsroot /srv/nfs # NFS server export path
setenv bootargs ‘root=/dev/nfs rw nfsroot=192.168.10.1:/srv/nfs/rootfs,v4,tcp,clientaddr=0.0.0.0 ip=192.168.10.2:192.168.10.1:192.168.10.1:255.255.255.0:toradex::off’
saveenv

run bootcmd_dhcp

Kernel message:
starting USB…
Bus usb@5b0d0000: USB EHCI 1.00
Bus usbh3: XHCI-imx8 init hccr 0x000000005b130000 and hcor 0x000000005b130080 hc_length 128
Register 2000820 NbrPorts 2
Starting the controller
USB XHCI 1.00
scanning bus usb@5b0d0000 for devices… 1 USB Device(s) found
scanning bus usbh3 for devices… 2 USB Device(s) found
scanning usb for storage devices… 0 Storage Device(s) found
BOOTP broadcast 1
DHCP client bound to address 192.168.10.2 (2 ms)
Using ethernet@5b040000 device
TFTP from server 192.168.10.1; our IP address is 192.168.10.2
Filename ‘boot.scr’.
Load address: 0x9d480000
Loading: ################################################## 5.9 KiB
533.2 KiB/s
done
Bytes transferred = 6010 (177a hex)

Executing script at 9d480000

Loading DeviceTree: imx8qxp-colibri-eval-v3.dtb
BOOTP broadcast 1
DHCP client bound to address 192.168.10.2 (2 ms)
Using ethernet@5b040000 device
TFTP from server 192.168.10.1; our IP address is 192.168.10.2
Filename ‘imx8qxp-colibri-eval-v3.dtb’.
Load address: 0x9d400000
Loading: ################################################## 119.3 KiB
4.7 MiB/s
done
Bytes transferred = 122166 (1dd36 hex)
BOOTP broadcast 1
DHCP client bound to address 192.168.10.2 (2 ms)
Using ethernet@5b040000 device
TFTP from server 192.168.10.1; our IP address is 192.168.10.2
Filename ‘overlays.txt’.
Load address: 0x95c00000
Loading: ################################################## 52 Bytes
5.9 KiB/s
done
Bytes transferred = 52 (34 hex)
Applying Overlay: colibri-imx8x_vga-640x480_overlay.dtbo
BOOTP broadcast 1
DHCP client bound to address 192.168.10.2 (2 ms)
Using ethernet@5b040000 device
TFTP from server 192.168.10.1; our IP address is 192.168.10.2
Filename ‘overlays/colibri-imx8x_vga-640x480_overlay.dtbo’.
Load address: 0x95c00000
Loading: ################################################## 2 KiB
251 KiB/s
done
Bytes transferred = 2062 (80e hex)
BOOTP broadcast 1
DHCP client bound to address 192.168.10.2 (2 ms)
Using ethernet@5b040000 device
TFTP from server 192.168.10.1; our IP address is 192.168.10.2
Filename ‘Image.gz’.
Load address: 0x95c00000
Loading: ################################################## 11.1 MiB
6.6 MiB/s
done
Bytes transferred = 11675339 (b226cb hex)
Bootargs: quiet root=/dev/nfs ip=dhcp console=tty1 console=ttyLP3,115200 consoleblank=0 earlycon
Uncompressing Kernel Image

Flattened Device Tree blob at 9d400000

Booting using the fdt blob at 0x9d400000
Loading Device Tree to 00000000fd62a000, end 00000000fd66afff … OK

Starting kernel …

[ 0.851200] debugfs: Directory ‘lvds1’ with parent ‘pm_genpd’ already present!
[ 0.859171] debugfs: Directory ‘mipi1-i2c1’ with parent ‘pm_genpd’ already present!
[ 0.866988] debugfs: Directory ‘mipi1-i2c0’ with parent ‘pm_genpd’ already present!
[ 0.874765] debugfs: Directory ‘mipi1-pwm0’ with parent ‘pm_genpd’ already present!
[ 0.882555] debugfs: Directory ‘mipi1’ with parent ‘pm_genpd’ already present!
[ 101.373318] VFS: Unable to mount root fs via NFS.
[ 101.405571] Kernel panic - not syncing: No working init found. Try passing init= option to kernel. See Linux Documentation/admin-guide/init.rst for guidance.
[ 101.419958] CPU: 1 PID: 1 Comm: swapper/0 Not tainted 5.15.148-6.7.0-devel+git.bfdbfb2c85fb #1
[ 101.428692] Hardware name: Toradex Colibri iMX8QXP on Colibri Evaluation Board V3 (DT)
[ 101.436712] Call trace:
[ 101.439190] dump_backtrace+0x0/0x1f0
[ 101.442915] show_stack+0x18/0x40
[ 101.446280] dump_stack_lvl+0x68/0x84
[ 101.449994] dump_stack+0x18/0x34
[ 101.453361] panic+0x18c/0x34c
[ 101.456459] kernel_init+0x120/0x12c
[ 101.460088] ret_from_fork+0x10/0x20
[ 101.463722] SMP: stopping secondary CPUs
[ 101.467699] Kernel Offset: disabled
[ 101.471233] CPU features: 0x0,00000001,20000846
[ 101.475823] Memory Limit: none
[ 101.480599] —[ end Kernel panic - not syncing: No working init found. Try passing init= option to kernel. See Linux Documentation/admin-guide/init.rst for guidance. ]—

Hi, I’m the Toradex AI Assistant. I’m in early beta, and I would appreciate your feedback.
The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


Greetings,

The kernel panic error “VFS: Unable to mount root fs via NFS” indicates that the kernel is unable to mount the NFS root filesystem. This is typically due to incorrect NFS server setup, incorrect boot arguments, or network issues. Here are steps to troubleshoot and resolve the issue:

  1. Verify NFS Server Configuration: Ensure that the NFS server is correctly configured and running. The /etc/exports file should correctly export the NFS root filesystem with appropriate permissions. Based on your configuration, /srv/nfs/rootfs 192.168.10.0/24(no_root_squash,no_subtree_check,rw) seems correct. Make sure the NFS service is restarted after any changes to the exports file.

  2. Check Network Connectivity: Ensure that the network between the Toradex module and the NFS server is correctly configured and there are no connectivity issues. You can use tools like ping from the U-Boot environment (if available) or from a Linux environment to test connectivity to the NFS server.

  3. Review Boot Arguments: The boot arguments passed to the kernel are crucial for NFS boot. Ensure that the nfsroot parameter is correctly set to the NFS server’s IP address and the exported NFS root path. In your case, the bootargs seem to be set correctly as nfsroot=192.168.10.1:/srv/nfs/rootfs,v4,tcp,clientaddr=0.0.0.0. However, double-check that the NFS server’s IP address, the path to the NFS root filesystem, and the NFS version are correct.

  4. NFS Version Compatibility: Ensure that the NFS version specified in the boot arguments is supported by both the NFS server and the client on the Toradex module. You’ve specified NFSv4 (nfsroot=...v4...). If there’s a version mismatch or if NFSv4 is not correctly set up (e.g., requiring additional configuration compared to NFSv3), it might cause mounting issues.

  5. TFTP Server Configuration: Verify that the TFTP server is correctly serving the necessary boot files (kernel, device tree, etc.). Based on the kernel message, it seems like the TFTP server is functioning correctly, but it’s good to ensure that all files are correctly placed and accessible in the TFTP root directory.

  6. File Permissions and Paths: Ensure that the files on the NFS server have the correct permissions and that the paths specified in the

Please, also check if these links can help you solve your problem:

Boot from a TFTP/NFS Server | Toradex Developer Center.

I can mount from the module(192.168.10.2):
sudo mount -t nfs -o vers=4,proto=tcp,nolock 192.168.10.1:/srv/nfs/rootfs /mnt
So the nfs server is setup properly, any other suugestion?

Hi @Tiancheng

What version of our BSP are you using? What image? Any local changes of note?

Drew