Notes on configuring NFS on Solaris 10

Here are my notes that I put together based on reading man pages, config sample, and from my previous blog entry on this topic.

1. (optional) mount an extra disk on the machine that will be the NFS server.
2. enable NFS sever by running the following:
svcadm -v enable -r network/nfs/server
3. Run the following command to share via NFS
share -F nfs -o rw /disk
Note: The above share command will not persist over reboots. To persist over reboots, add an entry to /etc/dfs/dfstab

share -F nfs -o rw /disk

4. Run the following command to mount from the client side:
mount -F nfs server:/disk /mount_point
Note: The above mount command will not persist over reboots. To persist over reboots, add the following line in /etc/vfstab:

server:/disk   -   /mount_point   nfs   -   yes    rw,soft

See also this vfstab sample.

Please note that you can’t use the root account on the NFS client host to create files, because root on the NFS client doesn’t mean root on the NFS server. Use a common user account across NFS server and client(s) instead.

38 Comments »

  1. spetsnaz said

    very useful, thnx!

  2. Dave said

    You welcome!

  3. [...]  A tab for network mounts!  All I did was add a quick entry of the form you’d expect, start NFS on my Solaris machine, and voila!  Immediate access to my backups over NFS.  This is great – it [...]

  4. Raymond said

    Very useful tip

  5. Dave said

    Thanks

  6. KG said

    When I did mount -F nfs server:/opt/local /opt/local on my client – it gave me this error
    nfs mount: server: : RPC: Program not registered
    nfs mount: retrying: /opt/local

  7. KG said

    Any suggestions on the previous error ?

  8. Dave said

    According to this post, you might want to check if the server is running. Hope this helps.

  9. KG said

    Thanks ! Indeed the problem was my server’s nfs

  10. Magic32 said

    Thanks! I’ve done this before but couldn’t remember the exact steps. I was able to get it going within minutes!

  11. Dave said

    You welcome. Good to know that the notes helped you.

  12. Juan Sabor said

    Very nice. Saved me tons of time researching. Keep up the good work.
    JS

  13. Dave said

    Thanks!

  14. sleeping_menace said

    Very well written, very concise.
    Sun could take lessons from you on how to document functionality >.
    Cheers

  15. Dave said

    Thank you.

  16. mpc said

    Nice notes indeed helped me to work on the right content
    Keep Going nice work

  17. Dave said

    Hi mpc,

    Thanks

  18. Sam said

    This is very useful. Thank you ….Dave

  19. Dave said

    Sam,

    You welcome

  20. Afshin Bozorgzadeh said

    Awesome concise and to the point. Dave thank you so much

  21. Dave said

    Hi Afshin,

    You welcome

  22. Reddy said

    Excellent.Very Usefull

  23. Dave said

    Hi Reddy,

    Thanks

  24. Phil said

    Hi Dave,
    I was experimenting a backup over NFS problem, which I did not have with solaris 8. I was pretty sure the problem came from the new service management method coming with solaris 10, and indeed, running the svcadm command resolved the issue! Thank you so much!

  25. Dave said

    Hi Phil,

    You welcome. Good to know this information was helpful to you.

  26. ravi said

    good work appricateable

  27. javier said

    hello i followed the steps but when i try to mount the nfs on my client i get…nothing!!

    bash-3.00#svcadm -v enable -r network/nfs/server
    bash-3.00#share -F nfs -o rw /logs
    bash-3.00# mount -F nfs 106.31.65.231:/logs /logs

    after a while, i have to stop it…

    ^C
    bash-3.00#

    but it’s not mounted…. what am i doing wrong? please…

  28. javier said

    my bad, wrong ip (was nat)…great information!!!

  29. Mohamed Imtiaz said

    Hi Dave,

    Thanks much…worked like magic !

    Was struggling all these days to do a NFS mount between two servers. The official “SUN pages/tips/notes” is crap …vague,highly
    technical, confusing and not helpful at all. I guess its a guise to get folks to attend their “official” classes.

    Hey Dave, how about more notes & tips on basic Solaris stuff for us beginners? Would be highly appreciated :)

    Imtiaz

  30. Is it possible for a client side (second solaris box) to view mounted partitions on the server side (first solaris box) if those partitions are ntfs, ext3 and fat32? The nfs network share example worked perfectly for the nfs partition, and I just substituted the relevant ip address instead of the word server when typing the mount command. On the server side (first solaris box), I have mounted various partitions including Fat32, NTFS and ext3. Using the network/nfs/server example in Dave’s Blog, my client side (second Solaris box) is unable to see anything inside the folders on the server side (first solaris box) for those specially mounted partitions (i.e., nothing is visible in the mounted folders that are the fat32, ntfs and ext3 partitions) — however, the partitions and files are visible within the mounted folders on the server side (first solaris box). Both solaris boxes have been set up to read fat32, ntfs and ext3 with FSWfsmisc.tar.gz and FSWpart.tar.gz. I would prefer to have both boxes running Solaris, rather than one running XP and using samba with the other. Thank you.

  31. Dave said

    Hi Keith,

    I don’t see why not. Before ZFS, UFS is typically used on the disk for Solaris. You can share the UFS file system as NFS share. Following the same token, if you can read Fat32, NTFS and EXT3 on the first Solaris box, you should be able to share them through NFS to other Solaris instances. I haven’t tried this myself. Let us know your findings. Thanks.

  32. Here is an update to my quest to share between NTFS, EXT2FS and UFS file systems: Microsoft Windows Services for Unix 3.5 (aka “SFU”) is a free program that enables a Solaris box to share files with an XP box, and it is possible to have read/write access on both boxes if so desired — this setup requires one box running XP and the other box running Solaris. To date, I have been unable to mount ext2fs and ntfs partitions onto computer number two from computer number one with both computers running Solaris simultaneously — FSWfsmisc.tar.gz and FSWpart.tar.gz enable read-only access as to ntfs and ext2fs partitions on the same Solaris box running Solaris, but I have been unable to mount those ntfs and ext2fs partitions from the first Solaris Box so that they are visible with read-only access on the second Solaris box.

  33. Dave said

    Hi Keith,

    Thank you for sharing your findings.

  34. Reddy said

    Sounds Grt.

  35. mysbciclub.org said

    Verry Helpfull, Saved me lots of time. Thanks

    mysbciclub.org

  36. Anuradha said

    Excellent One. I have no words for apreciation

  37. kumaresh said

    Hi Dave,

    You are ROCK …
    Keep posting…Thanks

  38. Munikumar said

    hai dave

    Nice content

RSS feed for comments on this post · TrackBack URI

Leave a Comment