Unable to mount root fs via NFS; error -6

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Unable to mount root fs via NFS; error -6

19,464 Views
jaikumarj
Contributor I

Hi,

I am working on T1040RDB board. Trying to mount the rootfs through NFS

Getting this error:

VFS: Unable to mount root fs via NFS, trying floppy.
VFS: Cannot open root device "nfs" or unknown-block(2,0): error -6
Please append a correct "root=" boot option; here are the available partitions:

env variable are set as above

baudrate=115200

bdev=sda3

bootargs=root=/dev/ram rw console=ttyS0,115200

bootcmd=run nohvboot

bootcmd_default=setenv bootargs root=/dev/ram rw console=$consoledev,$baudrate $othbootargs;bootm e8020000 e9300000 e8800000

bootdelay=3

bootfile=zImage

c=ffe

consoledev=ttyS0

dir=t1040rdb-64b

eth1addr=00:04:9F:03:41:BE

eth2addr=00:04:9F:03:41:BF

eth3addr=00:04:9F:03:41:C0

eth4addr=00:04:9F:03:41:C1

eth5addr=00:04:9f:8e:7b:b4

ethact=FM1@DTSEC4

ethaddr=00:04:9F:03:41:BD

ethprime=e1000#0

fdtaddr=e00000

fdtfile=uImage-t1040rdb.dtb

fileaddr=e00000

filesize=8b66

fman_ucode=eff00000

gatewayip=192.168.0.254

hvboot=setenv bootargs console=$consoledev,$baudrate config-addr=0xfe8900000;bootm 0xfe8700000 - 0xfe8800000

hwconfig=fsl_ddr:bank_intlv=cs0_cs1

ipaddr=192.168.0.218

loadaddr=1000000

netdev=eth3

netmask=255.255.255.0

nfsboot=setenv bootargs root=/dev/nfs rw nfsroot=$serverip:$rootpath ip=$ipaddr:$serverip:$gatewayip:$netmask:$hostname:$netdev:off console=$consoledev,$baudrate $othbootargs;tftp $loadaddr $bootfile;tftp $fdtaddr $fdtfile;bootm $loadaddr - $fdtaddr

nohvboot=tftp 1000000 $dir/$bootfile;tftp 5000000 $dir/$ramdiskfile;tftp e00000 $dir/$fdtfile;setenv bootargs root=/dev/ram rw console=ttyS0,115200 $othbootargs;bootm 1000000 5000000 e00000;

ramboot=setenv bootargs root=/dev/ram rw console=$consoledev,$baudrate $othbootargs;tftp $ramdiskaddr $ramdiskfile;tftp $loadaddr $bootfile;tftp $fdtaddr $fdtfile;bootm $loadaddr $ramdiskaddr $fdtaddr

ramdiskaddr=2000000

ramdiskfile=fsl-image-core-t1040rdb-64b.ext2.gz.u-boot

rootpath=/opt/fsl_rootfs_nfs

serverip=192.168.0.47

tftpflash=tftpboot $loadaddr $uboot && protect off $ubootaddr +$filesize && erase $ubootaddr +$filesize && cp.b $loadaddr $ubootaddr $filesize && protect on $ubootaddr +$filesize && cmp.b $loadaddr $ubootaddr $filesize

uboot=u-boot.bin

ubootaddr=0xeff40000

Kernel parameters & boot log

PERCPU: Embedded 11 pages/cpu @c000000007900000 s15808 r0 d29248 u262144

Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 1034240

Kernel command line: root=/dev/nfs rw nfsroot=192.168.0.47:/opt/fsl_rootfs_nfs ip=192.168.0.218:192.168.0.47:192.168.0.254:255.255.255.0::eth0:off console=ttyS0,115200

PID hash table entries: 4096 (order: 3, 32768 bytes)

....

...

fsl_dpa_generic: FSL DPAA Generic Ethernet driver ()

drivers/rtc/hctosys.c: unable to open rtc device (rtc0)

IP-Config: Complete:

     device=eth0, hwaddr=00:04:9f:03:41:bd, ipaddr=192.168.0.218, mask=255.255.255.0, gw=192.168.0.254

     host=192.168.0.218, domain=, nis-domain=(none)

     bootserver=192.168.0.47, rootserver=192.168.0.47, rootpath=

md: Waiting for all devices to be available before autodetect

md: If you don't use raid, use raid=noautodetect

md: Autodetecting RAID arrays.

md: Scanned 0 and added 0 devices.

md: autorun ...

md: ... autorun DONE.

VFS: Unable to mount root fs via NFS, trying floppy.

VFS: Cannot open root device "nfs" or unknown-block(2,0): error -6

NFS server is working fine, I have tested it by mounting it.

On a mailing list, I found, "vers=3" to be added to nfsroot,  Tried it, same result.

Please direct me.

Thanks & regards

Jaikumar

0 Kudos
Reply
8 Replies

