HELP: NFS MOUNT through mount( ) syscall

HELP: NFS MOUNT through mount( ) syscall

Post by Vijay Kum » Wed, 16 Nov 1994 01:55:31

Need help in mounting a NFS file system on Solaris 2.2 using the "mount()"
system call.  I wrote a function which successfully obtains the file handle
but after that the mount( ) system call is returning EINVAL. Here's what
I am doing.

The man page has the following info about the mount command:

     #include <sys/types.h>
     #include <sys/mount.h>

     int mount(const char *spec, const char *dir, int mflag,
                 /* int fstyp, const char *dataptr,  size_t  datalen  */

The following are my args to the mount system call:

error = mount( "", "/mnt/star", MS_DATA, "nfs", &nfs_args, sizeof(nfs_args) );

The nfs_args structure defined in /usr/include/nfs/mount.h looks like this:

struct nfs_args {
        struct netbuf           *addr;          /* file server address */
        struct netbuf           *syncaddr;      /* secure NFS time sync addr */
        struct knetconfig       *knconf;        /* transport netconfig struct */
        char                    *hostname;      /* server's hostname */
        char                    *netname;       /* server's netname */
        caddr_t                 fh;             /* File handle to be mounted */
        int                     flags;          /* flags */
        int                     wsize;          /* write size in bytes */
        int                     rsize;          /* read size in bytes */
        int                     timeo;          /* initial timeout in .1 secs */
        int                     retrans;        /* times to retry send */
        int                     acregmin;       /* attr cache file min secs */
        int                     acregmax;       /* attr cache file max secs */
        int                     acdirmin;       /* attr cache dir min secs */
        int                     acdirmax;       /* attr cache dir max secs */
        struct pathcnf          *pathconf;      /* static pathconf kludge */


I am setting addr, hostname, netname and fh. My flags only contain NFSMNT_SOFT.
The rest of the fields are NULL.  The system call returns EINVAL.  Is there
anything else that I need to set or do to get it working?

Any documentation?

Thanks in advance.



1. NFS mount won't mount at boot, but mount -a works fine.

I'm trying to get an NFS share to mount at boot time, but it won't. However,
mount -a works just fine. I've tried playing with the retry= option with no
luck. nsswitch.conf is hosts: files dns, and I have an entry for the host in
/etc/hosts. The client machine is SUSE 8 (2.4 kernel), the server is SUSE 9
(2.6 kernel). My fstab entry looks like this:

 storage01:/array/    /home/array    nfs     rw,auto,sync

Does anyone have any ideas on this?


2. Star Office

3. /var/mail: to NFS mount or not to NFS mount?

4. how to shutdown by users

5. nfs mount to a nfs mount fails

6. Now your company can really reap the benefit of Internet

7. nfs mount problem: mount: can't get address for nfs-server.kauai

8. DMI Service Provider for Linux

9. Mounting NFS thru MASQd firewall

10. solaris 2.5 system mounts an file system on NT server thru NFS

11. Mounting timeout on NFS mount

12. Mount timeout on NFS mount

13. nfs-mount rejects mounted partitions