[gentoo-user] mount nfs thru mount system call
when i mount the nfs through the system callmount(192.168.0.51:/root, /mnt/9, nfs, 0, rw, async);it shows an invalid argument. but when i do this thru mount command it mounts without any problem -- C.S.Prakash
Re: [gentoo-user] mount nfs thru mount system call
On Wednesday 08 March 2006 19:55, c.s.prakash wrote: when i mount the nfs through the system call mount(192.168.0.51:/root, /mnt/9, nfs, 0, rw, async); it shows an invalid argument. but when i do this thru mount command it mounts without any problem It's been about 4 years since I last had to do that (so no guarantees), but If I remember correctly the data argument for NFS is not just a string. Instead I believe that you have to do some other magic to encode the data correctly. I would recommend looking at the source code for mount and see what happens. Josh -- gentoo-user@gentoo.org mailing list
Re: [gentoo-user] mount nfs thru mount system call
It's been about 4 years since I last had to do that (so no guarantees), but If I remember correctly the data argument for NFS is not just a string. Instead I believe that you have to do some other magic to encode the data correctly. I would recommend looking at the source code for mount and see what happens. IMHO it's easier to look at 'man 2 mount' : ... Values for the filesystemtype argument supported by the kernel are listed in /proc/filesystems (like minix, ext2, msdos, proc, nfs, iso9660 etc.). ... But I also can't help more... Petr -- gentoo-user@gentoo.org mailing list
Re: [gentoo-user] mount nfs thru mount system call
On Wednesday 08 March 2006 21:07, Petr Uzel wrote: IMHO it's easier to look at 'man 2 mount' : ... Values for the filesystemtype argument supported by the kernel are listed in /proc/filesystems (like minix, ext2, msdos, proc, nfs, iso9660 etc.). man 2 mount is not going to help. If you had looked closer you would realize that the data argument is the last argument not the filesystem type. The man page only says that the data argument is typically a comma separated string. I don't believe that is the case with NFS. Josh -- gentoo-user@gentoo.org mailing list
Re: [gentoo-user] mount nfs thru mount system call
www.wolfspakt.de/spiel.php?id=7358
Re: [gentoo-user] mount nfs thru mount system call
On 3/8/06, Josh Helmer [EMAIL PROTECTED] wrote: man 2 mount is not going to help.If you had looked closer you would realizethat the data argument is the last argument not the filesystem type.Theman page only says that the data argument is typically a comma separated string. I don't believe that is the case with NFS.Why not? I would try something like for data:rsize=8192,wsize=8192,soft. Check nfs(5) for details.-- Darryl Wagoner - WA1GONEvil triumphs when good men do nothing.- Edmund Burke [1729-1797]
Re: [gentoo-user] mount nfs thru mount system call
On Wednesday 08 March 2006 22:04, Darryl Wagoner wrote: On 3/8/06, Josh Helmer [EMAIL PROTECTED] wrote: man 2 mount is not going to help. If you had looked closer you would realize that the data argument is the last argument not the filesystem type. The man page only says that the data argument is typically a comma separated string. I don't believe that is the case with NFS. Why not? I would try something like for data: rsize=8192,wsize=8192,soft. Check nfs(5) for details. OK... I did some googling... Source: http://www.die.net/doc/linux/man/man8/mount.8.html Instead of a textual option string, parsed by the kernel, the nfs file system expects a binary argument of type struct nfs_mount_data. The program mount itself parses the following options of the form `tag=value', and puts them in the structure mentioned: rsize=n, wsize=n, timeo=n, retrans=n, acregmin=n, acregmax=n, acdirmin=n, acdirmax=n, actimeo=n, retry=n, port=n, mountport=n, mounthost=name, mountprog=n, mountvers=n, nfsprog=n, nfsvers=n, namlen=n. The option addr=n is accepted but ignored. Also the following Boolean options, possibly preceded by no are recognized: bg, fg, soft, hard, intr, posix, cto, ac, tcp, udp, lock. For details, see nfs(5). I would still recommend looking into the mount source code. If I remember correctly, there is more to it than just creating a struct and populating it. I seem to recall that I also had to do something to register the remote export with the local machine. I vaguely remember fighting to have to get something to show up in /proc before I could successfully mount a filesystem. Josh -- gentoo-user@gentoo.org mailing list