10,451 Views
yipingwang
NXP TechSupport
NXP TechSupport

Hello Jaikumar,

You didn't specify the correct network interface in the nfs bootargs.

According to your u-boot environment, you configure ethact as FM1@DTSEC4, but you use eth0 as the nfs bootargs, please modify the bootargs as the following.

root=/dev/nfs rw nfsroot=192.168.0.47:/opt/fsl_rootfs_nfs ip=192.168.0.218:192.168.0.47:192.168.0.254:255.255.255.0::eth3:off console=ttyS0,115200


Have a great day,
Yiping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply

10,450 Views
jaikumarj
Contributor I

Hi Yiping Wang,

Thanks for your reply.

I have already tried it. eth3 also gives same result (VFS: Cannot open root device "nfs" or unknown-block(2,0): error -6).

I also have a confusion regarding the ethernet naming.

* In the boot loader, it is FM1@DTSECx (FM1@DTSEC4,..)

* Will booting, it is ethx (eth0, eth1....)

* And under linux, it is fm1-gbx (fm1-gb1, ...) >> this was absorbed on booting from flash.

I have tried using fm1-gb3 with nfs bootarg, but only ethx initializes correctly.

Log:

=>printenv

baudrate=115200

bdev=sda3

bootargs=root=/dev/ram rw console=ttyS0,115200

bootcmd=run nohvboot

bootcmd_default=setenv bootargs root=/dev/ram rw console=$consoledev,$baudrate $othbootargs;bootm e8020000 e9300000 e8800000

bootdelay=3

bootfile=zImage

c=ffe

consoledev=ttyS0

dir=t1040rdb-64b

eth1addr=00:04:9F:03:41:BE

eth2addr=00:04:9F:03:41:BF

eth3addr=00:04:9F:03:41:C0

eth4addr=00:04:9F:03:41:C1

eth5addr=00:04:9f:8e:7b:b4

ethact=FM1@DTSEC4

ethaddr=00:04:9F:03:41:BD

ethprime=e1000#0

fdtaddr=e00000

fdtfile=uImage-t1040rdb.dtb

fileaddr=e00000

filesize=8b66

fman_ucode=eff00000

gatewayip=192.168.0.254

hvboot=setenv bootargs console=$consoledev,$baudrate config-addr=0xfe8900000;bootm 0xfe8700000 - 0xfe8800000

hwconfig=fsl_ddr:bank_intlv=cs0_cs1

ip_dyn=no

ipaddr=192.168.0.218

loadaddr=1000000

netdev=eth3

netmask=255.255.255.0

nfsboot=setenv bootargs root=/dev/nfs rw nfsroot=$serverip:$rootpath ip=$ipaddr:$serverip:$gatewayip:$netmask:$hostname:$netdev:off console=$consoledev,$baudrate $othbootargs;tftp $loadaddr $bootfile;tftp $fdtaddr $fdtfile;bootm $loadaddr - $fdtaddr

nohvboot=tftp 1000000 $dir/$bootfile;tftp 5000000 $dir/$ramdiskfile;tftp e00000 $dir/$fdtfile;setenv bootargs root=/dev/ram rw console=ttyS0,115200 $othbootargs;bootm 1000000 5000000 e00000;

ramboot=setenv bootargs root=/dev/ram rw console=$consoledev,$baudrate $othbootargs;tftp $ramdiskaddr $ramdiskfile;tftp $loadaddr $bootfile;tftp $fdtaddr $fdtfile;bootm $loadaddr $ramdiskaddr $fdtaddr

ramdiskaddr=2000000

ramdiskfile=fsl-image-core-t1040rdb-64b.ext2.gz.u-boot

rootpath=/opt/fsl_rootfs_nfs

serverip=192.168.0.47

tftpflash=tftpboot $loadaddr $uboot && protect off $ubootaddr +$filesize && erase $ubootaddr +$filesize && cp.b $loadaddr $ubootaddr $filesize && protect on $ubootaddr +$filesize && cmp.b $loadaddr $ubootaddr $filesize

uboot=u-boot.bin

ubootaddr=0xeff40000

Environment size: 1935/8188 bytes

=> ping 192.168.0.47

Using FM1@DTSEC4 device

host 192.168.0.47 is alive

On boot:

Kernel command line: root=/dev/nfs rw nfsroot=192.168.0.47:/opt/fsl_rootfs_nfs ip=192.168.0.218:192.168.0.47:192.168.0.254:255.255.255.0::eth3:off console=ttyS0,115200

.....

IP-Config: Complete:

     device=eth3, hwaddr=00:04:9f:03:41:c0, ipaddr=192.168.0.218, mask=255.255.255.0, gw=192.168.0.254

     host=192.168.0.218, domain=, nis-domain=(none)

     bootserver=192.168.0.47, rootserver=192.168.0.47, rootpath=

md: Waiting for all devices to be available before autodetect

