VFS: Unable to mount root fs via nfs

Hello,
I have been following the guide from bootlin about embedded linux using a Beaglebone Black (not wireless) and I am trying to follow the labs.
I followed the guides and even had NFS working at one point. However after a while I started getting an error VFS: Unable to mount root fs via nfs followed by a kernel panic because it can’t find init.

Starting kernel …

[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 6.6.58-dirty (br-user@3e497a26cc59) (arm-linux-gcc (crosstool-NG 1.26.0) 13.2.0, GNU ld (crosstool-NG 1.26.0) 2.40) #2 SMP Wed Oct 30 19:59:08 UTC 2024
[ 0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c5387d
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[ 0.000000] OF: fdt: Machine model: TI AM335x BeagleBone Black
[ 0.000000] Memory policy: Data cache writeback
[ 0.000000] cma: Reserved 16 MiB at 0x9e800000 on node -1
[ 0.000000] Zone ranges:
[ 0.000000] Normal [mem 0x0000000080000000-0x000000009fdfffff]
[ 0.000000] HighMem empty
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x0000000080000000-0x000000009fdfffff]
[ 0.000000] Initmem setup node 0 [mem 0x0000000080000000-0x000000009fdfffff]
[ 0.000000] CPU: All CPU(s) started in SVC mode.
[ 0.000000] AM335X ES2.1 (sgx neon)
[ 0.000000] percpu: Embedded 16 pages/cpu s36052 r8192 d21292 u65536
[ 0.000000] Kernel command line: console=ttyS0,115200n8 rootwait root=/dev/nfs ip=192.168.0.100:::::usb0 g_ether.dev_addr=f8:dc:7a:00:00:02 g_ether.host_addr=f8:dc:7a:00:00:01 nfsroot=192.168.0.1:/home/satrapes/Projects/bootlin/embedded-linux/embedded-linux-bbb-labs/tinysystem/nfsroot,nfsvers=3,tcp rw
[ 0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes, linear)
[ 0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes, linear)
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 129412
[ 0.000000] mem auto-init: stack:all(zero), heap alloc:off, heap free:off
[ 0.000000] Memory: 483712K/522240K available (11264K kernel code, 1109K rwdata, 2540K rodata, 1024K init, 281K bss, 22144K reserved, 16384K cma-reserved, 0K highmem)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] trace event string verifier disabled
[ 0.000000] rcu: Hierarchical RCU implementation.
[ 0.000000] rcu: RCU event tracing is enabled.
[ 0.000000] rcu: RCU restricting CPUs from NR_CPUS=2 to nr_cpu_ids=1.
[ 0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[ 0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
[ 0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[ 0.000000] IRQ: Found an INTC at 0x(ptrval) (revision 5.0) with 128 interrupts
[ 0.000000] rcu: srcu_init: Setting srcu_struct sizes based on contention.
[ 0.000000] TI gptimer clocksource: always-on /ocp/interconnect@44c00000/segment@200000/target-module@31000
[ 0.000002] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
[ 0.000025] clocksource: dmtimer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[ 0.000495] TI gptimer clockevent: 24000000 Hz at /ocp/interconnect@48000000/segment@0/target-module@40000
[ 0.001929] Console: colour dummy device 80x30
[ 0.002012] Calibrating delay loop… 996.14 BogoMIPS (lpj=4980736)
[ 0.090544] CPU: Testing write buffer coherency: ok
[ 0.090650] CPU0: Spectre v2: using BPIALL workaround
[ 0.090662] pid_max: default: 32768 minimum: 301
[ 0.090782] LSM: initializing lsm=capability,integrity
[ 0.090952] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[ 0.090971] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[ 0.092442] CPU0: thread -1, cpu 0, socket -1, mpidr 0
[ 0.094032] Setting up static identity map for 0x80100000 - 0x80100078
[ 0.094314] rcu: Hierarchical SRCU implementation.
[ 0.094325] rcu: Max phase no-delay instances is 1000.
[ 0.095060] smp: Bringing up secondary CPUs …
[ 0.095106] smp: Brought up 1 node, 1 CPU
[ 0.095120] SMP: Total of 1 processors activated (996.14 BogoMIPS).
[ 0.095130] CPU: All CPU(s) started in SVC mode.
[ 0.095989] devtmpfs: initialized
[ 0.111056] VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3
[ 0.111423] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.111460] futex hash table entries: 256 (order: 2, 16384 bytes, linear)
[ 0.112685] pinctrl core: initialized pinctrl subsystem
[ 0.114452] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[ 0.117650] DMA: preallocated 256 KiB pool for atomic coherent allocations
[ 0.118256] audit: initializing netlink subsys (disabled)
[ 0.119540] thermal_sys: Registered thermal governor ‘fair_share’
[ 0.119559] thermal_sys: Registered thermal governor ‘step_wise’
[ 0.119565] thermal_sys: Registered thermal governor ‘user_space’
[ 0.119669] audit: type=2000 audit(0.110:1): state=initialized audit_enabled=0 res=1
[ 0.119745] cpuidle: using governor menu
[ 0.139454] No ATAGs?
[ 0.139480] hw-breakpoint: debug architecture 0x4 unsupported.
[ 0.142438] kprobes: kprobe jump-optimization is enabled. All kprobes are optimized if possible.
[ 0.163524] iommu: Default domain type: Translated
[ 0.163543] iommu: DMA domain TLB invalidation policy: strict mode
[ 0.164895] SCSI subsystem initialized
[ 0.171506] pps_core: LinuxPPS API ver. 1 registered
[ 0.171518] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti giometti@linux.it
[ 0.171542] PTP clock support registered
[ 0.180783] vgaarb: loaded
[ 0.181125] clocksource: Switched to clocksource dmtimer
[ 0.181747] VFS: Disk quotas dquot_6.6.0
[ 0.181808] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[ 0.203539] NET: Registered PF_INET protocol family
[ 0.203877] IP idents hash table entries: 8192 (order: 4, 65536 bytes, linear)
[ 0.205200] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear)
[ 0.205238] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear)
[ 0.205256] TCP established hash table entries: 4096 (order: 2, 16384 bytes, linear)
[ 0.205298] TCP bind hash table entries: 4096 (order: 4, 65536 bytes, linear)
[ 0.205397] TCP: Hash tables configured (established 4096 bind 4096)
[ 0.205530] UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
[ 0.205558] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
[ 0.205730] NET: Registered PF_UNIX/PF_LOCAL protocol family
[ 0.212298] RPC: Registered named UNIX socket transport module.
[ 0.212322] RPC: Registered udp transport module.
[ 0.212327] RPC: Registered tcp transport module.
[ 0.212333] RPC: Registered tcp-with-tls transport module.
[ 0.212338] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 0.212365] PCI: CLS 0 bytes, default 64
[ 0.213936] Initialise system trusted keyrings
[ 0.221480] workingset: timestamp_bits=14 max_order=17 bucket_order=3
[ 0.222703] NFS: Registering the id_resolver key type
[ 0.222782] Key type id_resolver registered
[ 0.222790] Key type id_legacy registered
[ 0.222843] jffs2: version 2.2. (NAND) (SUMMARY) © 2001-2006 Red Hat, Inc.
[ 0.223253] Key type asymmetric registered
[ 0.223268] Asymmetric key parser ‘x509’ registered
[ 0.223335] io scheduler mq-deadline registered
[ 0.223345] io scheduler kyber registered
[ 0.223412] io scheduler bfq registered
[ 0.249919] Serial: 8250/16550 driver, 6 ports, IRQ sharing enabled
[ 0.305883] brd: module loaded
[ 0.314091] loop: module loaded
[ 0.315014] mtdoops: mtd device (mtddev=name/number) must be supplied
[ 0.317723] i2c_dev: i2c /dev entries driver
[ 0.318561] cpuidle: enable-method property ‘ti,am3352’ found operations
[ 0.318992] sdhci: Secure Digital Host Controller Interface driver
[ 0.319001] sdhci: Copyright(c) Pierre Ossman
[ 0.319172] sdhci-pltfm: SDHCI platform and OF driver helper
[ 0.329786] ledtrig-cpu: registered to indicate activity on CPUs
[ 0.330610] Initializing XFRM netlink socket
[ 0.330766] NET: Registered PF_INET6 protocol family
[ 0.352698] Segment Routing with IPv6
[ 0.352774] In-situ OAM (IOAM) with IPv6
[ 0.352875] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[ 0.353846] NET: Registered PF_PACKET protocol family
[ 0.353874] NET: Registered PF_KEY protocol family
[ 0.353994] Key type dns_resolver registered
[ 0.354217] ThumbEE CPU extension supported.
[ 0.354238] Registering SWP/SWPB emulation handler
[ 0.354683] omap_voltage_late_init: Voltage driver support not added
[ 0.355020] SmartReflex Class3 initialized
[ 0.372679] Loading compiled-in X.509 certificates
[ 0.424539] platform 44e10800.pinmux: Fixed dependency cycle(s) with /ocp/interconnect@44c00000/segment@200000/target-module@10000/scm@0/pinmux@800/clkout2-pins
[ 0.425098] pinctrl-single 44e10800.pinmux: 142 pins, size 568
[ 0.429627] ti-sysc: probe of 44e31000.target-module failed with error -16
[ 0.477058] omap_i2c 4802a000.i2c: bus 1 rev0.11 at 100 kHz
[ 0.481908] ti-sysc: probe of 48040000.target-module failed with error -16
[ 0.520299] OMAP GPIO hardware version 0.1
[ 0.558675] omap_i2c 4819c000.i2c: bus 2 rev0.11 at 100 kHz
[ 0.585234] platform 4830e000.lcdc: Fixed dependency cycle(s) with /ocp/interconnect@44c00000/segment@200000/target-module@b000/i2c@0/tda19988@70
[ 0.596498] sdhci-omap 481d8000.mmc: supply pbias not found, using dummy regulator
[ 0.596988] sdhci-omap 481d8000.mmc: supply vqmmc not found, using dummy regulator
[ 0.683144] davinci_mdio 4a101000.mdio: davinci mdio revision 1.6, bus freq 1000000
[ 0.813916] davinci_mdio 4a101000.mdio: phy[0]: device 4a101000.mdio:00, driver SMSC LAN8710/LAN8720
[ 0.814388] cpsw-switch 4a100000.switch: initialized cpsw ale version 1.4
[ 0.814406] cpsw-switch 4a100000.switch: ALE Table size 1024
[ 0.814537] cpsw-switch 4a100000.switch: cpts: overflow check period 500 (jiffies)
[ 0.814554] cpsw-switch 4a100000.switch: CPTS: ref_clk_freq:250000000 calc_mult:2147483648 calc_shift:29 error:0 nsec/sec
[ 0.814658] cpsw-switch 4a100000.switch: Detected MACID = 64:8c:bb:72:b5:84
[ 0.816443] cpsw-switch 4a100000.switch: initialized (regs 0x4a100000, pool size 256) hw_ver:0019010C 1.12 (0)
[ 0.827077] debugfs: Directory ‘49000000.dma’ with parent ‘dmaengine’ already present!
[ 0.827120] edma 49000000.dma: TI EDMA DMA engine driver
[ 0.891910] hw perfevents: enabled with armv7_cortex_a8 PMU driver, 5 counters available
[ 0.899374] l3-aon-clkctrl:0000:0: failed to disable
[ 0.901760] printk: console [ttyS0] disabled
[ 0.902603] 44e09000.serial: ttyS0 at MMIO 0x44e09000 (irq = 35, base_baud = 3000000) is a 8250
[ 0.902684] printk: console [ttyS0] enabled
[ 2.042020] tps65217-pmic: Failed to locate of_node [id: -1]
[ 2.048056] tps65217-bl: Failed to locate of_node [id: -1]
[ 2.058937] tps65217 0-0024: TPS65217 ID 0xe version 1.2
[ 2.065032] platform 4830e000.lcdc: Fixed dependency cycle(s) with /ocp/interconnect@44c00000/segment@200000/target-module@b000/i2c@0/tda19988@70
[ 2.078446] i2c 0-0070: Fixed dependency cycle(s) with /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0
[ 2.089836] omap_i2c 44e0b000.i2c: bus 0 rev0.11 at 400 kHz
[ 2.097738] omap_gpio 44e07000.gpio: Could not set line 6 debounce to 200000 microseconds (-22)
[ 2.106606] sdhci-omap 48060000.mmc: Got CD GPIO
[ 2.111599] sdhci-omap 48060000.mmc: supply pbias not found, using dummy regulator
[ 2.121711] sdhci-omap 48060000.mmc: supply vqmmc not found, using dummy regulator
[ 2.130324] sdhci-omap 481d8000.mmc: supply pbias not found, using dummy regulator
[ 2.139132] sdhci-omap 481d8000.mmc: supply vqmmc not found, using dummy regulator
[ 2.178417] mmc1: SDHCI controller on 481d8000.mmc [481d8000.mmc] using External DMA
[ 2.187383] mmc0: SDHCI controller on 48060000.mmc [48060000.mmc] using External DMA
[ 2.195726] Trying to probe devices needed for running init …
[ 2.265548] mmc0: new high speed SDXC card at address aaaa
[ 2.272345] mmcblk0: mmc0:aaaa SR64G 59.5 GiB
[ 2.279695] mmcblk0: p1
[ 2.340754] mmc1: new high speed MMC card at address 0001
[ 2.347468] mmcblk1: mmc1:0001 MK2704 3.53 GiB
[ 2.354789] mmcblk1: p1
[ 2.358479] mmcblk1boot0: mmc1:0001 MK2704 2.00 MiB
[ 2.365563] mmcblk1boot1: mmc1:0001 MK2704 2.00 MiB
[ 2.372485] mmcblk1rpmb: mmc1:0001 MK2704 512 KiB, chardev (250:0)
[ 14.721323] clk: Disabling unused clocks
[ 110.562169] VFS: Unable to mount root fs via NFS.
[ 110.567061] devtmpfs: mounted
[ 110.571573] Freeing unused kernel image (initmem) memory: 1024K
[ 110.578148] Run /sbin/init as init process
[ 110.582757] Run /etc/init as init process
[ 110.586989] Run /bin/init as init process
[ 110.591399] Run /bin/sh as init process
[ 110.595434] Kernel panic - not syncing: No working init found. Try passing init= option to kernel. See Linux Documentation/admin-guide/init.rst for guidance.
[ 110.609684] —[ end Kernel panic - not syncing: No working init found. Try passing init= option to kernel. See Linux Documentation/admin-guide/init.rst for guidance. ]—

