Notes on configuring NFS on Solaris 10

Posted: March 16, 2007 in howto, OS, Solaris 10, Technology

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.

Comments
  1. spetsnaz says:

    very useful, thnx!

  2. [...]  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 [...]

  3. KG says:

    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

  4. KG says:

    Any suggestions on the previous error ?

  5. Dave says:

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

  6. KG says:

    Thanks ! Indeed the problem was my server’s nfs

  7. Magic32 says:

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

  8. Dave says:

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

  9. Juan Sabor says:

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

  10. sleeping_menace says:

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

  11. mpc says:

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

  12. Dave says:

    Hi mpc,

    Thanks

  13. Sam says:

    This is very useful. Thank you ….Dave

  14. Dave says:

    Sam,

    You welcome

  15. Afshin Bozorgzadeh says:

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

  16. Dave says:

    Hi Afshin,

    You welcome

  17. Reddy says:

    Excellent.Very Usefull

  18. Dave says:

    Hi Reddy,

    Thanks

  19. Phil says:

    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!

  20. Dave says:

    Hi Phil,

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

  21. ravi says:

    good work appricateable

  22. javier says:

    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…

  23. javier says:

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

  24. Mohamed Imtiaz says:

    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

  25. 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.

  26. Dave says:

    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.

  27. 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.

  28. Dave says:

    Hi Keith,

    Thank you for sharing your findings.

  29. Reddy says:

    Sounds Grt.

  30. mysbciclub.org says:

    Verry Helpfull, Saved me lots of time. Thanks

    mysbciclub.org

  31. Anuradha says:

    Excellent One. I have no words for apreciation

  32. kumaresh says:

    Hi Dave,

    You are ROCK …
    Keep posting…Thanks

  33. Munikumar says:

    hai dave

    Nice content

  34. Lawrence Hickey says:

    I have a new sunos 5.10 box on a active directory windows network. its all set up, ping telnet ftp work find. put the compiler tools on, created a new disk ,have internet access etc. BUT
    I know very little about the windows side, and I want to expose /export a file system to the network users , but I “My NetworkPlaces” on windows does not find my machine.or net view etc .The DNS knows about my machine, cause can ping it by name, ftp telnet by name all work fine. Internet via the box even works, but Whatever windows facility that populates “My network places” does not know about this machine. I was hoping to get ls //devsun/export to work, devsun is the machine name and “export” is the filesys I tried to export using

    svcadm -v enable -r network/nfs/server
    share -F nfs 0o rw /export
    and added an entry to /etc/dfs/dfstab for this share too.

    . The windows administrator says I need to Do something on the sun box to enable this visability. (not just of the share, but of the machine name itself). Whos fault is it do you think?

  35. siva says:

    Good work Dave.

    Regards
    siva

  36. Dave your a champ mate..This is so easy..after multiple trials and errors…Only your article helped me..thanks a million

  37. Mike says:

    You just saved my a bunch of time, thank you!

  38. Pat says:

    Not gonna lie this was a huge help. Got everything mounted perfectly. Now my only problem is the client is showing the mount as nobody:nobody
    Any idea on how to fix it? The client is RHEL 5.4

  39. manjax says:

    great!
    thanks,
    simple explanation….great effect
    For me granting tghe permission was the problem

    IF, like this
    mount -F nfs solaris12:/u01 /nfstest
    then grant permission in solaris12 as
    chown –R oracle:oinstall /export/nfs4rac

  40. xdanny says:

    Dude – your a star!

    This note is 4+ years old, and is still work very well. This prob saved me days of reading to understand! (Tho now its still up 2 me to read and understand the fine details)

    I am a beginner Sun sys admin and was able to do this in 15 mins

    A+++++++++++++++

  41. prasad says:

    how to break the root password with our user id

  42. Dave says:

    If you are doing an install on reduced networking system you’ll need theses mofos…

    Server:
    system SUNWnfsckr Network File System (NFS) client kernel support (Root)
    system SUNWnfscr Network File System (NFS) client support (Root)
    system SUNWnfscu Network File System (NFS) client support (Usr)
    system SUNWnfsskr Network File System (NFS) server kernel support (Root)
    system SUNWnfssr Network File System (NFS) server support (Root)
    system SUNWnfssu Network File System (NFS) server support (Usr)
    system SUNWgssk kernel GSSAPI V2
    system SUNWrsgk kernel RPCSEC_GSS

    client:
    system SUNWnfsckr Network File System (NFS) client kernel support (Root)
    system SUNWnfscr Network File System (NFS) client support (Root)
    system SUNWnfscu Network File System (NFS) client support (Usr)
    system SUNWgssk kernel GSSAPI V2
    system SUNWrsgk kernel RPCSEC_GSS

  43. Ludovic Kuty says:

    Thanks. This is concise, yet complete.

  44. Srini says:

    hi..
    This blog helped me out a lot and finally me able to config a high-fie topic in Solaris

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s