md: If you don't use raid, use raid=noautodetect

md: Autodetecting RAID arrays.

md: Scanned 0 and added 0 devices.

md: autorun ...

md: ... autorun DONE.

VFS: Unable to mount root fs via NFS, trying floppy.

VFS: Cannot open root device "nfs" or unknown-block(2,0): error -6

rootpath is empty, is this fine?

Regards

Jaikumar

0 Kudos
Reply

10,452 Views
yipingwang
NXP TechSupport
NXP TechSupport

Hello Jaikumar J,

Did you use the default Kernel configuration provided in Linux SDK?

Please refer to the following

CONFIG_NETWORK_FILESYSTEMS=y

CONFIG_NFS_FS=y

CONFIG_NFS_V2=y

CONFIG_NFS_V3=y

# CONFIG_NFS_V3_ACL is not set

CONFIG_NFS_V4=y

# CONFIG_NFS_SWAP is not set

# CONFIG_NFS_V4_1 is not set

CONFIG_ROOT_NFS=y

# CONFIG_NFS_USE_LEGACY_DNS is not set

CONFIG_NFS_USE_KERNEL_DNS=y

CONFIG_NFSD=m

If your problem remains, please also provide /etc/exports file.

Thanks,

Yiping

0 Kudos
Reply

10,452 Views
jaikumarj
Contributor I

Hi Yiping,

I have not modified any thing related to NFS config, it is same as default. Only change related to kernel is, to generate zImage in meta-fsl-ppc/conf/machine/include/qoriq-default-settings.inc. This was done as zImage was specified in the document for working with NFS.

Is zImage image mandatory for NFS or uImage can be used?

/etc/exports file:

/opt/fsl_rootfs_nfs *(rw,no_root_squash,async)

With this config, I have tested NFS, mounting from other PC. NFS server works.

Regards

jaikumar

0 Kudos
Reply

10,452 Views
yipingwang
NXP TechSupport
NXP TechSupport

Hello Jaikumar J,

Please use the command "ls /opt/fsl_rootfs_nfs" display the files structure in this folder.


Have a great day,
Yiping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply

10,452 Views
jaikumarj
Contributor I

Hello Yiping,

This is the file structure

$ ll /opt/fsl_rootfs_nfs/

total 156992

drwxr-xr-x.  2 root root     4096 Jun 25 15:54 bin

drwxr-xr-x.  2 root root       69 Jun 25 15:54 boot

drwxr-xr-x.  2 root root        6 Jun  9 15:19 dev

drwxr-xr-x. 29 root root     4096 Jun 25 15:55 etc

-rw-r--r--.  1 root root 55225550 Jun 26 14:30 fsl-image-core-t1040rdb-64b-20150625101931.rootfs.tar.gz

drwxr-sr-x.  3 root root       17 Jun  9 15:19 home

drwxr-xr-x.  4 root root       31 Jun 17 15:18 lib

drwxr-xr-x.  4 root root     4096 Jun 25 15:54 lib64

lrwxrwxrwx.  1 root root       12 Jun 25 15:54 linuxrc -> /bin/busybox

drwxr-xr-x.  2 root root        6 Jun  9 15:19 media

drwxr-xr-x.  2 root root        6 Jun  9 15:19 mnt

drwxr-xr-x.  2 root root        6 Jun  9 15:19 proc

drwxr-xr-x.  2 root root       24 Jun 25 15:54 root

drwxr-xr-x.  2 root root        6 Jun  9 15:19 run

drwxr-xr-x.  2 root root     4096 Jun 25 15:54 sbin

drwxr-xr-x.  2 root root        6 Jun  9 15:19 sys

drwxrwxrwt.  2 root root        6 Jun  9 15:19 tmp

drwxr-xr-x. 12 root root     4096 Dec 15  2014 usr

drwxr-xr-x.  8 root root     4096 Dec 15  2014 var

Regards

Jaikumar

0 Kudos
Reply

10,452 Views
yipingwang
NXP TechSupport
NXP TechSupport

Hello Jaikumar,

There should be no problem with the target board setting, please refer to my attached nfs boot log, I also configured the same parameters and I can boot nfs system without problem.

Please check the server side, you could boot the system with ramdisk or jffs2, and enter Linux to verify  whether the following command could be execute successfully.(Please use fm1-gb3 in Linux)

mount -t nfs 192.168.0.47:/opt/fsl_rootfs_nfs /mnt

ls /mnt

Thanks,

Yiping

0 Kudos
Reply

10,452 Views
jaikumarj
Contributor I

Hi Yiping,

Thanks for your help. As you said, there was no problem with the target board.

Its the nfs server problem on ubuntu with linux 3.10. mounting the nfs fs (using mount) was working, so I had a doubt on the target board.

Tried nfs server on centos with linux 2.6, it works fine. No idea, what was the problem on ubuntu.

Thanks & Regards

Jaikumar

0 Kudos
Reply