These are some of the u-boot settings

bootargs=console=ttyS0,115200n8 rootwait root=/dev/nfs ip=192.168.0.100:::::usb0 g_ether.dev_addr=f8:dc:7a:00:00:02 g_ether.host_addr=f8:dc:7a:00:00:01 nfsroot=192.168.0.1:/home/xzsb2/Projects/bootlin/embedded-linux/embedded-linux-bbb-labs/tinysystem/nfsroot,nfsvers=3,tcp rw
ipaddr=192.168.0.100
serverip=192.168.0.1
bootcmd=tftp 0x81000000 zImage; sleep 0.1; tftp 0x82000000 am335x-boneblack.dtb; bootz 0x81000000 - 0x82000000
usbnet_devaddr=f8:dc:7a:00:00:02
usbnet_hostaddr=f8:dc:7a:00:00:01

/etc/exports

/home/xzsb2/Projects/bootlin/embedded-linux/embedded-linux-bbb-labs/tinysystem/nfsroot 192.168.0.100(rw,async,no_root_squash,no_subtree_check)

nfs-server and tftpd are enabled and started.
(nfs-server shows up as active (exited))

tftpd loads the kernel image correctly and the .dtb file but not NFS.
Any help appreciated…

So I figured it out in the end. The problem was the network configuration on my server/host.
Basically TFTP would work and it would use the ifname created with nmcli.
When it would try to mount the NFS rootfs though it would reset and change the ifname and as a result could not find it.
The solution was for me to assign a dedicated ifname matched to the MAC Address.
I did this through systemd by adding a file /etc/systemd/network/10-bootlin.link

[Match]
PermanentMACAddress=f8:dc:7a:00:00:01

[Link]
Name=bootlin0

Now it used the same ifname and it just connects.
Bootlin links

1 Like