Announcement

Collapse
No announcement yet.

NFS mount "No such file or directory"

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • NFS mount "No such file or directory"

    I've got ucLinux up on a Matchport and I've built with the "Development" configuration profile. I'm trying to boot from flash but have a workspace directory NFS mounted from the development machine. When I do "ps" on the Matchport, I see nfsiod and rpciod, amongst others, so it seems NFS client functionality is there.

    On my development machine, I've exported /home/craig/workspace. I can NFS mount this on another Linux machine so the server side seems OK, however when I type exactly the same command into ucLinux I get;

    / # mount 10.1.1.204:/home/craig/workspace /mnt/workspace
    mount 10.1.1.204:/home/craig/workspace /mnt/workspace
    mount: mounting 10.1.1.204:/home/craig/workspace on /mnt/workspace failed: No such file or directory

    /mnt/workspace exists on both the Matchport and my other Linux box. I tried using /mnt/flash/workspace instead, just in case, and got the same result.

    The contents of /etc/exports on my development environment are

    /home/craig/workspace 192.168.0.1/255.255.255.0(rw)
    /home/craig/workspace 10.1.1.1/255.255.255.0(rw)

    All three machines at the moment are in 10.1.1.x

    Does anyone know what could be wrong/what to check?

  • #2
    As a followup, I've tried changing the options in /etc/exports to

    rw,no_root_squash,anonuid=500,anongid=500,insecure ,sync,no_subtree_check

    but it's not helped.

    Comment


    • #3
      There are a few possibilities:

      First, try adding the string "-t nfs" as the first argument to the mount command. Thus the full mount command on your target would be:
      / # mount -t nfs 10.1.1.204:/home/craig/workspace /mnt/workspace

      If the first step doesn't work, verify that the following kernel options are enabled in <install_dir>/linux/vendors/Lantronix/<Product_Type>/config.linux-2.6.x:
      CONFIG_NFS_FS
      CONFIG_NFS_V3
      CONFIG_NFS_COMMON

      Also verify that the following options are enabled in <install_dir>/linux/vendors/Lantronix/<Product_Type>/config.vendor-2.6.x:
      CONFIG_USER_BUSYBOX_FEATURE_MOUNT_NFS
      CONFIG_USER_PORTMAP_PORTMAP

      Note that the above options are not enabled by default in the "default" profile, but are with the "develop" profile. If the above options are not present, add them by manually editing the config files, or by using 'make menuconfig'. A make clean is recommended before running another 'make' from <install_dir>.

      If the above options are present, verify that the portmap daemon is running using 'ps'. If not, start it with:
      / # portmap &

      You will need to add the above command to a startup script if you want to mount the share upon a reboot.

      Chapter 4 of the User Guide contains additional details about using NFS with the SDK.

      Please let me know whether or not one of the above approaches works.

      Matt

      Comment


      • #4
        Thanks for the help.

        Specifying -t nfs for mount just generates an "invalid argument" error.

        > verify that the following kernel options are enabled in
        > <install_dir>/linux/vendors/Lantronix/<Product_Type>/config.linux-2.6.x:
        > CONFIG_NFS_FS
        > CONFIG_NFS_V3
        > CONFIG_NFS_COMMON
        >
        > Also verify that the following options are enabled in
        > <install_dir>/linux/vendors/Lantronix/<Product_Type>/config.vendor-2.6.x:
        > CONFIG_USER_BUSYBOX_FEATURE_MOUNT_NFS
        > CONFIG_USER_PORTMAP_PORTMAP

        These are all enabled

        > If the above options are present, verify that the portmap daemon is running using
        > 'ps'. If not, start it with:
        > / # portmap &

        Portmap isn't found on the target. The only place it appears in either of those config files is the line where it is enabled. By changing /etc/motd I've confirmed that I really am rebuilding the image when I do a "make".

        If I search the directory tree on the development machine for portmap, I find it in <install_dir>/linux/user/portmap. Sources are there but no object files or executables. If I run make in that directory, I get an executable "portmap" but when I ftp it to the Matchport and execute it I get

        /mnt/flash # ./portmap
        ./portmap
        portmap: applet not found

        Going a different route, if I have a look in /proc/fs I see nfsd and nfsfs

        So it seems I can build successfully and most of the NFS stuff gets in, but portmap is not being included and doing it manually's not as simple a process as I tried.

        So how to sort out portmap?

        Comment


        • #5
          Unfortunately, running 'make' from within a user application directory is not supported. I would expect this to cause issues with the uClinux build hierarchy and cross-compilation toolchain settings. For now, it is necessary to run make from <install_dir>.

          It appears that a 'make distclean' instead of a 'make clean' is required after making changes to the linux and vendor config files under <install_dir>/linux/vendors/Lantronix/<Product_Type>. I was mistaken about this earlier (sorry for the inconvenience). After the 'make distclean', perform a 'make' to rebuild with the new settings.

          With regards to the vendor config file, the following lines should follow
          CONFIG_USER_PORTMAP_PORTMAP=y

          # CONFIG_USER_PORTMAP_PMAP_SET is not set
          # CONFIG_USER_PORTMAP_PMAP_DUMP is not set

          Note that you will be prompted for these setting values (disabled is fine) if they are not already present, during the first 'make' after the 'make distclean'.

          You can verify that the new config changes are active by checking for your changes in <install_dir>/linux/config/.config, the vendor configuration file, and <install_dir>/linux/linux-2.6.x/.config, the Linux kernel configuration file. It may be possible to skip the 'make distclean' by directly modifying this files, but note that they will be overwritten by the files under <install_dir>/linux/vendors/Lantronix/<Product_Type> upon the next 'make distclean'.

          If the above actions do not resolve your problem, please let me know, and also post the contents of <install_dir>/linux/.matchport_version from your host machine.

          Matt

          Comment


          • #6
            Thanks for the response. Just got back to this after the break.

            I've done a make distclean and then built a new image. The config flags mentioned are as specified. I don't get any errors now, but nor do I get anything mounted. I also get a dump coming out on the serial port when I try to mount;

            mount: page allocation failure. order:7, mode:0x40d0
            Stack from 40625e28:
            00000000 4004be5c 401aa02f 4056be94 00000007 000040d0 0000000a 402c2898
            00000010 00000000 00000000 00000000 402c28a0 402c15e0 402c2890 402aaae0
            40625f00 00000000 00000000 40624000 40624008 40624000 00000000 00000080
            000240d0 00000080 00000010 401c5ddc 00000000 00000000 00000000 4004bf04
            000040d0 00000007 401c5dd8 00000000 40055424 000040d0 00000007 401c5dd8
            00000001 00002009 00040004 00000000 00000021 00000000 402aaae0 405ba250
            CONFIG_FRAME_POINTER disabled, no symbolic call trace

            Mem-info:
            DMA per-cpu:
            CPU 0: hi: 0, btch: 1 usd: 0
            Active:0 inactive:15 dirty:0 writeback:0 unstable:0
            free:308 slab:955 mapped:0 pagetables:0 bounce:0
            DMA free:1232kB min:360kB low:448kB high:540kB active:0kB inactive:60kB present:8128kB pages_scanned:0 all_unreclaimable? no
            lowmem_reserve[]: 0 0 0
            DMA: 32*4kB 20*8kB 9*16kB 3*32kB 5*64kB 1*128kB 1*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 1232kB
            15 total pagecache pages
            2048 pages of RAM
            334 free pages
            689 reserved pages
            7 pages shared
            0 pages swap cached
            Allocation of length 262148 from process 101 (mount) failed
            DMA per-cpu:
            CPU 0: hi: 0, btch: 1 usd: 0
            Active:0 inactive:15 dirty:0 writeback:0 unstable:0
            free:308 slab:955 mapped:0 pagetables:0 bounce:0
            DMA free:1232kB min:360kB low:448kB high:540kB active:0kB inactive:60kB present:8128kB pages_scanned:0 all_unreclaimable? no
            lowmem_reserve[]: 0 0 0
            DMA: 32*4kB 20*8kB 9*16kB 3*32kB 5*64kB 1*128kB 1*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 1232kB
            15 total pagecache pages

            Memory info from top is;

            Mem: 4276K used, 1160K free, 0K shrd, 80K buff, 88K cached

            Contents of .matchport_version are -AR-380

            Comment


            • #7
              It appears that there was not enough contiguous free memory at the time you issued the mount command. I had mixed results duplicating your results with a similar setup. These seemed somewhat timing dependent, as some memory is freed up in the seconds just after booting. Using the "free" command can give you an idea of how much RAM is available. I had better results when over 1MB was free. It's unclear if it really makes a difference, but I had slightly better luck when I passed "-t nfs" as the first argument to the mount command.

              The "Development" profile uses the most RAM and flash. You can save some RAM by configuring a static IP address (so udhcpc is not invoked), and/or by preventing syslogd from running at startup. Checking the output of the "ps" command can alert you to additional processes that may not be needed for your applications. Fine tuning the build options can also be helpful. Disabling a feature like IPv6 can free a significant amount of memory. Another alternative is to use the "default" profile, enabling NFS support, and any additional features as needed.

              We are working on reducing the memory footprints of the various configuration profiles in the next release.

              Comment


              • #8
                Originally posted by mdavison View Post
                It appears that there was not enough contiguous free memory at the time you issued the mount command. I had mixed results duplicating your results with a similar setup.
                Memory was tight; regardless of what top reported, free indicated I only had about 500K free.

                I've done "make distclean" and rebuilt starting from the "COMPACT" profile. Manually added CONFIG_NFS_FS, _V3 and _COMMON and CONFIG_USER_BUSYBOX_FEATURE_MOUNT_NFS and CONFIG_USER_PORTMAP_PORTMAP to the relevant files. In menuconfig, I've also enabled;
                Networking->DHCP Support
                File Systems->Network File Systems (though this appeared to be empty)
                Busybox->Linux System Utils->mount->support mounting NFS (which was disabled despite me setting _MOUNT_NFS beforehand)
                Busybox->Networking Utils->telnetd
                Busybox->Networking Utils->telnetd standalone

                DHCP doesn't work; though it's a minor concern. After bringing the interface up manually with a static address, I seem to have 3.2 megs free. Tried doing the NFS mount and got "No such device".

                If I deliberately get the address wrong in the mount command it hangs; the error's then after it connects to the NFS server which is further than I've got so far.

                If I try and start portmap, I get the error "portmap: not found". I've doublechecked that CONFIG_USER_PORTMAP_PORTMAP is still set and that the server's up and allowing other machines to mount the same export.

                I've had a look at chapter 4 but it's mainly concerned with getting the whole system running via NFS- all I want is to get at my app build directory.

                Are there more flags needed which are by default not enabled in COMPACT?

                I'm suspicious that menuconfig didn't show "support mounting NFS" as being enabled after I manually edited the file- should it have done?

                Additionally, telnetd isn't working now. If I try and start it from the command prompt, I get some bytes output to the console and then the command exits. If I start inetd and try to telnet in, I get an immediate disconnect. If I continue with COMPACT then I'll try disabling the standalone telnetd in menuconfig, but it's an extra oddity to mention.

                Is COMPACT simply stripped down too far for me to use without understanding much more about what all the different config switches are doing so I know which ones to switch back on again?

                Comment


                • #9
                  For now, I would recommend starting with either the "default" or "no_ipv6" profiles. You will still need to enable the settings for NFS and portmap. In general, these profiles are better suited for development purposes. The "compact" profile has a smaller footprint, but may require some fine tuning of configuration parameters. In some situations, it may be best to start with a more feature rich profile for the initial development work, and transition to "compact" as needed for production.

                  With regards to vendor and kernel options such as those for NFS and portmap, it is important to realize that the configuration files from <install_dir>/vendors/Lantronix/<Product_Type>/profile/ are copied to <install_dir>/linux/config/.config (vendor settings) and <install_dir>/linux/linux-2.6.x/.config (kernel settings) during the initial make. Subsequent changes to the files under the vendors directory will not take effect until after the next "make distclean". This might explain the out of sync behavior you described.

                  I will look into the telnetd and dhcp issues you experienced with the "compact" profile when time permits.
                  Last edited by mdavison; 01-05-2010, 07:25 PM.

                  Comment


                  • #10
                    Tried again, still not got there.

                    I've done make distclean, then gone into make xconfig and selected the "no_IP_v6" profile. Then manually edited the config files to enable the five flags, run make and then put the image onto the target. Portmap isn't on there and I can't mount NFS exports.

                    Looking at linux/config/.config shows the NFS flags are not set in there, though they are set in <install_dir>/linux/vendors/Lantronix/<Product_Type>/config.linux-2.6.x

                    You say the config files in /profile/ are copied direct to <install_dir>/linux/config/.config; what's the purpose of the config files in <install_dir>/linux/vendors/Lantronix/<Product_Type> then? That's where I'm making changes, but they don't seem to propagate to the .config files, yet I'm reluctant to start hacking at the files in /profile/ without knowing I'm supposed to since then "make distclean" won't be able to roll back to a well known state.

                    Comment


                    • #11
                      It's unclear to me whether you manually edited the files under <install_dir>/linux/config/ and <install_dir>/linux/linux-2.6.x, or the files under <install_dir>/linux/vendors/Lantronix/<Product_Type>/profile/no_ipv6/. I went through essentially the same steps you described, editing the files under the first set of locations, and then issuing a make. The files from the first set of locations should still have your changes after the build. After transferring over the new image to the target, I was able to mount a remote NFS share.

                      With regards to the concern about overwriting the original configuration files; I would recommend making a backup copy of the <install_dir>/linux/vendors/Lantronix/<Product_Type>/profile directory, and any additional config files as desired. Then it should be safe to run 'make distclean' as needed.

                      The copying of the configuration files from the vendors subdirectories is a part of uClinux. This allows for default configuration files for multiple platforms to be stored, and selected at will. It also allows for rolling back changes with 'make distclean'. Unfortunately, it can sometimes be a source of confusion.

                      Comment

                      Working...
                      X