Boot with nfs and root file system on virtual linux machine

  • Hello,


    I would boot my armstone a5 with a root file system over nfs from a virtual linux machine.
    If I do the settings like described in the documents it doesn't work.
    I receive following outputs in putty:


    VFS: Unable to mount root fs via NFS, trying floppy.
    VFS: Cannot open root device "nfs" or unknown-block(2,0)
    Please append a correct "root=" boot option; here are the available partitions:
    1f00 256 mtdblock0 (driver?)
    1f01 768 mtdblock1 (driver?)
    1f02 512 mtdblock2 (driver?)
    1f03 256 mtdblock3 (driver?)
    1f04 2304 mtdblock4 (driver?)
    1f05 4096 mtdblock5 (driver?)
    1f06 122880 mtdblock6 (driver?)
    Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)
    Backtrace:
    [<80035a30>] (dump_backtrace+0x0/0x108) from [<803f179c>] (dump_stack+0x18/0x1c)
    r6:80024d3c r5:8fd2a000 r4:80536ce0 r3:60000013
    [<803f1784>] (dump_stack+0x0/0x1c) from [<803f1b14>] (panic+0x5c/0x17c)
    [<803f1ab8>] (panic+0x0/0x17c) from [<80008dd8>] (mount_block_root+0x1d4/0x218)
    r3:00000004 r2:00000000 r1:8ffcff40 r0:8049257d
    r7:00000000
    [<80008c04>] (mount_block_root+0x0/0x218) from [<80008fc8>] (mount_root+0xc4/0xe8)
    [<80008f04>] (mount_root+0x0/0xe8) from [<8000914c>] (prepare_namespace+0x160/0x1b4)
    r4:80536700
    [<80008fec>] (prepare_namespace+0x0/0x1b4) from [<800089ec>] (kernel_init+0xf0/0x11c)
    r5:80024524 r4:80024524
    [<800088fc>] (kernel_init+0x0/0x11c) from [<80049744>] (do_exit+0x0/0x5f8)
    r5:800088fc r4:00000000


    If I boot with bootubi I can Ping the server (10.0.0.125) but
    mount -t nfs 10.0.0.125:/rootfs /mnt
    doesn't work
    # mount -t nfs 10.0.0.125:/rootfs /mnt
    svc: failed to register lockdv1 RPC service (errno 111).
    lockd_up: makesock failed, error=-111
    mount: mounting 10.0.0.125:/rootfs on /mnt failed: Connection refused


    but if I do
    mount -t nfs -o nolock 10.0.0.125:/rootfs /mnt
    it works.


    What means the option "nolock" and should I use it also while booting and how can I do that?


    Best Regards
    Joachim

  • For NFS and locking please see Wikipedia. For configuration on older Fedora versions see AdvicesForLinuxOnPC.pdf. Here is a description for newer Fedora versions. I hope I'll get the names correct as I am translating the information from a german version.


    Install the system-config-nfs package. Konfiguration of the exported directory works exactly as in the AdvicesForLinuxOnPC document. But it is not necessary to enter any ports under "Server Settings".


    Enable the ports in the firewall with


    Code
    1. firewall-config


    There switch to "Configuration: Permanent" and check the service "nfs" on tab "Services". Then add the following ports on tab "Ports":


    111 tcp
    111 udp
    2049 udp
    20048 tcp
    20048 udp


    Now you can restart the firewall by clicking on the restart button or Options -> Restart Firewall. If you now go on "Configuration: Runtime" the list of free ports should be visible and the nfs service should also be checked.


    Now set up everything so that the service is automatically started on next system boot.


    Code
    1. sudo systemctl enable nfs.target


    And also start then NFS server right now.


    Code
    1. sudo systemctl start nfs


    Now you can mount a root filesystem, e.g.


    Code
    1. sudo mount -o loop rootfs.ext2 /rootfs


    If you access the filesystem from the board, it is usually not possible to unmount the filesystem because it is still active and in use. In this case you can restart the NFS service with:


    Code
    1. sudo systemctl restart nfs


    This closes all file handles and then you can unmount the filesystem with:


    Code
    1. sudo umount /rootfs


    Your F&S Support Team

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.